How can I get the CPU and Memory useage

前端 未结 4 1402
一整个雨季
一整个雨季 2020-12-16 05:51

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

4条回答
  •  生来不讨喜
    2020-12-16 06:40

    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

提交回复
热议问题