Bug #48403 [Com]: shell_exec() is much slower than running from shell

From: Date: Mon, 18 Jun 2018 13:44:31 +0000
Subject: Bug #48403 [Com]: shell_exec() is much slower than running from shell
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215775@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=48403&edit=1 ID: 48403 Comment by: svarup03 at gmail dot com Reported by: gregor at hostgis dot com Summary: shell_exec() is much slower than running from shell Status: Not a bug Type: Bug Package: Performance problem Operating System: Linux PHP Version: 5.2.9 Block user comment: N Private report: N New Comment: Same problem. It's a bug. php version 7.2.5 Previous Comments: ------------------------------------------------------------------------ [2018-01-29 17:40:32] spam2 at rhsoft dot net oliver at openbrackets dot net: when it's about the shell startup-time implicitly done by exec() itself it is too late - period fortwebsolutions at gmail dot com: "to run the apache user with nice" just start httpd itself with nice in front - niceness is inherited - or on a modern system: /etc/systemd/system/httpd.service.d: [Service] Nice=-15 -20 is a bad idea anyways ------------------------------------------------------------------------ [2018-01-29 17:33:42] oliver at openbrackets dot net @ spam2 at rhsoft dot net > > https://stackoverflow.com/questions/14277910/php-exec-performance/48505455#48505455 > is nonsense > because the command on the left side is ececuted and than the output piped to "nice" > which is way too late No. Your comment is nonsense. How can someone be so arrogrant, rude and clueless at the same time? 2nd time in a fortnight. Please think before you post! ------------------------------------------------------------------------ [2018-01-29 17:31:54] fortwebsolutions at gmail dot com You are correct, i had to add the user apache was running as a sudoer, i know this is not optimal. Maybe there is a was to allow the apache user to run nice without the sudo, but that is not the point. The slowness of exec() is do to low process priority and is not actually a bug in either PHP or apache. ------------------------------------------------------------------------ [2018-01-29 16:44:10] spam2 at rhsoft dot net and no webserver setup would allow "sudo" anyways ------------------------------------------------------------------------ [2018-01-29 16:41:49] spam2 at rhsoft dot net https://stackoverflow.com/questions/14277910/php-exec-performance/48505455#48505455 is nonsense because the command on the left side is ececuted and than the output piped to "nice" which is way too late ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=48403 -- Edit this bug report at https://bugs.php.net/bug.php?id=48403&edit=1

« previous php.bugs (#215775) next »