note 110361 added to function.ini-get
| From: | espertalhao04 at hotmail dot com | Date: | Mon, 15 Oct 2012 14:57:09 +0000 |
| Subject: | note 110361 added to function.ini-get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191302@lists.php.net to get a copy of this message | ||
try this:
<?php
while($a[@$i++]=array(0,$a,$a)){}
?>
this INSANE code will give you sooo many informations that you really will need:
1- max memory usage
2- processing speed
3- if the "burned" memory affect your server
4- if max allowed memory is too high
5- if the timeout is too hight
6- if an infinite loop affects your server performance
if this takes more than 10 seconds, then you have a slow server or a too high timeout.
if the memory used affects your server performance, then you should lower the maximum memory usage.
if the timeout error occurs BEFORE the error of exausted memory, LOWER URGENTLY the maximum memory
usage.
(a good timeout and a max memory allowed value will help you in case you make an infinite loop by
mistake.)
use this code to know the optimal timeout time:
<?php
$initial = microtime(true);//first line of index
//do whatever you want
$total = $initial - microtime(true);
?>
use this in the slowest page you have, and use the function memory_get_peak_function() to know how
much the heaviest page "burns" of your memory...
i hope this can help someone...
----
Server IP: 69.147.83.199
Probable Submitter: 95.136.43.99
----
Manual Page -- http://www.php.net/manual/en/function.ini-get.php
Edit -- https://master.php.net/note/edit/110361
Del: integrated -- https://master.php.net/note/delete/110361/integrated
Del: useless -- https://master.php.net/note/delete/110361/useless
Del: bad code -- https://master.php.net/note/delete/110361/bad+code
Del: spam -- https://master.php.net/note/delete/110361/spam
Del: non-english -- https://master.php.net/note/delete/110361/non-english
Del: in docs -- https://master.php.net/note/delete/110361/in+docs
Del: other reasons-- https://master.php.net/note/delete/110361
Reject -- https://master.php.net/note/reject/110361
Search -- https://master.php.net/manage/user-notes.php