OpenVZ Forum


Home » General » Support » How to discover which user causing high load? (OpenVZ node)
How to discover which user causing high load? [message #50591] Wed, 18 September 2013 18:13 Go to next message
postcd is currently offline  postcd
Messages: 73
Registered: April 2013
Member
Hello, please how to discover in linux RHEL, OpenVZ node command line which user causing high mysql (for example) load?
I have virtual machines on this OpenVZ node.
Re: How to discover which user causing high load? [message #50599 is a reply to message #50591] Fri, 20 September 2013 09:38 Go to previous messageGo to next message
votsalo is currently offline  votsalo
Messages: 26
Registered: December 2011
Location: Greece
Junior Member
perhaps you can use a script like this:

for ctid in `vzlist -1`
do
echo $ctid` vzctl exec $ctid uptime`
done
Re: How to discover which user causing high load? [message #50619 is a reply to message #50599] Sun, 22 September 2013 11:13 Go to previous messageGo to next message
postcd is currently offline  postcd
Messages: 73
Registered: April 2013
Member
votsalo wrote on Fri, 20 September 2013 11:38
perhaps you can use a script like this:

for ctid in `vzlist -1`
do
echo $ctid` vzctl exec $ctid uptime`
done

Thx, this script returns list of VMs and their load, uptime like:
320 07:08:34 up 1 day, 45 min, 0 users, load average: 0.12, 0.04, 0.01
330 07:08:34 up 27 days, 50 min, 0 users, load average: 0.21, 0.08, 0.04

The load average is for the VM assigned cpu or for entire node server? But there i dont see the mysql process usage for VMs
Re: How to discover which user causing high load? [message #50620 is a reply to message #50591] Sun, 22 September 2013 12:24 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Once you've established wich VM is the culprit for the high load, you can use one of the standard approaches to find out what's causing the load within the VM.

This isn't anything openvz specific, just investigate like you would on a real HW server.
Re: How to discover which user causing high load? [message #50621 is a reply to message #50619] Sun, 22 September 2013 12:33 Go to previous messageGo to next message
votsalo is currently offline  votsalo
Messages: 26
Registered: December 2011
Location: Greece
Junior Member
postcd wrote on Sun, 22 September 2013 14:13
But there i dont see the mysql process usage for VMs
Then, this is no longer an openvz question. Using the script I gave you, you can tell which CT has high load. Once you know that, you can run a linux command in that CT to find out which process consumes the CPU. For example:
vzctl exec 320 top -b -n 1 | head -20

Or: vzctl exec 320 top -b -n 1 | grep mysql

Also note that all container processes are also HN processes.
So this command on the HN will tell you something about all the mysql processes:

ps -ef | grep mysql

Re: How to discover which user causing high load? [message #50624 is a reply to message #50591] Mon, 23 September 2013 16:46 Go to previous messageGo to next message
TOCICI is currently offline  TOCICI
Messages: 5
Registered: February 2010
Location: Portland, OR
Junior Member
postcd wrote on Wed, 18 September 2013 11:13
Hello, please how to discover in linux RHEL, OpenVZ node command line which user causing high mysql (for example) load?
I have virtual machines on this OpenVZ node.


The following command will list load average details for all containers on a host:
vzlist -o ctid,laverage


Fast, cost effective & secure OpenVZ based hosting solutions: www.buildyourvps.com

Payment options: Dwolla, PayPal, Bitcoin
Re: How to discover which user causing high load? [message #50774 is a reply to message #50624] Tue, 29 October 2013 22:40 Go to previous message
jakob is currently offline  jakob
Messages: 19
Registered: June 2008
Junior Member
Wow, that command rocks, thanks TOCICI! vzlist is extremely powerful, look at vzlist -L.
Previous Topic: CentOS 6 public static IP routing
Next Topic: 1,2Ghz VPS have load of 4
Goto Forum:
  


Current Time: Sat May 25 04:56:51 GMT 2024

Total time taken to generate the page: 0.01738 seconds