Answer the question
In order to leave comments, you need to log in
How is the thread blocked?
Please explain how scripts work, for example, in PHP.
Let's say I have a script that takes a very long time to run, like this one:
$end = strtotime('+20 seconds');
while(time() < $end) {
//пустой цикл на 20 секунд
}
echo 'Loop is finished';
Answer the question
In order to leave comments, you need to log in
http - stateless protocol
The browser requested a page from nginx - received it
Nginx has a time limit, how long it will wait until it returns a response to the
nginx user, if it is specified in its config, it sends a request via various protocols to contractors
For example php-fpm
PHP fpm has settings
The settings have their own limits on the response time and the number of processes that are simultaneously ready to process a request from nginx,
In your case, with default timers, the user will have at least 20 seconds of a white page and it will be indicated that the browser is waiting for a server response
yes, for each user, a parallel stream is simply created via php-fpm as a rule. this is not Nodejs, python or Java where one process is launched to which everyone is knocking
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question