Help with Resolving issues in Apache Error Log

Hi Hestia Team,

I’m hoping someone can help me resolve the below two issues. I just migrated from VestaCP to HestiaCP and loving it so far! I’m doing some final checks on things and was looking through all my error logs and notice a few things that I need to resolve.

#1: MaxRequestWorkers - I was previously using VestaCP and the Apache + mpm-prefork. So I’m not familiar with the php-fmp and the way Apache is configured on HestiaCP. How can I increase MaxRequestWorkers setting? Where do I set this, I could not find the value in any of the config files. Thanks!

[Fri Apr 16 13:49:29.880429 2021] [mpm_event:error] [pid 702:tid 139779727580480] AH10159: server is within MinSpareThreads of MaxRequestWorkers, consider raising the MaxRequestWorkers setting
[Fri Apr 16 13:49:37.893606 2021] [mpm_event:error] [pid 702:tid 139779727580480] AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

#2: This is a new issue for me. Again, I’m not familiar with the proxy Fast CGI, first time using it due to HestiaCP. I’m getting several of these in the error log. Obviously anything with .ru is suspect. Is this something that can/should be ignored or a reason for this appearing?

[Thu Apr 15 15:46:45.290871 2021] [proxy_fcgi:error] [pid 54941:tid 139779656787712] [client [109.234.153.130:40201](http://109.234.153.130:40201/)] AH01071: Got error 'Primary script unknown', referer: https://best-proxies.ru/
[Thu Apr 15 15:47:24.057855 2021] [proxy_fcgi:error] [pid 54941:tid 139779665180416] [client [109.234.153.131:31789](http://109.234.153.131:31789/)] AH01071: Got error 'Primary script unknown', referer: https://best-proxies.ru/
[Thu Apr 15 18:46:52.774191 2021] [proxy_fcgi:error] [pid 54942:tid 139779450537728] [client [109.234.153.134:37423](http://109.234.153.134:37423/)] AH01071: Got error 'Primary script unknown', referer: https://best-proxies.ru/
[Thu Apr 15 18:47:54.171599 2021] [proxy_fcgi:error] [pid 54942:tid 139779665180416] [client [109.234.153.130:10707](http://109.234.153.130:10707/)] AH01071: Got error 'Primary script unknown', referer: https://best-proxies.ru/

Other than these two issues in the Apache log, everything else is looking pretty sweet. Loving the performance boost I am seeing due to the upgrade from Ubunutu 18.04 LTS + VestaCP, PHP was getting old and it seems things are much better now. Thanks for your effort!!

  1. Change the number of workers in

Thanks Eris! I always appreciate your quick responses. But sorry, I might need a bit more detail on how to resolve this. Anyone else is also welcome to jump in.

For #1:
So, should I just add a new line of MaxRequestWorkers in that statement? For example, like as follows:

<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          200
    MaxRequestWorkers 200
    MaxRequestsPerChild 4000
</IfModule>

Honestly, I’m a bit confused, because it seems Apache refers to these terms in various ways. Is MaxRequestsPerChild the same as MaxRequestWorkers? I was reading somewhere that it was, seems very damn confusing to use different terms in documentation and the config if they are the same thing. I know this is not related to HestiaCP, but I could use some help to understand.

btw, I’m using apache2buddy perl script to do provide me with some recommendation. But it seems that tool is focused on prefolk model (the one I was using with VestaCP). But it seems HestiaCP is using Event model. So I assume that’s why you mention I should update the value in the event_module settings. I do notice that prefolk model settings are in that apache config file. Is that there by default but simply ignored as it’s not being used?

Thanks!

For #2:
Thanks for the link, but the discussion on that thread is all over the place. I can’t really follow what they are actually recommending. For HestiaCP default setup case, I assume it’s running Nginx + phpFPM. So am I to place this code somewhere in a config file: fastcgi_intercept_errors on; ???

Thanks!

Just so share what I have tested. I edited /etc/apache2/apache2.conf within the HestiaCP interface. I changed mpm event module settings as below:

<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          200
    MaxRequestWorkers 200
    MaxRequestsPerChild 4000
</IfModule>

I then restart apache and reload via terminal.

However, when I run apache2buddy.pl tool after these changes, it’s still reporting MaxRequestWorkers is set to 150. So it seems to be getting this value from somewhere else, or my change is not being taken. Any ideas?

In fact, I have tested changing the values within the settings and restarted Apache and ran the apache2buddy.pl, it seems NONE of my changers are being reflected in the results from Apache2Buddy output.

Is the config being pulled from some other source/location? This is a default install, I haven’t customized anything on it.

Okay, further digging using find / -name “mpm_event”, I located this config file:

/etc/apache2/mods-enabled/mpm_event.conf

I opened it up and found the settings there, I made a change to MaxRequestWorkers and ThreadsPerChild.

I re-ran Apache2Buddy and NOW I see the updates reflected in the output.

So what’s going on here? Apache2Buddy is a fairly well known and trusted tool. It seems editing the apache config in HestiaCP does not actually change the values loaded by Apache. Why would that be?

If Apache2Buddy.pl Perl script is the one incorrectly pulling these values from the mpm_event.conf and ignoring the values in the apache.conf, which is actually what is being loaded by Apache, then I can ignore this. however, how can I verify which values are being loaded? Is there a terminal command I can issue or somewhat to check what value is actually being set. Similar to how I would verify PHP settings using phpinfo();

Can anyone help please. Thanks!

For anyone else that finds this thread in a Google search. This might help.

MaxRequestWorkers was called MaxClients before version 2.3.13. The old name is still supported. You can see this was taken from Apache. I find this quite annoying seeing that people don’t reference this in their tutorials (which I think should be done, since it’s a critical item and quite confusing since apache is created a mess which now uses both terms.)

https://httpd.apache.org/docs/2.4/mod/mpm_common.html

2 Likes

and the maxclients directive is in the file @eris quoted. however as you found out, it can well be that in the process of reading config vars after that general setting from apach2.conf it includes more files from other locations which hold the same setting again, but with different values and therefore override the first setting.

I guess this is what happened to you with settings in mpm_ebent.con overriding your changes to apache2.conf … this is actually nothing HestiaCP can do much about but a pure configuration thing of apache2 itself. sorry for the pointing at the wrong config file in that regard, however seems you found the right one then :wink:

also keep in mind that simply raising limits often is the wrong approach. limits are there for a reason. it might be better to start looking into the reason of why you need so many workers, that the default settings is even reached.

Thanks Falzo, I always appreciate your detailed and informative responses. Thank you!

And yes, the file eris quoted is correct. The issue was, I didn’t know that MaxClients is the same value as MaxRequestWorkers (very confusing for Apache to reference both and introduce a new variable). But anyway, I hope this post helps someone like me that stumbles upon it. So that’s fine.

However, I understand that it’s not HESTIACP and that it’s how apache loads the config files, but what I’m still not clear on, is what vars are actually being loaded. Is the apache2buddy script CORRECTLY telling me which values are loaded or is it just looking at the file I mentioned (/etc/apache2/mods-enabled/mpm_event.conf) and getting the values from there.

I still don’t know with any level of certainty, which vars are being loaded and active in Apache, as I don’t know if the mpm_event.conf is overriding the apache.conf that Eris mentioned or the apache.conf is overriding the values. How can I confirm this? Is there a way to check which vars are actually loaded by apache? That’s what I’m kind of looking for here. So that I can confirm with certainty which file is being loaded or overriding the other value.

Your expertise and others would be appreciated here. Is there a command I can run with apache to tell me which vars are loaded?

Thanks!

no need to run any command, just look at the apache2.conf.

directly in the header of that file it is outlined how it is split up.
this means at some point in the middle and after the initial worker settings, it includes everything from mods-enabled.
hence the mpm-event.conf gets applied after and therefore the setting in there will override the defaults in apache2.conf itself

I am pretty sure that script thing you use will be aware of how this works and get the correct info.

for checking in an alternative way you probably want to look into mod_info as additional apache module.
good read to start with: Apache Web Server Dump Current Running Configuration Settings | CodingShower

1 Like

Thanks Falzo! Very clear now. So, as shown at the top of the apache2.conf, it shows the order of which files are loaded. And lower in the list means that it will override settings higher in the list, as I understand it. So therefore, the settings in the mpm-event.conf will override what is set in apache2.conf, as you stated.

So the recommendation to edit the apache2.conf is not correct, unless you check and confirm that those settings are not also set in the mpm-event.conf file. Okay. thanks!

Thanks for the link as well, but I agree, I think the apache2buddy script is properly reporting the values, so now I know that I need to set or check what values are set in the mpm-event.conf.

This is very helpful!

1 Like

thanks for giving feedback (here and in the other thread) and for your efforts in understanding how things work. glad it helped you to clarify on your questions.

while this is rather not related to Hestia itself and we usually do not support regular system administration issues, you manage to describe the things you are looking at in a good way, so that I agree, covering something like that here might help others too :wink:

for anyone reading here: please keep in mind, that we at some times might only give quick answers to point into the right direction, therefore a not fully correct recommendation can happen.
while we try hard our answers sometimes might not be complete or fully correct, so take every answer with a pinch of salt. environments can differ or be customised, also the services used might change over time (e.g. introducing new vars, deprecating old ones) and we do not know it all.

1 Like