[Help] phpsleep () causes all webpages to fail to respond. The environment is & nbsp; lnmp. I wrote sleep (60) in the code. open the page, the output is only available 60 seconds later. this is normal. However, in the past 60 seconds, other webpages on my website are also in the loading status until this page appears, other pages appear... then, in the code, I had a blank loop for 10 million times. [help] php sleep () caused no response from all webpages.
The environment is lnmp. I wrote it in the code.
Sleep (60 );
The page is opened and output is available 60 seconds later. this is normal;
However, in the past 60 seconds, all other webpages on our website are in the loading status until this page appears,
Other pages appear...
Then, in the code, I made a null loop for 10 million times and found that if the page was not executed completely;
Other pages are also in the loading status; this is so strange...
The younger brother was a java Engineer. it was just a while before he got in touch with php. this is so strange. please give me some advice on the "sleep *" function of php.
------ Solution --------------------
1. is there only one sleep () code in the program? Is there session_start ()? Or you have modified php. ini to enable auto-enable session.
If yes, it is caused by the session file lock.
2. what are the largest sub-processes in your php-fpm? If there is only one, it will also cause congestion.
------ Solution --------------------
What is the specific code? Is there a for or forreach loop?
------ Solution --------------------
This guessing game is not fun at all.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service