Answer the question
In order to leave comments, you need to log in
Why does the web server slow down?
Good afternoon. There is a nextcloud server on debian 11, with a postgresql database.
After switching to https, wild brakes began (in a couple of days) ... the site throws out a 502 \ 504 error
of Clients - 30 people, files in total 100GB.
300 "set-top boxes" on Linux, which in N hours request different folders for synchronization, using rclone, via webdav . A
common calendar is also configured, tied to iOS\Android smart phones of these 30 users.
The problem started, if I understood correctly, after switching to https... (which was required to enable sync calendars)
Used nginx, everything was fine. Now, once every N days\hours, php-fpm goes on a "spree", loading the CPU wildly (50% of the 8-core Intel), and puts the web server ... in the NGINX logs - connect time, which is logical ... in php-fpm logs - silence
I decided that the problem was with NGINX, quickly transferred everything to Apache.... The same crap, a bunch of Apache processes are created, there is a big load. But the Apache at least somehow works .. lets it creak. Moreover, after the first login - everything flies further ...
postgresql 13
php - 8 version of
apache2 and nginx - the last available, for debian11 in standard repos ...
The processor is free, the RAM is dofiga, everything is ok with disks, the network is not
loaded brute force (built-in from nextcloud) firewall closed everything except ports 80 and 443 (and ssh to my IP)
Help someone with what you can, I have already broken my whole head ...
Apache SSL config
Answer the question
In order to leave comments, you need to log in
In general.
after increasing the network speed by 1000mb and commenting with RewriteEngine in the apache config, the errors disappeared ... php-fpm was also removed, everything works on the mod_php module
.
commented out the lines)
Look at the server logs, Apache logs, run htop and see if anything else can load the server. It can be anything from a tuning curve to DDoS.
So Apache also swears to you
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
, and Nginx swears[mpm_prefork:error] [pid 70323] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
on the same thing, but you don’t see point-blank? HINT: See server log for query details.\nCONTEXT: while rechecking updated tuple (4,118) in relation "oc_file_locks"
, one query updates the records (and thus locked the tables), other queries wait for the lock to end and cannot wait. What HTTP requests slow down?
What file operations do these requests cause?
What happens to the database at this time?
How many simultaneous requests from clients during such loads?
I would try to get graphs of various parameters over time, from which you can build on to solve the problem.
You can install some munin-node or other monitoring systems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question