Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

PHP Timeout in nginx

I have troubles configuring website using nginx. Server is randomly timed out even in simple php script. CPU is 95%+ in idle state. Cloudlinux LVE limit also set to unlimited, I maxed the cpu & other LVE limit. Anyone experience this before?
Error log: The timeout specified has expired: AH01075: Error dispatching request to : (polling).

Comments

  • So? Just configure PHP timeout, either via php.ini or php-fpm pool.d file. Did you asked cgpt?

  • @Levi said:
    So? Just configure PHP timeout, either via php.ini or php-fpm pool.d file. Did you asked cgpt?

    Still not working. Added timeout for 300s too. Its simple crud app that run fast even in low spec laptop. Dunno why its timed out in genoa vds. :/

  • put echo on every few lines & inside for / while / other kind of loop

  • By any chance, have you checked if there's possibly a script or process running in the background consuming resources? Also, it might be good to look into Nginx configuration for any timeout settings or resource limits that might be causing this.

  • noob404noob404 Member
    edited January 2025

    Hey, I am no expert, but, I faced a similar issue only a few days ago. This is what got it fixed for me:-

    fastcgi_connect_timeout 120;
    fastcgi_read_timeout 120;
    fastcgi_send_timeout 120;
    

    I added this under the location ~ \.php$ block on my nginx configuration file, usually in /etc/nginx/sites-available

    You could also try adding this in your configuration file at the end:-

    proxy_connect_timeout 120;
    proxy_send_timeout 120;
    proxy_read_timeout 120;
    send_timeout 120;
    

    The value 120 can be changed according to your wish, but, not sure, if higher values are recommended for production.

  • Have you tried to check the PHP logs why it timeouts?

    Random guess: this app loads something external and from time to time it fails due to misconfigured IPv6. :cookie:

    Thanked by 1Falzo
  • TrKTrK Member

    CRUD app, database slow? I was having a trouble once with my DB response as the DB server was located on different server and was having some network issues.

  • davidedavide Member
    edited January 2025

    localhost might resolve to ::1 while the database listens to 127.0.0.1. If PHP pursues the database over localhost it won't be happy.

    Thanked by 3faleddo raindog308 0xC7
  • By the error code, if I am not mistaken, refes to apache error.

    Are you nginx as reverse proxy?

  • @WegotserversCom said:
    By any chance, have you checked if there's possibly a script or process running in the background consuming resources? Also, it might be good to look into Nginx configuration for any timeout settings or resource limits that might be causing this.

    no heavy background process running. cpu usage is under 10%.> @noob404 said:

    Hey, I am no expert, but, I faced a similar issue only a few days ago. This is what got it fixed for me:-

    fastcgi_connect_timeout 120;
    fastcgi_read_timeout 120;
    fastcgi_send_timeout 120;
    

    I added this under the location ~ \.php$ block on my nginx configuration file, usually in /etc/nginx/sites-available

    You could also try adding this in your configuration file at the end:-

    proxy_connect_timeout 120;
    proxy_send_timeout 120;
    proxy_read_timeout 120;
    send_timeout 120;
    

    The value 120 can be changed according to your wish, but, not sure, if higher values are recommended for production.

    tried this but still randomly timed-out.> @JabJab said:

    Have you tried to check the PHP logs why it timeouts?

    Random guess: this app loads something external and from time to time it fails due to misconfigured IPv6. :cookie:

    sadly there's no error log in php :(

    @TrK said:
    CRUD app, database slow? I was having a trouble once with my DB response as the DB server was located on different server and was having some network issues.

    DB is in localhost> @itachikonoha said:

    By the error code, if I am not mistaken, refes to apache error.

    Are you nginx as reverse proxy?

    yes, it's nginx as reverse proxy. tried nginx directly as a server too but still not working.

    I'm trying to move to other server that not using cloudlinux now.

  • @faleddo If i were you, then I would have started with all the file_get_contents() and start debug from there.

  • @faleddo said:

    @WegotserversCom said:
    By any chance, have you checked if there's possibly a script or process running in the background consuming resources? Also, it might be good to look into Nginx configuration for any timeout settings or resource limits that might be causing this.

    no heavy background process running. cpu usage is under 10%.> @noob404 said:

    Hey, I am no expert, but, I faced a similar issue only a few days ago. This is what got it fixed for me:-

    fastcgi_connect_timeout 120;
    fastcgi_read_timeout 120;
    fastcgi_send_timeout 120;
    

    I added this under the location ~ \.php$ block on my nginx configuration file, usually in /etc/nginx/sites-available

    You could also try adding this in your configuration file at the end:-

    proxy_connect_timeout 120;
    proxy_send_timeout 120;
    proxy_read_timeout 120;
    send_timeout 120;
    

    The value 120 can be changed according to your wish, but, not sure, if higher values are recommended for production.

    tried this but still randomly timed-out.> @JabJab said:

    Have you tried to check the PHP logs why it timeouts?

    Random guess: this app loads something external and from time to time it fails due to misconfigured IPv6. :cookie:

    sadly there's no error log in php :(

    @TrK said:
    CRUD app, database slow? I was having a trouble once with my DB response as the DB server was located on different server and was having some network issues.

    DB is in localhost> @itachikonoha said:

    By the error code, if I am not mistaken, refes to apache error.

    Are you nginx as reverse proxy?

    yes, it's nginx as reverse proxy. tried nginx directly as a server too but still not working.

    I'm trying to move to other server that not using cloudlinux now.

    I hope you are restarting Nginx and PHP after the edits. If you are, pardon me then

  • forghaniforghani Member
    edited February 2025

    Checkout /var/log/nginx
    It should output some misconfiguration.

Sign In or Register to comment.