1

I am currently running a webserver with php-fpm 7.4.27 and Apache.

I am trying to run python backend program launched from php like this :

$exechar3 = sprintf('bash -c "exec nohup setsid ./program.py %s %s > /dev/null 2>&1 &"',$var0, $var1);
exec($exechar3);

This program run and end perfectly when he's running alone like :

ps aux|grep program
www-data 1404374  145  2.6 270989696 854732 ?    Ssl  12:29   0:02 python3 ./program.py var0 var1

But if I launch the same backend program from an other client session like this at the same time :

ps aux|grep program
www-data 1404374  145  2.6 270989696 854732 ?    Ssl  12:29   0:02 python3 ./program.py var0 var1
www-data 2064374  145  2.6 270989696 854732 ?    Ssl  12:29   0:02 python3 ./program.py var0 var1

The first program don't end, and the second start but is not running...

My program are multithreaded Python script that fire thousand of request at same time. The problem is that threads on the second program are never starting while the first line of the Python program are executed. If I run it at the same time with a root shell, then programs will concurrently run.

I think the problem comes from Apache or php-fpm but I didn't managed to resolve the problem.

I looked on php-fpm threads & max childrens, Apache threads & workers, stdout|in|err redirection, shell management, privileges, but I didn't solved the problem.

I hope community will help me solve this.

I am very active and I will reply fast.

Thanks for your research.

HSMKU
  • 81
  • 10
  • The problem seems to come from the number of thread of my Python program. If I reduce the number of thread (32000 to 15000) then it would work concurrently. – HSMKU Mar 10 '22 at 17:04

1 Answers1

0

Finally it was a question of POSIX threads !!!

Increasing my threads limits makes my python program able to run 900000 threads and that's enough !

How to increase maximum number of JVM threads (Linux 64bit)

HSMKU
  • 81
  • 10