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
Take a look at this library http://phpsysinfo.sourceforge.net/
Demo: http://phpsysinfo.sourceforge.net/phpsysinfo/index.php?disp=dynamic
Edit: This was taken from Stephen's comment. I put it here just so that it gets enough exposure for people to read.
Just a note: this library isn't too snappy. I couldn't find a way to just return CPU or just ram, it returns EVERYTHING, hardware list, network stats, hd usage, os info, pretty much everything you can think of. This takes it about 4 seconds to complete so it may not be the best option if you want a constantly updating value using ajax or something of the sort.