You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that if the incoming request for the large file (ex over 1GB) the total request per second is decreasing vs node.js static file handler.
So there are some points here:
Rocket start with the fixed number of worker. Mean if any incoming request, a worker in the pool will handler it? (If pool have 10 workers, then at the same time can handler 10 requests concurrently)
If all worker takes more time to handler request until done (ex. large process/ download file) another new incoming request must wait for any free worker? (I found that it another request must wait)
So the node.js handler in a different way by can accept all connection and by using event loop and serve a chunk of the file then response concurrently.
With Rocket, if the request for the large file and all worker are busy to read the file and can't accept the new incoming request, then the connecting timeout raise at the client.
So how to resolve this case like node.js? mean can accept all connection and we have many concurrent threads read chunk bytes of file and response to the client.
So how to resolve this case like node.js? mean can accept all connection and we have many concurrent threads read chunk bytes of file and response to the client.
If I understand correctly, you're asking if it's possible to configure Rocket so that it handle requests in the way that Node.JS does. The answer is no: doing so would mean that Rocket handles requests asynchronously, which would require rearchitecting the HTTP sublayer. This is scheduled to happen soon as is being tracked in #17.
I intend to use Rocket replace Node.js for static file handler base on example: https://github.com/SergioBenitez/Rocket/tree/master/examples/static_files
The main point here use NamedFile structure and after look in deep implement:
https://github.com/SergioBenitez/Rocket/blob/f171dc9d095b9b1f63ba5bb69fbbbdf4aef7ccf2/core/lib/src/response/named_file.rs
I found that if the incoming request for the large file (ex over 1GB) the total request per second is decreasing vs node.js static file handler.
So there are some points here:
So the node.js handler in a different way by can accept all connection and by using event loop and serve a chunk of the file then response concurrently.
With Rocket, if the request for the large file and all worker are busy to read the file and can't accept the new incoming request, then the connecting timeout raise at the client.
So how to resolve this case like node.js? mean can accept all connection and we have many concurrent threads read chunk bytes of file and response to the client.
Express
Rocket
Run benchmark (https://github.com/aliostad/SuperBenchmarker)
Express (Node.js)
Rocket
The text was updated successfully, but these errors were encountered: