Differences

This shows you the differences between two versions of the page.

Link to this comparison view

computers:php_sysload_average [2015/03/24 05:42] (current)
Line 1: Line 1:
 +====== PHP sysload average ======
  
 +Find out if your webhost is overselling their service and overloading their servers. ​ This is the main reason for slow sites!
 +
 +====== Code 1 ======
 +Below code is from http://​us3.php.net/​manual/​en/​function.sys-getloadavg.php
 +
 +==== Usage Example ====
 +
 +<code php> ​
 +<​html>​
 +<​body>​
 +<pre>
 +<?php
 +if (!function_exists('​sys_getloadavg'​)) {
 +    function sys_getloadavg() {   
 + $loadavg_file = '/​proc/​loadavg';​
 + if (file_exists($loadavg_file)) {
 + return explode(chr(32),​file_get_contents($loadavg_file));​
 + }
 + return array(0,​0,​0);​
 +    }
 +}
 +
 +print_r(sys_getloadavg());​
 +
 +/***** OUTPUTS ******
 +Array
 +(
 +    [0] => 6.24
 +    [1] => 4.92
 +    [2] => 3.99
 +
 +*/
 +?>
 +</​pre>​
 +</​body>​
 +</​html>​
 +
 +</​code>​
 +
 +==== Server Side Code  ====
 +
 +<code php>
 +code goes here
 +
 +</​code>​
 +
 +==== Client Side Code ====
 +None
 +
 +
 +
 +====== Candidate Code Suggestions ======
 +Add your suggestions and links here.