note 110361 rejected from function.ini-get by googleguy
| From: | googleguy@php.net | Date: | Mon, 15 Oct 2012 15:04:56 +0000 |
| Subject: | note 110361 rejected from function.ini-get by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191303@lists.php.net to get a copy of this message | ||
Note Submitter: espertalhao04 at hotmail dot com
----
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...