Last month , I relaize my server is too slow. I checked the memory , it only use 50%. However cpu load average is load average: 0.97, 1.15, 1.05 . It’s a reason , server is too slow.
At this time , I don’t know how to fix. So, I asked digital ocean and digital ocean recommend to change DB server or upgrade a new server. So , I upgrade it. But still slow. I couldn’t find a reason.
So, I search about what is load average. I found Understanding Linux CPU Load - when should you be worried?. It’s really helpful for me.
After that I check /var/log/nginx/access.log . I found wp-admin/admin-ajax.php request a lot from my myanmar blog. I checked admin-ajax.php and it’s load the whole library of wordpress. So, it’s a one of the reason to make my slow. The question is why admin-ajax.php call a lot ? I open my myanmar blog and check the view source. I found it. I am using KUDOS wordpress plugin and it request admin-ajax.php to every 30 seconds. So, it’s a problem. I found another request from quote collection plugin. I can disable ajax request in KUDOS plguin. However, I can’t disable ajax request in quotes-collection setting. So, I disabled this plugin.
After that , I checked my load average.
$ uptime 03:51:34 up 6 days, 31 min, 1 user, load average: 0.02, 0.14, 0.20
Now, the load average is very different. It’s not a problem of CPU. It’s a problem of ajax request too much. So, it will like DDOS attack itself.
Now, the server is working fine again.