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.

If 10 requests hit Apache, does it process them one by one, so when R3 finishes, then it starts to run R4, or does it fire 10 processes/threads/whatever and are resolved simultaneously?

Now some background: I have a PHP script that takes up to two minutes to do some processes. My question is: while a client is waiting for this 2 minutes, all the other clients requests are being processed? Or also waiting for this one to end?

By the way, if there are simultaneous request, how can I handle them? Let's say put a limit on them. Or a limit on resources consumed. For instance I want the server to use its 80% performance on serving the webapp, and just a 20% for those long operations, because I have no hurry to end them.

I don't know if it matters, but is all in PHP.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The server handles requests concurrently up to a limit which you set in the configuration file. Have a look at these directives:

MinSpareThreads
MaxSpareThreads
ThreadsPerChild
MaxClients
MaxRequestsPerChild
share|improve this answer
    
Thanks! How about setting resources limits, is that possible? If so, how? –  Vicenç Gascó Sep 28 '12 at 9:43
    
I think you're looking for`RLimitCPU`and RLimitMEM –  Jenny D Sep 28 '12 at 9:48
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.