How can I get the CPU and Memory useage
问题 I want to know the memory and CPU usage in php, because I'm using cronejobs sometimes the CPU is overloaded so in this case I don't wan to start more process, I just want to skip this cron. 回答1: I think better way is get load avarage , because it depends not only on CPU, but on HDD speed also. Here is a doc: http://php.net/manual/en/function.sys-getloadavg.php 回答2: Take a look at this library http://phpsysinfo.sourceforge.net/ Demo: http://phpsysinfo.sourceforge.net/phpsysinfo/index.php?disp