Jump to content

number of processes seen under http://localhost/server-status


alluoshi

Recommended Posts

Hello, when I restarted my Linux server where Apache 2 webserver is installed, I saw that there were only 5 processes under http://localhost/server-status. When one end user sent a request to Apache, I saw 8 processes. When a second user sent a request to Apache, I saw 9 processes. When the third user sent a request to Apache, I saw 10 processes. I can't test more than 3 users.

I was just wondering if this is the case the Apache deals with requests. I mean does Apache always creates a process for a new user?

Link to comment
Share on other sites

No.

 

Apache has a thread pool (some from each processor/core), and when ever a user requests something, Apache delegates the request to an idle thread.

 

 

The processes/threads you see being spawned are likely being spawned because no free threads exist, and the thread limit has not been reached.

Link to comment
Share on other sites

Thank you. This makes sense.

I would like to learn how Apache2 communicates with php. I mean, I have a web application where users make requests through Apache2 and php. As explained, Apache has a pool of threads and will create new threads/processes to support more users. When the user sends a request, Apache will assign some threads/processes to this request. After that, it will communicate with php and php will perform an action (say create an Mysql database) and here some threads/processes will be spawned (Mysql processes). How can I know the result when Apache first assigns these threads/processes to end users? (which Apache threads/processes caused the creation of Mysql processes?)

Link to comment
Share on other sites

I care because ultimately I want to measure the CPU usage for all users who are using my web application (through Apache2 and php). Ultimately, if I know all the processes/threads that will be spawned for a user's request, I might be able to measure the summation of the CPU usages of these processes. That's why I thought if I can trace each Apache's thread and if I can map all Apache's threads that are related to a given user, I might solve my problem.

I appreciate any other solutions to solve my problem. By the way, can Apache APR solve my problem?

Link to comment
Share on other sites

I mean by users the end users who are using their browsers to access the web application. In my case, end users are using phpmyadmin to access Mysql (I am working on Mysql as an example of multi-user application but I would like my project to be implemented on any multi-user web application). So in my case, the end users are the users that are created in Mysql. I am not stuck to this situation if other solutions are easier.(currently, there is no client side or server side application, but I would write one if this helps)

I really appreciate your help since this is my university project and I couldn't find anyone to help me out.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.