.. _security-nosleep: .. _avoid-sleep()-usleep(): Avoid sleep()/usleep() ++++++++++++++++++++++ `sleep() `_ and `usleep() `_ help saturate the web server. Pausing the script for a specific amount of time means that the Web server is also making all related resources sleep, such as database, sockets, session, etc. This may used to set up a DOS on the server. As much as possible, avoid delaying the end of the script. `sleep() `_ and `usleep() `_ have less impact in commandline (``CLI``). .. code-block:: php Connex PHP features ------------------- + `sleep `_ + `cli `_ Suggestions ___________ * Add a deadline of usage in the session, and wait past this deadline to start serving again. Until then, abort immediately. * Use element in the GUI to delay or slow usage. Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Security/NoSleep | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Security ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+