Before starting with details, I think it would be good to explain “why hosting service providers count the executions?” and “why lowering them ensures smooth performance?”. Based on my experience on the field, I can say for sure that hosting companies pay attention to executions and overall performance. It happens because increased usage of server resources may affect the other users hosted on the same server. The main idea is to guarantee the fair share of the resources.
What is the connection between WordPress executions and CPU usage ?
Well, that is easy. Usually a high number of executions requires more CPU. The things however, going further. If your account generates a lot of executions with low real time CPU this means that your website is well known with a lot of visitors. Alternatively your website may contain malicious files or it is a target of DDoS attack. The opposite is low number of executions with high CPU time. The only conclusion in this case is poor coding. Perhaps some of the additional plugins do not work as good as expected.
So, how to proceed when the alarm is sounded ?
Traffic flow analysis
Usually the hosting service providers offer tools to analyse the flow and find a solution. In this particular case, we will review the options in Awstats tool which is available in all cPanel based control panels.
Hosts – in this part you can find top hosts or IP that visited your website. If you see suspicious activity, you can easily block the offending hosts using IP Deny Manager. This is another handy tool available in cPanel.
Robots and Spiders – nowadays the automated programs that crowl websites are known as spiders or robots. In many cases however, they are quite aggressive and cause CPU spikes. What you can do is block or limit them using robots.txt file. It should place it in the root folder or your website. It should contain instructions about the robots and more specifically what to be crowled and what not. Additionally you can set crowl delay to lower the number of hits.
Pages and URLs – this is another important part of the stats. If you see unusually high number of hits towards the login page, then perhaps some bots are trying to gain access. In this case, I advise you to protect the login form either using plugin or deny rules in .htaccess file
WordPress and Slow Mysql Queries
Another aspect of the whole problem is the interaction between WordPress and Mysql daemon. Considering the fact that by default WordPress operates with indexed databases, during its normal functionality no slow queries should occur. The situation however, changes when there are poorly coded plugins or the database got too large. When it happens, Mysql daemon needs more time to handle the query and return results. If the time frame is over a second, then this is slow and the query itself gets into mysql slow log. Mysql puts it in slow query log and starts working slowly because other queries are made while the daemon is trying to work on the slow one. The ultimate effect of this is slowly working website or server.
What to do when the reason for the low speed are slow Mysql queries ?
More or less this problem requires the attention of a professional developer familiar with the specifics of your website. Random actions such as clearing logs or tables may affect the normal functionality of the entire website. I advise you to proceed this way only if you are sure what is the ultimate effect. If you have slow queries, then they need to be analysed and carefully fixed. Note that Mysql restart is only temporary solution, so you should not rely on it. If no developer is available at the moment, you can open PhpMyAdmin tool and find the largest tables. Once done, you may disable the plugin that puts or gets data from it. Another option is to look for transient records and remove them using plugin. Large number of transient records in wp-options table could usually result in slow performance.
|Рязане и пробиване на бетон||Сканиране на бетон||Безвзривно разрушаване на бетон|