'PHP CGI stops responding requests (max workers)

I have a legacy API running on a PHP CGI, but I have a problem because the application is not handling the amount of requests, on Oracle Cloud, but on AWS a machine with the same shape it responds without stopping the processes, I can't understand where the problem is, because I already put a LoadBalancer, and I put it in autoscaling with 4 instances and the service simply stops responding to requests and I end up getting the timeout message.

We are using Ubuntu 20.04 on OCI, and on AWS we're using AWS Linux

I don't understand the error because a technically inferior machine on AWS is running the service without interruption, however when we put it in Oracle Cloud the system simply stops working, even copying exactly the same apache settings with a better performing machine the CGI simply stops responding to processes.

I've already tried to put a cluster, but it's still giving problem. And I don't understand how this service is running on just one machine on AWS, I don't know if there's any change in the machine's kernel, because on Oracle Cloud the same service doesn't work, we need to migrate PHP CGI from AWS to Oracle Cloud to reduce costs

Apache CGI config put on OCI (same as AWS machine)

    <IfModule mpm_prefork_module>
            ServerLimit             950
            StartServers            150
            MinSpareServers           50
            MaxSpareServers          100
            MaxClients              750
            MaxRequestWorkers         450
            MaxConnectionsPerChild   3000
    </IfModule>

Error log apache

We already changed the maximum number of workers and the problem continues, with any traffic apache just stops responding I can't understand where the problem is

[Tue Apr 12 13:18:46.503114 2022] [mpm_prefork:notice] [pid 1011] AH00169: caught SIGTERM, shutting down
[Tue Apr 12 13:18:46.661878 2022] [mpm_prefork:notice] [pid 5046] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Tue Apr 12 13:18:46.661915 2022] [core:notice] [pid 5046] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 12 13:22:02.366220 2022] [mpm_prefork:error] [pid 5046] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Tue Apr 12 13:25:30.958227 2022] [core:warn] [pid 5046] AH00045: child process 5535 still did not exit, sending a SIGTERM

Did max workers change, and the problem keep..

[Tue Apr 12 13:25:34.433995 2022] [core:error] [pid 5046] AH00046: child process 6263 still did not exit, sending a SIGKILL
[Tue Apr 12 13:25:34.435475 2022] [core:error] [pid 5046] AH00046: child process 6264 still did not exit, sending a SIGKILL
[Tue Apr 12 13:25:34.437100 2022] [core:error] [pid 5046] AH00046: child process 6266 still did not exit, sending a SIGKILL
[Tue Apr 12 13:25:34.438001 2022] [core:notice] [pid 5046] AH00051: child pid 6267 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Apr 12 13:25:35.441276 2022] [mpm_prefork:notice] [pid 5046] AH00169: caught SIGTERM, shutting down
[Tue Apr 12 13:25:35.610267 2022] [mpm_prefork:notice] [pid 7508] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Tue Apr 12 13:25:35.610306 2022] [core:notice] [pid 7508] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 12 13:32:19.386701 2022] [mpm_prefork:notice] [pid 7508] AH00169: caught SIGTERM, shutting down
[Tue Apr 12 13:32:19.550705 2022] [mpm_prefork:notice] [pid 8664] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Tue Apr 12 13:32:19.550727 2022] [core:notice] [pid 8664] AH00094: Command line: '/usr/sbin/apache2'

PROBLEM SOLVED

The problem was solved, Apache had a lot of workers, but the OCI machine has a maximum number of process allowed and this was making a bottleneck in Apache So I changed the ulimit of my linux environment, I realized that apache was not loading mpm_worker_module on the /etc/httpd/conf.modules.d/ because of tags so this was loading default settings and my apache needs to handle +600 simultaneous connections i loaded the module, and changed the maximum allowed processes for each service in centos and it worked



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source