Replies: 2 comments 3 replies
-
Easly you can count number of requests your server is handling at time and when they exceed maximum requests you send 503 status code .
That's how I handle that . you can contact me for more details about this . |
Beta Was this translation helpful? Give feedback.
2 replies
-
Great @mai1x9 it looks like we are going to solve this, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there, when server is busy, express probably needs to send
503
, how does one decide when server need to send503
. I have used middleware for returning503
which is on top of every route and other middlewares. However on what metrics should I consider server is busy?Currently, I am using toobusy-js npm library (https://www.npmjs.com/package/toobusy-js) and from the documentation, it says
What would be the best value for maxLag, or interval to be set. Under loadtesting with apache bench with concurrency
1000
and20k
requests most of the requests are hitting503
response. I have set the values formaxLag=100
andinterval=500
accordingly.Other library options I have explored on,
and calling them in a middleware. Is there any best metric to tell express to send
503
?Some of the options i could find out
1000
users without sending much503
codes.503
. Is it a good metric to consider?503
based on APM, like cpu% or mem%.On side note, the application does not compute any cpu intensive tasks other than some basic json manipulation's, and have db operations/file operations.
Beta Was this translation helpful? Give feedback.
All reactions