PK
CPU resources were limited for your site'; } if ( $memf_total > 0 ) { print '
Memory resources were limited for your site'; } if ( $mepf_total > 0 ) { print '
You have reached entry processes (number of simultaneously running php and cgi scripts, ', 'as well as cron jobs and shell sessions) limit ', $mepf_total, ' times'; } } else { print '
Your CPU usage was at ', $cpu_max, '% out of 100%'; } if ( ( $memf_total == 0 ) && ( $lmem_max > 0 ) && ( $mem_max > $lmem_max * 0.9 ) ) { print '
Your Memory usage was at ', RoundMemB($mem_max), ' out of ', RoundMemB($lmem_max); } if ( ( $mepf_total == 0 ) && ( $lep_max > 0 ) && ( $ep_max > $lep_max * 0.9 ) ) { print '
You had ', $ep_max, ' entry processes (number of simultaneously running php and cgi scripts, ', 'as well as cron jobs and shell sessions) out of ', $lep_max, ' max entry processes allowed'; } } } # Function converts bytes to kilobytes, megabytes or gigabytes (if needed) # and appends appropriate suffix (K, M, G) # Parameter $_[1] = memory in bytes sub RoundMemB { my $mem = shift; if ( $mem >= ( 1024 * 1024 * 1024 ) ) { return sprintf( "%.1fG", $mem / ( 1024 * 1024 * 1024 ) ); } if ( $mem >= 1024 * 1024 ) { return sprintf( "%.1fM", $mem / ( 1024 * 1024 ) ); } if ( $mem >= 1024 ) { return sprintf( "%.0fK", $mem / 1024 ); } return "$mem"; } # Function converts kilobytes to megabytes or gigabytes (if needed) # and appends appropriate suffix (K, M, G) # Parameter $_[1] = memory in kilobytes sub RoundMemK { my $mem = shift; if ( $mem >= ( 1024 * 1024 ) ) { return sprintf( "%.1fG", $mem / ( 1024 * 1024 ) ); } if ( $mem >= 1024 ) { return sprintf( "%.1fM", $mem / 1024 ); } return "$mem" . 'K'; } 1;