
<?php
$ram_p=shell_exec("ps -N -ylC apache2 --sort:rss | awk '{SUM += $8} END {print SUM/1024}'");
$ram_c=shell_exec("ps -ylC apache2 --sort:rss | awk '{SUM += $8; I += 1} END {print SUM/I/1024}'");
$ram_t=shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2}'");
$ram_p=round($ram_p);
$ram_c=round($ram_c);
$ram_t=round($ram_t);
//echo $ram_c;
$resp=(($ram_t-$ram_p)/$ram_c)/1000;
//echo($ram_t."-".$ram_p."/".$ram_c);
print_r("Ram Total= ".$ram_t);
print_r("\nRam Procesos Internos= ".$ram_p);
print_r("\nRam Conexiones= ".$ram_c);
print_r("\nCantidad de hilos x segundo = ".round($resp,2)."Hxs\n");
print_r("\n\rweb gpsimple track1");
?>



