Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a site with a relatively low amount of traffic that's normally served happily by 3 or 4 passenger instances.

However, sometimes it is getting hammered by a large number of automated requests that can take up to 15-20 seconds to completed. This results in the global queue backing up and the server becoming unresponsive to ordinary users:

----------- General information ------
max      = 18                                       
count    = 18                                       
active   = 17                                       
inactive = 1                                        
Waiting on global queue: 115                        

Fifteen minutes later, after restarting apache to clear the queue everything is back to normal:

----------- General information -----------
max      = 18
count    = 4
active   = 0
inactive = 4
Waiting on global queue: 0

----------- Application groups -----------
/apps/mailapp/current:
  App root: /apps/mailapp/current
  * PID: 31044   Sessions: 0    Processed: 275     Uptime: 14m 21s
  * PID: 31047   Sessions: 0    Processed: 314     Uptime: 14m 21s
  * PID: 31060   Sessions: 0    Processed: 284     Uptime: 14m 17s

I've push up the max number of instances to 18 (about as many as can concurrently run on the VPS) which has helped a little, but not much. I've optimized the request as much as I can (down from 30 seconds or so to 15-20 seconds).

As the requests that are causing it to back up are automated, there is no need to serve them in a particularly timely manner. Is there any way that I can set aside a number of passenger instances that just serve this particular request?? (based on url path maybe).

share|improve this question
    
Did you get anywhere with this? I was just about to ask exactly the same question when I found yours. –  Loop Space Dec 7 '11 at 8:57
add comment

1 Answer 1

up vote 0 down vote accepted

I sort of fixed this.

I have created a new virtual host with apache with limits on the max number of instances.

This was symlinked on the os to point to the original app. This lets me run the main app with as many instances as I need, but with restrictions on how many instances the symlinked virtual host can run.

This has raised a somewhat related issue regarding cpu-usage on the symlinked host: Apache/Passenger and cpulimit

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.