Apache extremely slow without apparent reason!

Hi

Here is my situation, I run a server on Ubuntu 16.04.2 with Virtualmin 6.02-2 Pro I use apache for web hosting and PHP 7.0 and 7.3 depending of customers. That server also hosts dns, mail, and mysql servers. It’s runninq fine since ages (Thanks Virtualmin for the great work :wink: but since two days I have a very strange problem with that server.
Everything is working fine on it excepted web service that became insanely slow and time-out most of time !! I restarted Apache and also MySQL server but situation is still the same. Everything else is working perfectly fine on server. Any ideas what can do that ?
I checked the apache log and all I could find is that:

[Wed Mar 18 10:45:58.711928 2020] [fcgid:warn] [pid 9529] mod_fcgid: process 34781 graceful kill fail, sending SIGKILL
[Wed Mar 18 10:46:10.724244 2020] [fcgid:warn] [pid 9529] mod_fcgid: process 47404 graceful kill fail, sending SIGKILL
[Wed Mar 18 10:46:40.747927 2020] [fcgid:warn] [pid 9529] mod_fcgid: process 47403 graceful kill fail, sending SIGKILL
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Mar 18 11:29:14.546299 2020] [fcgid:warn] [pid 9529] mod_fcgid: process 6298 graceful kill fail, sending SIGKILL
[Wed Mar 18 11:31:38.682762 2020] [fcgid:warn] [pid 9529] mod_fcgid: process 10416 graceful kill fail, sending SIGKILL
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0

I checked all the php.ini file but I couldn’t find any mention to load a DLL in these (out of lines already commented) and still not sure it’s really the problem !
What can I check to understand where is the problem ? Web interface of Virtualmin/Webmin works perfectly and load of server is ridiculously low !!

Thanks for your help or ideas :wink:

Vincèn

Hi,

mod_fcgid: process 34781 graceful kill fail, sending SIGKILL

It might meant that you have too many clients trying to connect at the same time, and it just timeouts. Have a look at Website Options/Maximum PHP script run time. Besides, there are also other Apache directives that should be considered checking, such as MaxClients and probably other.

However, it may well be not the real cause of the issue, I think.

Have a look at running processes, it’s very likely that something is using CPU a lot. It’s also possible that you are under DDoS as well.

Start from looking at top and free -h commands output.

I would try switching to using php-fpm instead, adding more RAM to the server if needed, and just trying, as a last option to reboot the server, but only after installing latest updates! You apparently didn’t update your server!? Latest available Virtualmin version is 6.08 for Ubuntu 16.04, and yours is over 2 years old.

Moreover, have a look at our guide of how to handle issues on machines with low resources (memory).

Hi Illia

Thanks a lot for your valuable tips :wink: I tried already to increase as you suggested the Apache limits but without much success ! CPU is never reaching more than 15% and on 128Go of RAM in machine I have only a quarter used at max so not a hardware ressource problem I guess :confused:
I checked top also as you indicated but nothing special on unusual at first !
I wanted to do the updates as I’m afraid to have been so bad on it but I have an issue (is it on my side or a temporary problem on Webmin servers ?

Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                                                                              
Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                                              
Ign:6 http://download.webmin.com/download/repository sarge InRelease                                                         
Hit:7 https://www.collaboraoffice.com/repos/CollaboraOnline/CODE ./ InRelease
Ign:8 http://software.virtualmin.com/ubuntu virtualmin-xenial InRelease                                 
Hit:9 http://download.webmin.com/download/repository sarge Release                                      
Ign:10 http://software.virtualmin.com/ubuntu virtualmin-universal InRelease  
Err:12 http://software.virtualmin.com/ubuntu virtualmin-xenial Release
  401  Unauthorized [IP: 163.172.162.254 80]
Err:13 http://software.virtualmin.com/ubuntu virtualmin-universal Release
  401  Unauthorized [IP: 163.172.162.254 80]
Reading package lists... Done

For apt commands when I try to update repo cache or update packages of virtualmin themselves :frowning:

Thanks

Vincèn

Have a look at /etc/apt/sources.list file - do you have correct serial and license set there?

Good point and shame on me :frowning: I had replaced my licence two years ago for a bigger one but never putted it in server :smiley: I have updated server with correct licence and all went fine for updates then :+1:
I have rebooted server and everything is back to normal so a little boring as not sure what was problem and not sure all the more it won’t come back but I guess that a reboot on a server with uptime of 1000 days is normal :wink:

Side question if you don’t mind: do you sell temporary licences ? I’m going to migrate that Virtualmin setup and all clients to a new server so will need during a little time “double” licences between old server and new server during time of setup/transfer of accounts !

Thanks a lot :wink:

You wouldn’t need any other kind of licenses. You could use your existing one when installing and setting up a new server, and we will not block it, in case you migrate within short period of time, and stop using it, on your old server afterwards. You may see a warning in UI though, which you can safely ignore in this case, and which will go away by itself, when you drop your old installation.

Ah cool perfect then :wink: Great news !

Thanks for all :wink: