I have a redmine instance deployed on a Linux x86_64 system and I am struggle with a funny performance inconsistency issue. It behave like this:
Leave it alone for a couple of hours (no request to the application at all) then establish a connection, it takes a very long time to response to the first few requests (can be as bad as 15 seconds+, sometimes every for response at about 1 minute). After the first few requests, it performance very quickly, almost instantly where I can see from the log that it takes less than 100ms to response.
I have tried a couple of options to run it using mongrel, deployed it on passenger-Nginx, and on passenger-Apache. The behaviour simply reproduceable. I realised from the testing when it is keeping busy, there will be no problem at all.
What is it all about? How can I improve this?
The issue is most likely caused by the the Passenger pool idleling out. You can either increase the PassengePoolIdleTime to a larger number, or if you don't wan it to time out at all set the value to 0. An Apache config something like below should fix the issues
<VirtualHost *:80>
DocumentRoot /path/to/redmine/site/public
ServerName example.com
PassengerPoolIdleTime 0
<Directory "/path/to/redmine/site/public">
PassengerEnabled on
AllowOverride
Options -MultiViews
</Directory>
</VirtualHost>