0

One of our ticketing systems uses php as the application and it is being hosted with httpd. Recently, it has been reported that the httpd service has been intermittently going up and down. From further investigation, I found out that there were no php modules installed, and the mpm used was mpm-event and not mpm-prefork. Also, many modules that were not used were not commented out from 00-base.conf file in /usr/local/httpd/conf.modules.d.

I checked the httpd logs and found that these were the errors :

AH00493: SIGUSR1 received.  Doing graceful restart

These are the full logs (from 22 - 29th) that shows the intermittent http service connectivity :

[Tue Sep 22 03:40:01.778015 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Tue Sep 22 03:40:01.978594 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Tue Sep 22 03:40:01.981317 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Tue Sep 22 03:40:01.981358 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Wed Sep 23 03:48:02.613473 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Sep 23 03:48:02.794093 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Wed Sep 23 03:48:02.797159 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Wed Sep 23 03:48:02.797230 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 24 03:48:02.313840 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Thu Sep 24 03:48:02.470234 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Thu Sep 24 03:48:02.472765 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Thu Sep 24 03:48:02.472829 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Fri Sep 25 03:44:02.157914 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Fri Sep 25 03:44:02.316100 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Fri Sep 25 03:44:02.319089 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Fri Sep 25 03:44:02.319149 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Sat Sep 26 03:37:02.703473 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Sat Sep 26 03:37:02.854782 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Sat Sep 26 03:37:02.857291 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Sat Sep 26 03:37:02.857434 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Sun Sep 27 03:07:02.134428 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Sun Sep 27 03:07:02.293453 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Sun Sep 27 03:07:02.295940 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Sun Sep 27 03:07:02.295972 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Mon Sep 28 03:40:02.502201 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Sep 28 03:40:02.655018 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Mon Sep 28 03:40:02.657714 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Mon Sep 28 03:40:02.657785 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
[Tue Sep 29 03:16:02.338908 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00493: SIGUSR1 received.  Doing graceful restart
[Tue Sep 29 03:16:02.483232 2020] [lbmethod_heartbeat:notice] [pid 15291:tid 140357203278016] AH02282: No slotmem from mod_heartmonitor
[Tue Sep 29 03:16:02.485872 2020] [mpm_event:notice] [pid 15291:tid 140357203278016] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips   configured -- resuming normal operations
[Tue Sep 29 03:16:02.485944 2020] [core:notice] [pid 15291:tid 140357203278016] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'

From googling this error, I found that the reasons given were that php was a non-thread safe software, and you don't use worker (or other threaded MPM) with non-thread-safe software.

Thinking that the current configuration was not properly done, I edited httpd.conf to add these lines :

<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

# Load php handler
AddHandler php5-script .php
AddType text/html .php

I also installed rh-php56-php and rh-php56, which were not installed previously. Only rh-php56-php-fpm was installed previously. So now I could see the php module file and conf file in their respective directories. I then enabled mpm-prefork and disabled mpm-event in httpd. I also disabled all the unneeded modules from 00-base.conf. After restarting httpd I could see that the php module was now enabled.

However, I am not sure if this is the correct solution that will resolve this problem.

I checked also, that the php installed did not have thread safety enabled :

[root@its aigini]# /opt/rh/rh-php56/root/usr/bin/php -i | grep Thread
Thread Safety => disabled
[root@its aigini]#

How do I enable thread safe, and will this indeed resolve the problem?

According to the link below,the steps that I have used is a thread-safe method, but still I am not sure:

[https://www.geeksforgeeks.org/what-is-thread-safe-or-non-thread-safe-in-php/][1]

How do I resolve the intermittent http service issue?

2
  • You use php-fpm and mod_event. mod_prefork is the original and lowest performance MPM dating back to the early 1990s. It cannot handle any significant level of traffic without consuming far more resources than strictly necessary. -- As for your SIGUSR1, reloading the configuration should not affect connectivity in any way. Why do you believe that there was a connectivity problem? Oct 1, 2020 at 2:02
  • I was alerted by NOC that the httpd service was intermittent since the day before. It kept going down several times from the wee hours of the morning till 10 am or so then it stopped. But how do I figure out the reason why the service was intermittent in the first place? There must be a reason for it. Could it be an overloading of threads than allowed in the config?
    – anaigini
    Oct 1, 2020 at 2:47

0

You must log in to answer this question.

Browse other questions tagged .