我如何获得CPU和内存使用 [英] How can I get the CPU and Memory useage

查看:165
本文介绍了我如何获得CPU和内存使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道php中的内存和CPU使用,因为我使用cronejobs有时CPU是重载的,所以在这种情况下,我不想开始更多的进程,我只是想跳过这个cron。

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.

推荐答案

我认为更好的方法是获取加载avarage ,因为它不仅取决于CPU,速度也。

I think better way is get load avarage, because it depends not only on CPU, but on HDD speed also.

这里是一个文档: http ://php.net/manual/en/function.sys-getloadavg.php

这篇关于我如何获得CPU和内存使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆