如何在从属节点中查找C.P.U负载(C.P.U利用率的百分比) [英] How to find the C.P.U load (percentage of C.P.U utilization) in the slave node

查看:153
本文介绍了如何在从属节点中查找C.P.U负载(C.P.U利用率的百分比)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在用Java开发负载平衡算法.在我的系统中,将有一个主节点和一个从属节点列表,其中主节点将传入的请求分发到其从属节点之一.我想在每个从属节点中找到C.P.U负载(使用的C.P.U的百分比).这样,主节点可以将请求有效地分发到其负载最小的从节点之一. 任何人都可以建议我如何找到它.

Hi am developing a load balancing algorithm in java. In my system there will be one mater node and list of slave nodes, Where the master node will distribute the incoming request to one of its slave node. I want to find the C.P.U load (percentage of C.P.U utilized) in each of the slave nodes. So that the master node can effectively distribute the request to one of its least loaded slave node. Can any one please suggest me how can we find it.

The getSystemLoadAverage() method in JMX 

可用于查找当前系统的cpu负载.是否可以使用相同的方法在从站中查找负载.如果可能,请建议我如何找到它.如果不可能的话,请建议我采取其他方法来做同样的事情.如果有人对此提供正确的答案,我将更加感激.

can be used to find the cpu load of the current system. Is it possible to use the same method to find the load in slave too.. If possible please suggest me how can we find it. If not possible please suggest me some other way to do the same. I will be more thankful if some one provide right answer for this.

推荐答案

签出Sigar: http://www.hyperic.com/products/sigar

它具有几乎所有内容的语言和平台绑定.我已经使用Sigar了很多次.它简单,可靠并且可以正常工作.而且您获得的平台统计信息不仅仅是CPU负载,根据您可能需要更多的信息,这可能很方便.

It has language and platform bindings for virtually everything. I've used Sigar many times. It's simple, reliable and just works. And you get a lot more platform stats than just CPU load, which can be handy depending on what more info you might need.

这篇关于如何在从属节点中查找C.P.U负载(C.P.U利用率的百分比)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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