Recent encounters with large data volumes and fast updates have resulted in a slight delay in synchronization of two servers and a higher load.
If using sleep to sleep 1 seconds every 10 seconds, would it relieve the pressure on the database? I'd
PHP sleepx
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
Will you write the log sleep in php ?. Sleep. phpignore_user_abort (); the PHP script can be executed even if the Client is disconnected (such as the browser is disabled. set_time_limit (0); the execution time is unlimited, and the default php
After writing sleep in PHP, you cannot execute this post. after editing the sleep in PHP at 2015-04-, the webpage is always loading, the result cannot be displayed. The following is the source code & lt ;? Phpignore_user_abort (true); set_time_limit
It is also a wonderful demand for customers. we need to create a scheduled task in php and execute it in N days. the method I found on the internet is to use the while loop, which uses sleep () control the task start time, but the problem is that
Disruption to common sense-code with an endless loop structure, and the opportunity to execute logic outside the loop
Class ZookeeperDemo extends Zookeeper {
Public function watcher ($ I, $ type, $ key ){
Echo "Insider Watcher \ n ";
//
"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
Sleep. php
Ignore_user_abort (); // The PHP script can be executed even if the Client is disconnected (such as the browser is disabled.Set_time_limit (0); // the execution time is unlimited. The default php Execution time is 30 seconds. You can
This article describes various ways to debug your PHP application, including opening error reports in Apache and PHP, and finding the source of more difficult bugs by placing a strategic print statement in a simple PHP script. It also introduces the
PHP Timer sleepphp
is also a customer's wonderful needs, need to do a timed task in PHP, in n days after the execution, I found on the internet is using a while loop, inside with sleep () to control the task start time, but the problem is that
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.