OpenVZ Forum


Home » General » Support » Not using all processors?
Not using all processors? [message #33103] Tue, 23 September 2008 00:09 Go to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
2.6.18-92.1.1.el5.028stab057.2
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
---
total used free shared buffers cached
Mem: 16012 15931 81 0 544 11556
-/+ buffers/cache: 3829 12183
Swap: 32383 0 32383
---
Processor x 8 (quad core) - (below info is repeated 7 more times)

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5405 @ 2.00GHz
stepping : 6
cpu MHz : 1995.004
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx tm2 cx16 xtpr lahf_lm
bogomips : 3990.02
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
---


Below is a cut/paste from top; I know you only get a static view but I'm trying to understand why more processors aren't utilized. Rarely (a few times a minute) one of the other processors will drop below 100% idle.

This was run inside the CT which runs MySQL - the MySQL instance was getting hit pretty good when I took this info and is pegged at 100.00 CPU (exactly 100).


top - 19:40:54 up 1 day, 14:52, 4 users, load average: 1.05, 0.94, 0.52
Tasks: 67 total, 1 running, 66 sleeping, 0 stopped, 0 zombie
Cpu0 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 48.8%us, 51.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8388608k total, 1060916k used, 7327692k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached


From what I understand the cpu resources are spread evenly across all CTs (CPUUNITS = 1000 in each CT). The other CTs on this server have almost no traffic and utilize almost no resources. I'm just trying to make sure I understand CPU sharing and have it setup correctly. Configuration files below.


---
]# cat 0.conf
# This is configuration file for VE0.
# Only UB parameters are processed
#
# Copyright (C) 2006-2007 by SWsoft. All rights reserved.

ONBOOT="no"

# UBC parameters (in form of barrier:limit)
OOMGUARPAGES="9223372036854775807:9223372036854775807"
---

]# cat 504.conf
# Primary parameters
NUMPROC="10248:10248"
AVNUMPROC="5124:5124"
NUMTCPSOCK="10248:10248"
NUMOTHERSOCK="10248:10248"
VMGUARPAGES="2097152:9223372036854775807"

# Secondary parameters
KMEMSIZE="419769548:461746502"
TCPSNDBUF="97947375:139923183"
TCPRCVBUF="97947375:139923183"
OTHERSOCKBUF="48973687:90949495"
DGRAMRCVBUF="48973687:48973687"
OOMGUARPAGES="1342136:9223372036854775807"
PRIVVMPAGES="2097152:2705545"

# Auxiliary parameters
LOCKEDPAGES="20496:20496"
SHMPAGES="245958:245958"
PHYSPAGES="0:9223372036854775807"
NUMFILE="163968:163968"
NUMFLOCK="1000:1100"
NUMPTY="512:512"
NUMSIGINFO="1024:1024"
DCACHESIZE="91694726:94445568"
NUMIPTENT="200:200"
DISKSPACE="52428800:52428800"
DISKINODES="13530934:13530934"
CPUUNITS="1000"
VE_ROOT="/vz/root/$VEID"
VE_PRIVATE="/vz/private/$VEID"
OSTEMPLATE="centos-5-x86_64-minimal"
ORIGIN_SAMPLE="8"
IP_ADDRESS="192.168.0.2"
HOSTNAME="my.server.com"
NAMESERVER="192.168.0.1"
CAPABILITY="SYS_TIME:on "
ONBOOT="yes"


Thanks!
Craig
Re: Not using all processors? [message #33112 is a reply to message #33103] Tue, 23 September 2008 11:47 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

is that output from top was from HN or from inside the VE?

I'm not quite understand your point. Do you want to say that other processors are not used at all? I mean if we have several processes running inside several VEs the only one processor works?
Re: Not using all processors? [message #33118 is a reply to message #33112] Tue, 23 September 2008 15:05 Go to previous messageGo to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
Yes - top is running inside the CT.

It seems rather odd to me that a process (mysqld in this case) is pegged at 1.00 utilization (exactly 1.00) and only one processor is doing anything, according to top. This is my first quad core with openvz and I want to make sure I'm not missing something in the configuration to utilize all cpu's.

Thanks!
Re: Not using all processors? [message #33119 is a reply to message #33118] Tue, 23 September 2008 15:36 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

probably I'm not understand you correctly but what do we have to expect if we have only one cpu intensive process inside VE.
Presumably it binds to cpu5.
Could you run another process inside VE for example "cat /dev/zero > /dev/null" and look at top output again. So, if we have several processes running inside that VE they should be bound to different processors.

Please, don't hesitate to correct me if I mistake, specify whatever you want etc.
Re: Not using all processors? [message #33121 is a reply to message #33119] Tue, 23 September 2008 21:00 Go to previous messageGo to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
That worked great - each instance of "cat /dev/zero > /dev/null " consumed 100% of a single cpu allowing the server to collectively go to utilization of 1, 2, 3, etc for each simultaneous instance above. This was the expected result - more CPUs processing the work.

I'm beginning to think this has something do do with mysql threads and am investigating that now.

A question, can the CT can see and utilize multiple CPUs or do they see 1 CPU (with the combined power of all Cool. I ask because Windows Virtual Server "shows" only one CPU to the VM on multi-cpu systems.

Thanks!
Re: Not using all processors? [message #33135 is a reply to message #33121] Wed, 24 September 2008 13:49 Go to previous messageGo to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
Off-peak when I grabbed this so mysql isn't doing anything... but here's an image of top showing "cat /dev/zero > /dev/null" working as expected. Cpu0, Cpu2 and Cpu3 are handling the load.




index.php?t=getfile&id=645&private=0
Re: Not using all processors? [message #33136 is a reply to message #33121] Wed, 24 September 2008 14:00 Go to previous messageGo to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
Here's an image of top with mysql under load utilizing only Cpu4; there are multiple queries running. This view shows only mysql threads and they all get used some but it seems only one runs at a time.

I came across the "thread_concurrency" parameter for mysql (v5.0.45) but it is not clear to me if this only applies to SunOS or Linux too. The information I found was not clear (some said only SunOS and others said Linux too). Still digging.

(I think Cpu1 being all zeros across is just timing when I grabbed the image, the processor is working fine.)




index.php?t=getfile&id=646&private=0
Re: Not using all processors? [message #33137 is a reply to message #33136] Wed, 24 September 2008 14:08 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

Quote:


This view shows only mysql threads and they all get used some but it seems only one runs at a time.



I agree with you. The only one process was in running state. Other was sleeping. So, the only one consumed CPU.
Re: Not using all processors? [message #33138 is a reply to message #33137] Wed, 24 September 2008 14:18 Go to previous messageGo to next message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
So is my expectation of having 2+ mysql threads running concurrently wrong? Without concurrent threads multiple CPUs are not utilized, right?
Re: Not using all processors? [message #33139 is a reply to message #33138] Wed, 24 September 2008 14:25 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

Quote:


So is my expectation of having 2+ mysql threads running concurrently wrong?


Actually, it's not OpenVZ specific question.
May be somebody could help you here but to my mind you'd better ask sql-specific questions at sql-specific forum.

Quote:


Without concurrent threads multiple CPUs are not utilized, right?



Yes, only that processes consuming CPU that have "running" (R) state.
Re: Not using all processors? [message #33141 is a reply to message #33139] Wed, 24 September 2008 15:54 Go to previous message
syncmaster4 is currently offline  syncmaster4
Messages: 14
Registered: March 2007
Junior Member
maratrus,

Thanks for all your input. The conclusion is that this issue rests with MySQL and not OpenVZ; I needed to verify that since the DB people are trying to push it onto OpenVZ...

syncmaster4
Previous Topic: ovzkernel conflicts with dev < 3.2-7
Next Topic: WARNING: Hard link count is wrong
Goto Forum:
  


Current Time: Mon Aug 05 04:20:33 GMT 2024

Total time taken to generate the page: 0.03115 seconds