Connect() failed (111: Connection refused) while connecting to upstream

All sites are not loading properly and this shows up in the error logs:

connect() failed (111: Connection refused) while connecting to upstream

The sites starts to work again when running this command but the problem returns again after a minute:

sudo systemctl restart apache2

We are not sure if this is a problem with php or apache itself. Need some inputs.

journalctl -u apache2

And check apache error log

My guess would be a limit (max workers) being hit, but the above will tell you

1 Like

After diving deeper, i got this log:

root@server:/etc/apache2# tail -f /var/log/apache2/error.log
[Mon Nov 25 01:50:22.444004 2024] [core:warn] [pid 32077:tid 32077] AH00045: child process 32080 still did not exit, sending a SIGTERM
[Mon Nov 25 01:50:22.444014 2024] [core:warn] [pid 32077:tid 32077] AH00045: child process 32617 still did not exit, sending a SIGTERM
[Mon Nov 25 01:50:22.444021 2024] [core:warn] [pid 32077:tid 32077] AH00045: child process 32654 still did not exit, sending a SIGTERM
[Mon Nov 25 01:50:22.444032 2024] [core:warn] [pid 32077:tid 32077] AH00045: child process 32655 still did not exit, sending a SIGTERM
[Mon Nov 25 01:50:22.444044 2024] [core:warn] [pid 32077:tid 32077] AH00045: child process 32717 still did not exit, sending a SIGTERM
[Mon Nov 25 01:50:23.582372 2024] [ssl:warn] [pid 34384:tid 34384] AH01909: :443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 25 01:50:23.583019 2024] [suexec:notice] [pid 34384:tid 34384] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Nov 25 01:50:23.682333 2024] [ssl:warn] [pid 34386:tid 34386] AH01909: :443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 25 01:50:23.683872 2024] [mpm_event:notice] [pid 34386:tid 34386] AH00489: Apache/2.4.62 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Nov 25 01:50:23.683886 2024] [core:notice] [pid 34386:tid 34386] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 25 01:51:05.728696 2024] [mpm_event:error] [pid 34386:tid 34386] AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

The issue only occurs when this line shows up:

[Mon Nov 25 01:51:05.728696 2024] [mpm_event:error] [pid 34386:tid 34386] AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

grep -ri maxrequestworkers /etc/apache2

I can’t remember where it’s set for HestiaCP but the above should show you

Then edit it and restart Apache

You may need to increase ServerLimit too

1 Like

Thank you for the reply. I was able to solve the problem by increasing the MaxRequestWorkers to 2048 in /etc/apache2/mods-enabled/mpm_event.conf

Why 2048? I followed the formula ServerLimit x ThreadsPerChild = MaxRequestWorkers from this thread: so

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.