I'm stuck with a problem with an async shell call (from PHP), that simply isn't async, even though it should be.
exec("nohup sudo -H -u ubuntu /usr/local/bin/purge.sh $purgeString &> /dev/null &");
The script above is hit about 17 times in this one request type, so parallel operations is a must here!
WITHOUT the above operation (commented out) the request takes about 4 seconds. WITH the above operation, it takes 15+ seconds, which definitely means that the async part isn't working.
purge.sh writes its progress to a log file, and I can tail the log and see the entries come slowly and sequentially from each of the 17 operations.
I've tried all the solutions in Asynchronous shell exec in PHP and have had zero success.
[MORE INFO] - I can run the command manually in the shell, as another user, and it works as expected. The file and folder permissions also seem to check out.
Anyone have any insights in what could be wrong?
OS: Ubuntu 14.04, PHP: 7.08, Webserver: NGINX 1.11.2.
EDIT We scrapped this approach. But if anyone answers, I'll still mark the correct answer.