I'm having trouble with one of our Rails 3 app's. When a lot of requests are sent to the server (10 / second) the whole server stalls. I tried a lot of different passenger setups and sometimes I noticed a slight improvement but none of them ended up to be a solution.
My setup:
- Intel i7 (8 cores)
- 8GB ram
- Ubuntu 10.04 Server
- Ruby 1.9.2
- Rails 3
- Apache 2.2.14
- Passenger 2.2.15
- MySQL 5.1.41
My current passenger.conf:
PassengerMaxPoolSize 12
PassengerUseGlobalQueue on
PassengerHighPerformance on
RailsSpawnMethod smart
PassengerMaxRequests 5000
PassengerStatThrottleRate 5
RailsAppSpawnerIdleTime 0
PassengerPoolIdleTime 600
This server is dedicated to one app. Well, one app in staging and production mode.
I tried to play with the PassengerMaxPoolSize, setting it to 4, 12, 20, 40, 80, ... stalling remains. The strange thing is Passenger seems to spawn more apps than the defined MaxPoolSize. Currently it is set to 12 but in htop I can find at least 34 of these:
1234 username 20 0 260M 97572 3892 S 0.0 1.2 0:00.13 Rack: /var/www/domains/domain.com/current
I can replicate this issue easily by just opening 30 tabs with the root page of our app. The first 10 or so load instantly, the rest takes at least a minute to present something.
I'm out of ideas. Anyone an idea on how to fix this?