I have an Ubuntu server with nginx and several apps running on php7.3
There is only ONE php app, Yourls https://yourls.org/ (latest version), whose http requests are getting stuck in the fpm pool for 30 seconds before returning a response.
After turning on debug-level logging, I can see that the below line repeats for 30 seconds:
[07-Apr-2020 18:37:01] DEBUG: pid 4643, fpm_pctl_perform_idle_server_maintenance(), line 378: [pool glblme] currently 1 active children, 2 spare children, 3 running children. Spawning rate 1
Before it finally returns a response:
[07-Apr-2020 18:37:32] DEBUG: pid 4643, fpm_pctl_perform_idle_server_maintenance(), line 378: [pool globalme] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
Adding some logs to Yourls php files shows that the request is indeed arriving 30 seconds after the request is made.
Why? And why only this app when other apps on the same php fpm are responding instantaneously?
I found the problem. My config.php, for some reason, had accumulated a pile of gibberish at the first line:
After removing this code, the app worked like a charm!