shagul
shagul

Reputation: 151

How to find the CPU load of the remote system

Hi am developing an load balancing algorithm in java. In my system there will be one master node and n number of slave nodes. The mater node will distribute the receiving query to ones of its slave node. But before distributing the query to one of its slave node, I want to measure the current load in the slave node in order to check whether the particular slave node is capable of processing the request. And also i can keep track of which node is overloaded and which one is least loaded.

Can any one please tell me, Is there any built in functions in java (by including some .jar file) to find the load of the slave nodes..? Whether i can use JMX to do it..?

Upvotes: 2

Views: 1557

Answers (1)

Oleg Mikheev
Oleg Mikheev

Reputation: 17444

I think that OperatingSystemMXBean's getSystemLoadAverage() is what you need.

For info on remote accessing this JMX bean please read Remote Monitoring and Management documentation.

Upvotes: 1

Related Questions