We have a high Apache CPU usage on our plesk . the percent is 45,7%
Why could this happen and what can I do when high CPU usages shows ?
Should I restart apache? Would that affect anything on the server for our clients? (I'm still new so not sure what does affect domains and the server and what not)
Thanks
server health apache CPU usage
-
- Forum User
- Posts: 60
- Joined: Mon Jul 23, 2012 5:22 am
- Location: Salisbury
Re: server health apache CPU usage
If you restart apache it should make sites go offline for a split second it will likely not even be noticed.
On occasion this is needed, but you can also restart apache gracefully which makes sure active tasks get completed before it restarts itself.
So yes it will effect things, but unless apache fails to restart it will only be for 1 second at most. But don't be worried about that. Everytime you add a domain in plesk apache has to be restarted. So this is normal operations for a webserver.
It's unlikely though this will solve your cpu issue unless a task has crashed for some reason. You can try to restart, but if the problem continues you may want to post some apache settings. Also if your running PHP through apache? This could be the reason why apache has high cpu usage. It's advised to run PHP under fast-cgi in plesk. As running under apache (mod_php) is not secure, and causes permission issues.
On occasion this is needed, but you can also restart apache gracefully which makes sure active tasks get completed before it restarts itself.
So yes it will effect things, but unless apache fails to restart it will only be for 1 second at most. But don't be worried about that. Everytime you add a domain in plesk apache has to be restarted. So this is normal operations for a webserver.
It's unlikely though this will solve your cpu issue unless a task has crashed for some reason. You can try to restart, but if the problem continues you may want to post some apache settings. Also if your running PHP through apache? This could be the reason why apache has high cpu usage. It's advised to run PHP under fast-cgi in plesk. As running under apache (mod_php) is not secure, and causes permission issues.
Re: server health apache CPU usage
It can have some effect depending on the type of web sites and web application you are hosting on your server. We have several clients that will panick once the web server goes offline, even for some seconds. Also, if only one process is causing trouble why would you want to restart the whole web server? You could simply investigate the one process and even kill this one process if you believe it is causing trouble.srpurdy wrote:If you restart apache it should make sites go offline for a split second it will likely not even be noticed.
On occasion this is needed, but you can also restart apache gracefully which makes sure active tasks get completed before it restarts itself.
So yes it will effect things, but unless apache fails to restart it will only be for 1 second at most. But don't be worried about that. Everytime you add a domain in plesk apache has to be restarted. So this is normal operations for a webserver.
Plesk only restarts Apache httpd gracefully. It is not normal operations for a web server to be non-gracefully restarted regularly.
You could investigate the process (using strace, lsof etc.) to find out what the process is doing.It's unlikely though this will solve your cpu issue unless a task has crashed for some reason. You can try to restart, but if the problem continues you may want to post some apache settings.
40 % cpu usage for a short period of time is not necessarily out of the ordinary. It all depends on what the impact on your server is.
Running PHP under fast-cgi actually consumes more RAM. Apache mod_php is the most efficient way to run PHP code in Plesk. It is not necessarily insecure provided you have open_basedir configured and the hardened ASL PHP configuration. Permission issues can be resolved by changing permissions on certain files. Although not the most ideal or user-friendly option, this is not necessarily bad.Also if your running PHP through apache? This could be the reason why apache has high cpu usage. It's advised to run PHP under fast-cgi in plesk. As running under apache (mod_php) is not secure, and causes permission issues.
Lemonbit Internet Dedicated Server Management
Re: server health apache CPU usage
I never suggested to restart apache. If you read my post. The OP is the one asking wither apache should be restarted.prupert wrote:It can have some effect depending on the type of web sites and web application you are hosting on your server. We have several clients that will panick once the web server goes offline, even for some seconds. Also, if only one process is causing trouble why would you want to restart the whole web server? You could simply investigate the one process and even kill this one process if you believe it is causing trouble.srpurdy wrote:If you restart apache it should make sites go offline for a split second it will likely not even be noticed.
On occasion this is needed, but you can also restart apache gracefully which makes sure active tasks get completed before it restarts itself.
So yes it will effect things, but unless apache fails to restart it will only be for 1 second at most. But don't be worried about that. Everytime you add a domain in plesk apache has to be restarted. So this is normal operations for a webserver.
Plesk only restarts Apache httpd gracefully. It is not normal operations for a web server to be non-gracefully restarted regularly.
You could investigate the process (using strace, lsof etc.) to find out what the process is doing.It's unlikely though this will solve your cpu issue unless a task has crashed for some reason. You can try to restart, but if the problem continues you may want to post some apache settings.
40 % cpu usage for a short period of time is not necessarily out of the ordinary. It all depends on what the impact on your server is.
Running PHP under fast-cgi actually consumes more RAM. Apache mod_php is the most efficient way to run PHP code in Plesk. It is not necessarily insecure provided you have open_basedir configured and the hardened ASL PHP configuration. Permission issues can be resolved by changing permissions on certain files. Although not the most ideal or user-friendly option, this is not necessarily bad.Also if your running PHP through apache? This could be the reason why apache has high cpu usage. It's advised to run PHP under fast-cgi in plesk. As running under apache (mod_php) is not secure, and causes permission issues.
You basically re-worded what I said.
As for PHP. I guess if you don't mind 777 and 666 permissions than have at it. It might be the fastest way to run php,(which has nothing to do with plesk) but it's hardly secure. Open base directory is solely for php. What happens if the user uploads a perl script? If you must run mod_php better to use mod_ruid2 along with it.
IF memory is really that much of a concern consider running apache in worker_mpm with fast-cgi. or even better php-fpm. php-fpm is really fast and secure. That all depends on how many virtual hosts you have and memory, but the OP never mentioned any of that.