Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

369
Views
Understanding NGINX's fastcgi_read_timeout

I'm "fine-tuning" a PHP web application served via NGINX with php-fpm as FastCGI sever.

From the documentation:

fastcgi_read_timeout

Defines a timeout for reading a response from the FastCGI server.

so far so good. But then...

The timeout is set only between two successive read operations, not for the transmission of the whole response.

The PHP script start sending data (nginx reads) then pauses (computing time) then send more data (nginx reads). If the pause lasts longer than the specified time the connection is dropped.

Is it the correct interpretation or am I missing something?

What does exaclty means "between two read operations" ?

Isn't the "whole response" duration that matters? And what parameter sets a limit for that?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The PHP script start sending data (nginx reads) then pauses (computing time) then send more data (nginx reads). If the pause lasts longer than the specified time the connection is dropped.

I think it's a correct interpretation.
And it's easy to test: write a simple php-script with some sleeps between echos and flushes. (Can't do it myself at the moment).

Isn't the "whole response" duration that matters?

To me personally, the fastcgi_read_timeout approach is more appealing:

  • If you server is under a high load with fixed timeout it will definitely fail from time to time. Users will be irritated, they'll refresh... send another request... And you server chokes even more, never fulfilling any of user's requests.
  • But if, no matter the load, you server shows it is still alive and trying hard to fulfill client's requests then it's up to them to decide to wait or to abort. Much better!

And what parameter sets a limit for that?

max_execution_time in php.ini or

fastcgi_param PHP_VALUE "max_execution_time=1000";

in your NGINX config

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!