NodeServices - multiple node workers? #262

Closed
opened 2025-08-09 17:15:37 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @caesay on 12/15/2017

I'm sharing a lot of code between my client and my server via NodeServices, and some of this client side code is heavy. If we receive several requests at the same time, nodejs can only process them one at a time. Because of this, I was wondering if would be possible to start up more than one HttpNodeInstance and spread the requests over multiple processes.

It should be possible in theory, but most of the code in this library is internal so I'm not sure if there is an extension point somewhere (I can't even instantiate a HttpNodeInstance which appears to be the only supported hosting model)

The prompt for this query is because of something i've observed - if I hit F5 a bunch of times in rapid succession, it processes each request one after the other, taking 1-2 seconds each. No other requests are processed by node until each of these has finished. This means that 20 connections at the same time will take 20-40 seconds to render.

*Originally created by @caesay on 12/15/2017* I'm sharing a lot of code between my client and my server via NodeServices, and some of this client side code is heavy. If we receive several requests at the same time, nodejs can only process them one at a time. Because of this, I was wondering if would be possible to start up more than one `HttpNodeInstance` and spread the requests over multiple processes. It should be possible in theory, but most of the code in this library is internal so I'm not sure if there is an extension point somewhere (I can't even instantiate a `HttpNodeInstance` which appears to be the only supported hosting model) The prompt for this query is because of something i've observed - if I hit F5 a bunch of times in rapid succession, it processes each request one after the other, taking 1-2 seconds each. No other requests are processed by node until each of these has finished. This means that 20 connections at the same time will take 20-40 seconds to render.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#262
No description provided.