Page 1 of 2
Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 21. Mar 2009, 10:36
by x-Na
I've noticed that w2k3/w2k8 server with enterprise version of SQL Server 2008 seems to push VirtualBox CPU usage to 30-40% when idle. After removing / stopping MS SQL related services, CPU usage drops to around 10% when idling.
This is shown only on host, when examining guest cpu usage, it's below 5%, so for some reason this combination makes VBox to use more CPU than normally. Any idea what could cause it? Should I even make a bug report?
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 21. Mar 2009, 13:56
by vbox4me2
Use processexplorer to have a good look in the Guest what exactly is using VM cpu, after that investigate what that process is doing via eventlogs and such.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 21. Mar 2009, 15:18
by x-Na
vbox4me2 wrote:Use processexplorer to have a good look in the Guest what exactly is using VM cpu, after that investigate what that process is doing via eventlogs and such.
As I wrote earlier, the CPU usage isn't seen on the guest, only on host. So there isn't anything to examine on the guest side. It's Vbox itself that's using CPU. Same exact behaviour was seen with my earlier comp, AMD Sempron 2400+, 1g ram with ~512 allocated to guest.
Host is Ubuntu 8.10 amd64, Sun VirtualBox 2.1.4. Machine itself is a AMD 64 x2 5600+, 4g ram, 1g allocated to the guest.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 21. Mar 2009, 15:27
by vbox4me2
x-Na wrote:I've noticed that w2k3/w2k8 server with enterprise version of SQL Server 2008 seems to push VirtualBox CPU usage to 30-40% when idle. After removing / stopping MS SQL related services, CPU usage drops to around 10% when idling.
You say it doesn't notice on the Guest but after stopping MSSQL the cpu drops, if you don't see this reflecting in the Guest cpu it must be LAN traffic of some sort.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 23. Mar 2009, 09:22
by x-Na
vbox4me2 wrote:x-Na wrote:I've noticed that w2k3/w2k8 server with enterprise version of SQL Server 2008 seems to push VirtualBox CPU usage to 30-40% when idle. After removing / stopping MS SQL related services, CPU usage drops to around 10% when idling.
You say it doesn't notice on the Guest but after stopping MSSQL the cpu drops, if you don't see this reflecting in the Guest cpu it must be LAN traffic of some sort.
There isn't any noticeable network traffic either, at least my sniffer isn't picking up anything.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 23. Mar 2009, 12:48
by vbox4me2
Make the VM immutable or back it up and play around with the VM settings.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 23. Mar 2009, 16:19
by dodgyrabbit
I'm having the exact same issue. I've tried the new VirtualBox beta (2.2) and still the same issue. My host (Ubuntu 8.10) CPU usage goes to about 25% to 30% all the time but the guest (Windows XP or Windows7) is pretty much idle. Stopping SQL Server makes the host CPU drop immediately to expected levels.
x-Na, I'm curious, are you only seeing this in the Enterprise version of SQL server? I'm running the developer edition, which obviously has all the entreprise features. Can you confirm that SQL Standard edition doesn't have this problem?
I'm happy to assist getting this problem resolved if anyone has ideas on how to identify the root cause.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 23. Mar 2009, 17:14
by vbox4me2
Regarding sql server 2008 can anyone go into the management console and have a look if the engine is seeing 1 cpu or more? or dump the config here how the engine(s) see the VM environment.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 24. Mar 2009, 04:19
by dodgyrabbit
This is from the SQL Server Log:
03/23/2009 22:13:32,Server,Unknown,Node configuration: node 0: CPU mask: 0x00000001 Active CPU mask: 0x00000001. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
03/23/2009 22:13:32,Server,Unknown,Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
03/23/2009 22:13:32,Server,Unknown,Detected 1 CPUs. This is an informational message; no user action is required.
03/23/2009 22:13:32,Server,Unknown,SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
On the Server Properties screen it also shows 1 CPU. Processor and I/O affinity cannot be modified.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 24. Mar 2009, 05:00
by dodgyrabbit
Something else I noticed: if you add the Interrupt/Sec Processor Performance counter, you'll notice that without SQL Server running - my system averages at 100 per second. When SQL Server is started, it goes up to 1100 per second. Could it be that these interrupts are handled in a CPU intensive manner in the host?
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 24. Mar 2009, 13:17
by vbox4me2
Hmmm it could be a locking issue of some sort, constant IO polling(APIC?) without any HD activity, this has to be emulated to a degree by the VM engine. Could also be a sata issue, what are the exact VM settings?
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 24. Mar 2009, 14:56
by dodgyrabbit
Yes, it's a SATA drive. FYI - I installed the latest beta (2.2) as well as prior builds (2.1.x) and they all have this problem.
Perhaps I should try create a VM that doesn't use SATA?
Code: Select all
<VirtualBox version="1.7-linux">
?
<Machine uuid="{b36239a4-f026-4bc4-bc8b-43d053489139}" name="Windows XP" OSType="WindowsXP" lastStateChange="2009-03-23T23:59:57Z" currentSnapshot="{a5c2b2ec-ac65-4a7f-be28-14d95ded3cfe}">
?
<ExtraData>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/LastCloseAction" value="shutdown"/>
<ExtraDataItem name="GUI/LastWindowPostion" value="89,74,1346,1097,max"/>
<ExtraDataItem name="GUI/Fullscreen" value="off"/>
<ExtraDataItem name="GUI/Seamless" value="off"/>
<ExtraDataItem name="GUI/AutoresizeGuest" value="off"/>
<ExtraDataItem name="GUI/InfoDlgState" value="400,450,normal"/>
</ExtraData>
?
<Snapshot uuid="{a5c2b2ec-ac65-4a7f-be28-14d95ded3cfe}" name="Before CPU setting change" timeStamp="2009-03-22T03:40:36Z">
<Description/>
?
<Hardware>
?
<CPU count="1">
<HardwareVirtEx enabled="false"/>
</CPU>
<Memory RAMSize="1024"/>
?
<Boot>
<Order position="1" device="DVD"/>
<Order position="2" device="HardDisk"/>
</Boot>
<Display VRAMSize="12" monitorCount="1" accelerate3D="true"/>
<RemoteDisplay enabled="false" port="3389" authType="Null" authTimeout="5000"/>
?
<BIOS>
<ACPI enabled="true"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
<DVDDrive passthrough="false"/>
<FloppyDrive enabled="true"/>
<USBController enabled="false" enabledEhci="false"/>
?
<Network>
?
<Adapter slot="0" enabled="true" MACAddress="0800277CCB1A" cable="true" speed="0" type="Am79C973">
<NAT/>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="0800271391E2" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="2" enabled="false" MACAddress="080027A82B7F" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="3" enabled="false" MACAddress="080027888944" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="4" enabled="false" MACAddress="080027628054" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="5" enabled="false" MACAddress="08002721CDDD" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="6" enabled="false" MACAddress="0800270983EB" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="7" enabled="false" MACAddress="080027745B6D" cable="true" speed="0" type="Am79C973"/>
</Network>
?
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="1" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
</UART>
?
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/>
</LPT>
<AudioAdapter controller="AC97" driver="ALSA" enabled="false"/>
?
<SharedFolders>
<SharedFolder name="Desktop" hostPath="/home/pieterventer/Desktop" writable="true"/>
</SharedFolders>
<Clipboard mode="Bidirectional"/>
<Guest memoryBalloonSize="0" statisticsUpdateInterval="0"/>
?
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows XP Professional" timestamp="1237666225076378000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="5.1.2600" timestamp="1237666225077645000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="3" timestamp="1237666225079458000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/InstallDir" value="C:/Program Files/Sun/xVM VirtualBox Guest Additions" timestamp="1237666225080265000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Revision" value="42893" timestamp="1237666225081014000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Version" value="2.1.4" timestamp="1237666225081579000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="2.1.4r42893" timestamp="1237666225086231000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="2.1.4r42893" timestamp="1237666225107307000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="2.1.4r42893" timestamp="1237666225109297000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="2.1.4r42893" timestamp="1237666225148604000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="2.1.4r42893" timestamp="1237666225149076000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="2.1.4r42893" timestamp="1237666225155092000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="2.1.4r42893" timestamp="1237666225156428000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="2.1.4r42893" timestamp="1237666225157391000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="2.1.4r42893" timestamp="1237666225158314000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="2.1.4r42893" timestamp="1237666225159149000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsers" value="0" timestamp="1237692654047755000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/NoLoggedInUsers" value="true" timestamp="1237692649822637000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="0" timestamp="1237692654063843000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="C" timestamp="1237693236917738000" flags=""/>
</GuestProperties>
</Hardware>
?
<StorageControllers>
?
<StorageController name="IDE" type="PIIX4" PortCount="2">
?
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{f6376224-cc1b-43dd-9ba1-56fe9e91cb1e}"/>
</AttachedDevice>
?
<AttachedDevice type="HardDisk" port="0" device="1">
<Image uuid="{31d26df7-aa7c-4322-bc2f-17791fbc0c92}"/>
</AttachedDevice>
</StorageController>
<StorageController name="SATA" type="AHCI" PortCount="1" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3"/>
</StorageControllers>
</Snapshot>
?
<Hardware>
?
<CPU count="1">
<HardwareVirtEx enabled="false"/>
</CPU>
<Memory RAMSize="1024"/>
?
<Boot>
<Order position="1" device="DVD"/>
<Order position="2" device="HardDisk"/>
</Boot>
<Display VRAMSize="12" monitorCount="1" accelerate3D="true"/>
<RemoteDisplay enabled="false" port="3389" authType="Null" authTimeout="5000"/>
?
<BIOS>
<ACPI enabled="true"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
<DVDDrive passthrough="false"/>
<FloppyDrive enabled="true"/>
?
<USBController enabled="true" enabledEhci="false">
<DeviceFilter name="DM GEOPORT USB RF Downloader [0400]" active="true" vendorId="0403" productId="F6F1" revision="0400" manufacturer="DM" product="GEOPORT USB RF Downloader" serialNumber="DM2ASHH1" remote="no"/>
</USBController>
?
<Network>
?
<Adapter slot="0" enabled="true" MACAddress="0800277CCB1A" cable="true" speed="0" type="Am79C973">
<NAT/>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="0800271391E2" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="2" enabled="false" MACAddress="080027A82B7F" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="3" enabled="false" MACAddress="080027888944" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="4" enabled="false" MACAddress="080027628054" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="5" enabled="false" MACAddress="08002721CDDD" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="6" enabled="false" MACAddress="0800270983EB" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="7" enabled="false" MACAddress="080027745B6D" cable="true" speed="0" type="Am79C973"/>
</Network>
?
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="1" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
</UART>
?
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/>
</LPT>
<AudioAdapter controller="AC97" driver="ALSA" enabled="false"/>
?
<SharedFolders>
<SharedFolder name="Desktop" hostPath="/home/pieterventer/Desktop" writable="true"/>
</SharedFolders>
<Clipboard mode="Bidirectional"/>
<Guest memoryBalloonSize="0" statisticsUpdateInterval="0"/>
?
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows XP Professional" timestamp="1237852185671646000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="5.1.2600" timestamp="1237852185674689000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="3" timestamp="1237852185675884000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/InstallDir" value="C:/Program Files/Sun/xVM VirtualBox Guest Additions" timestamp="1237852185677308000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Revision" value="42893" timestamp="1237852185679656000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Version" value="2.1.4" timestamp="1237852185681384000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="2.1.4r42893" timestamp="1237852185728102000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="2.1.4r42893" timestamp="1237852185734672000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="2.1.4r42893" timestamp="1237852185736569000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="2.1.4r42893" timestamp="1237852185739942000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="2.1.4r42893" timestamp="1237852185740424000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="2.1.4r42893" timestamp="1237852185743820000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="2.1.4r42893" timestamp="1237852185745731000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="2.1.4r42893" timestamp="1237852185746815000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="2.1.4r42893" timestamp="1237852185747866000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="2.1.4r42893" timestamp="1237852185748918000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsers" value="0" timestamp="1237852793998778000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/NoLoggedInUsers" value="true" timestamp="1237852793999605000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="C" timestamp="1237834877246826000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="0" timestamp="1237852794005847000" flags=""/>
</GuestProperties>
</Hardware>
?
<StorageControllers>
?
<StorageController name="IDE" type="PIIX4" PortCount="2">
?
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{b3a65223-b49d-407e-9fb7-97fc041336bc}"/>
</AttachedDevice>
?
<AttachedDevice type="HardDisk" port="0" device="1">
<Image uuid="{7ee56058-271d-4efc-a42d-b47102fb95d6}"/>
</AttachedDevice>
</StorageController>
<StorageController name="SATA" type="AHCI" PortCount="1" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3"/>
</StorageControllers>
</Machine>
</VirtualBox>
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 24. Mar 2009, 15:07
by vbox4me2
You can use SATA(tickbox enabled) but leave VDI slot to first IDE setting.
Try disabling USB and Shared folders as well.
Another thing you can try but you have to download the drivers is the intel server nic.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 29. Mar 2009, 13:45
by Nercury
vbox4me2 wrote:You can use SATA(tickbox enabled) but leave VDI slot to first IDE setting.
Try disabling USB and Shared folders as well.
Another thing you can try but you have to download the drivers is the intel server nic.
None of this help.
I am also experiencing same problem on Ubuntu 9.04 host, yet with Windows 7 beta guest. As soon as I start SQL server express 2008 instance, virtual box starts using around 70% of single CPU. That is, with my Core Duo system, one cpu is always using 70% of it's power. Yet in guest, no additional CPU consumption is visible.
What I expect: host cpu usage should be near 1%. And it drops to that when SQL server is stopped.
Also, half of CPU usage is "nice".
Tell me anything else I could do to help with this bug.
Re: Windows Server 2003/2008 with SQL Server 2008 using CPU
Posted: 29. Mar 2009, 13:58
by Nercury
Ok, one more thing: it seems that when SQL server is running, interrupt count per second jumps to ~1000, compared to ~70 when it is stopped. That is the most significant change i could find inside guest.
EDIT:
I traced it to the way SQL server now tracks time, by using new Real-time clock interrupt:
http://blogs.msdn.com/psssql/archive/20 ... 3-sp3.aspx
17.4.7 The Real-Time Clock Interrupt (INT 70h)
PC/AT and later machines included a CMOS real-time clock. This device is capable of generating timer interrupts in multiples of .976 msec (let's call it 1 msec).
It seems to fit with increased interrupt count per second, and I wonder, can this actually be related to the way virtualbox implements (or handles) interrupts?