I have recently made some changes in my staging server to get 3 times better response. Would like to share the points with everyone so that other don’t have to do so much of googling that I did.
So, I have my staging(256MB) and production server(2GB). On staging when I had MaxPoolSize of 6(default: Max number of threads spawned by passenger). My server gets killed in 10 consecutive requests coz of use of lots of swap. So I had to make it to 2 as passenger doc suggests to make it 2-3 for 256 MB server.
But now one more problem arise, that response time for the request after long time(which could be anything > 10mins) was very high around 30s. Which is quite unacceptable. I found the reason being the MaxPoolTime(Max time in which the threads got killed if no request encountered). And once all the threads got killed and then comes a request it takes whole lot of time to start these:
1. Framework Spawner
2. Application Spawner
3. Then Spawn a new thread
The solution to this problem was not letting one of the thread get killed. I have searched a lot for this but got noway by which this can be implemented. So I have to find a work around. Which was… to set the Application Spawner not getting killed. This can be achieved by setting APP_SPAWNER_MAX_IDLE_TIME to very large(say 999999).
I have received amazing improved performance by applying this. Would you like to try???