PHP sleep () causes all pages to be unresponsive.

Source: Internet
Author: User
"Help" PHP sleep () causes all pages to be unresponsive.
Environment is LNMP, I wrote in the code
Sleep (60);
Open that page, 60 seconds before the output, this is normal;
But in these 60 seconds the other pages in my site are also loading, until this page appears,
Other pages appear ...

Then I in the code, the empty loop 10 million times, found that if the page is not finished;
The other pages are also the loading state;

Younger brother used to do Java, just contact PHP soon, this is too strange, please you greatly pointing to the Maze php sleepx


------Solution--------------------
1. Is there a sleep () code in the program? Is there a similar session_start ()? Or you have modified the php.ini to open the session automatically.
If yes, that is the session file lock causes
2. What is the largest child process in your php-fpm? If there is only one, it will also cause congestion.
------Solution--------------------
What is the specific code situation? Is there a for, Forreach loop?
------Solution--------------------
This guessing game is not fun at all.

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.