开发者

Viewing Apache server status

Any way using php to find out how many apache workers are being used and how many are idle?

I'm not sure if idle workers is the correct word for it but basically I want to find out 开发者_运维问答whether my server is overloaded or if there are plenty of resources for the demand.


Just as @FractalizeR has mentioned mod_status is a good place to start. Once you have it up and running your server status can be retrieved in a machine readable format (http://127.0.0.1/server-status?auto) or a more detailed format human readable format (http://127.0.0.1/server-status)

It is best to poll your server-status and log it to a file, that way you can get a more accurate picture of what your server is doing. You could use 'links -dump http://site/server-status' to get a text only representation of your server status. After that it is up to you.

What I do is use a combination of 'links' (or lynx) , awk and grep to time stamp each child process line. I take a server status snapshot every 30s-60s minute and this gives me a very clear picture of server activity.


Well, use mod_status and query status URL with CURL:

http://httpd.apache.org/docs/current/mod/mod_status.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜