Answer the question
In order to leave comments, you need to log in
Why does the site freeze with free memory and processor?
Such a problem!
The site is running on VDS: Centos 7 (by BitrixVM) + php 7.1 + apache 2.4 (prefork) + nginx.
Already for 2 weeks there have been short-term freezes of the site (most likely apache2) (does not depend on the time of day and day of the week)
while:
- more than enough RAM (200-300 mb free, almost
always), swap is almost all free, the processor is the moments of freezing are
mostly free (not higher than 7% load), the disk is not loaded.
- The apache, nginx, mysql logs are empty, without errors,
- DDOS attacks are not visible, there is no traffic surge.
Hanging up as if from a heavy Apache process and does not allow anything else to be done, but at the same time, the sessions of all users, and not just mine, hang up. This is at prefork! Nginx is working properly at this moment and unauthorized users are given the site from the cache.
At the moment of freezing in the list of running processes, httpd disappears, as if it is not running, and an attempt to restart it with the systemctl restart httpd command does not bring any result, it freezes for 1-2 minutes, as if Apache is holding a heavy process. Restarting Apache does not guarantee that the work will be restored, it happens that after a minute everything repeats again.
Timeweb VDS support did a quick check and found nothing either.
Where to dig?
Help!
Screenshot of atop at the moment of freezing:
Answer the question
In order to leave comments, you need to log in
Solved the problem.
It was in Bitrix CMS, namely, I found the SessionTable::lock function, which sends GET_LOCK("***", 60) requests to the database.
Unfortunately, little is written about it in the documentation. It is not clear when it works, but I have a suspicion that when the number of simultaneous requests to MySQL is approaching the limit.
As a result, we get a blocking of the site for 1 minute and empty logs.
Some of the queries to the database that went through Bitrix were registered in pure PHP and the freezes stopped.
Thanks to all!
And what about IOPS, does the load on the disk increase at this time? Maybe he is the weak point?
https://ruhighload.com/%D0%9A%D0%B0%D0%BA+%D0%B2%D...
50 slow requests and no one but root 51 will be able to join.
Nothing to guess. Need information on monitoring OS parameters.
https://haydenjames.io/use-atop-linux-server-perfo...
https://haydenjames.io/linux-server-performance-di...
How to diagnose hanging php-fpm processes?
The site does not refer to any third-party resources? It seems that the answer does not work and freezes
If everything has been checked for hardware resources, then try using a distributed tracing system like zipkin. Maybe such a system can help find bottlenecks.
Show the output of the command
Well, in general, it would be nice to crawl / var / log for strange entries at this moment.
iotop -oka
and wait 10 minutes
also enable nagios monitoring in vm
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question