I’ve requested this query earlier than on Stackoverflow, however this appears to be a greater place to ask it.
httpd course of operating (simply
apache2), with PHP. In
index.php I’ve the next code within the file:
echo shell_exec("sudo -u apache python3 /root/folder/script.py 2>&1");
Which ought to execute a a program (which its doing properly). This system takes ~40 seconds to return one thing, so it takes a bit. Ive created one other python program which is multithreaded. Which makes a request 400 occasions on the identical time to the url, which ought to begin 400 processes.
Once I run the command
prime -c, I see that the CPU is barely at 9% whereas that ought to be increased. I attempted the following command,
ps xa | grep apache | wc -l. That returns 101 processes, I’ve completed the command a number of occasions and its at all times at 101.
Earlier than I did the command
ps xa | grep apache | wc -l, I first made a mistake and tried
ps xa | grep apache2 | wc -l, I do not run apache2, however that also gave me the numer 1. So my principle is that 101 – 1 = 100. Which is a too lovely quantity.
So this ought to be some kind of most / restrict / cap. The place can I configure this?
Thanks on your time
===== EDIT =====
I believe its queue’ing the requests, whereas once I login into the server and run the python script manually, the script simply usually works with none sluggish downs and so on.