Score:0

Apache hits max connections after server upgrade

in flag

I recently upgraded a web server from Debian 8 to Debian 11, no errors concerning Apache were noted. Before the upgrade the website performed smoothly. The only configuration change made was to switch to php7.4 from php5.

Apache is set to use mpm-prefork with a MaxRequestWorkers, initially set to 150. After the upgrade the max connections limit has been reached multiple times. The first few times I upped the MaxRequestWorkers to 200, then 256. I then analyzed the server hardware, not having set it up, and set the ServerLimit to 400 with a MaxRequestWorkers at 300. It is still hitting this limit. When it does I have to restart the Apache service, systemctl restart apache2. If I do not it will continue to be unresponsive until it is restarted.

I have pulled and analyzed the logs using GoAccess and have found no evidence of DOS attacks or bad clients. It feels as if the upgrade caused an issue somewhere. Looking for possible ideas as to why this may be.

Edit: Found a second possibly related issue where files that were accessible to download no longer complete the download. The download gets "stuck" after a percentage, 2%-40% in tests, of the file is downloaded. This leaves processes in a limbo state which is most likely causing the original issue noted. The files do test as good, via SHASUM comparison with the originals on other servers, and text files can be read directly on the web server via console.

Gerard H. Pille avatar
in flag
I'd have a look at the PHP, the php-fpm configuration. Does the PHP connect to a database?
Chris Woelkers avatar
in flag
I cannot find any php-fpm configuration files. PHP is used for database connections though that part of the site is currently down for unrelated reasons.
Gerard H. Pille avatar
in flag
You're sure the hanging requests have no relation to "that part of the site"? Check Apache's server-status page. How is the PHP handled by Apache if you don't have php-fpm?
Chris Woelkers avatar
in flag
Said portion of the site is for Pydio 8. It was found to be inaccessible after the upgrade, php7.4 not supported, so was disabled. The problem remained afterwards. php-fpm is not even installed, just the standard php binary along with the Apache mod.
Gerard H. Pille avatar
in flag
Ah yes, "The PHP version reached end-of-life state on 31 December 2019", ie. two years ago. So, is PHP still in use? What does server-status show?
Chris Woelkers avatar
in flag
As far as I'm aware it is as multiple pages have the php extension. Not certain what for though as I do not develop the site, just manage the server. The server-status makes no mention of PHP.
Gerard H. Pille avatar
in flag
Perhaps you could concentrate on what server-status does mention? First those requests with the longest wait.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.