Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We're having some trouble with SQL Server hosted on a virtual server. We occasionally have short periods where even performing a simple select takes minutes. During this period the CPU and memory usage on the server appear normal. We've performed some basic monitoring of the server using performance monitor but this hasn't uncovered anything and we're out of ideas. What would be the next step in diagnosing the problem?

EDIT:

The only signs of the problem we are seeing on the server are Event Log messages informing us that "SQL Server has encountered x occurrence(s) of I/O requests taking longer than 15 seconds to complete"

share|improve this question

7 Answers 7

Well the slowdown must be either CPU or disk bottlenecked, or some kind of timeout like waiting on an unavailable network resource. You mention CPU is fine, have you checked the PerfMon Average Disk Queue Length and Disk Bytes/sec? Are there any related errors in the event log?

FWIW I have several SQL2005 (Standard and Workgroup) servers running on Hyper-V VMs and they work just fine, so there's no inherent problem.

JR

share|improve this answer
    
Which Performance Object group are the Average Disk Queue Length and Disk Bytes/sec in? –  Rob Bell Jun 12 '09 at 10:47
    
Oops, good point. If it's Hyper-V run perform in the VM. Because Hyper-V uses para-virtualization there is no "host" for resource use to show in. If it's VMWare Server then run Perfmon in both. If it's ESX then I guess you can only run PerfMon in the guest. –  John Rennie Jun 12 '09 at 10:53
    
I've run these two on the server - they started off quite low and then jumped up to 100 and stayed there for a bit, they've since started dropping back to original levels. Would this suggest virtualised hard disk problems? –  Rob Bell Jun 12 '09 at 11:14
    
Yes, ADQL is the number of IOPS that are waiting - you'd want that to be in single digits for any reasonable period of time. –  Richard Gadsden Jun 12 '09 at 11:30
    
If it's ESX you can log in via console and run "esxtop" and hitting "d" for disk stats. It's possible to expand with more values, but I can't remember the command right now. –  pauska Jun 12 '09 at 11:36

Most likely the issue is contention for resources between this VM and the others on the same physical host, or there is major activity on the host itself (much I/O due to backup processes running?).

Another possibility is that your virtual server is busy doing something disk I/O intensive (other, larger or more complex, SQL queries running at the same time?) and your simple select is trying to read from disk too. Processes blocking due to I/O contention will not show up as being CPU-busy. Though unless your simple select is simple-but-queries-many-rows I wouldn't expect it to take "several minutes" even under these circumstances so host resource (probably I/O bandwidth) contention is more likely.

share|improve this answer
    
+1. Eliminating the virtualised element from this problem would be a good place to start, if the physical box is otherwise heavily loaded –  tomfanning Aug 28 '09 at 9:26

Sounds to me like a typical I/O problem (uh oh, that's what you already posted) :)

I' don't do Windows normally but the basic problems are the same:

  • does it happen randomly or at certain times
    • are you running a backup in the specified time
    • are there any batch jobs
    • are there any batch jobs you do not know about (yes double check, could be some guy/girl submitting "batch jobs" from a client in some automated manner)
    • some marketing/dev Person running a nasty query that needs to go thru the whole disk
    • it takes quite some time so those people usually kill their client before the query finishes and start of another, thereby creating even more I/O
  • Are your disks healthy?
  • Are there any other I/O bound services running on the machine
  • Networking? (that should not be the problem according to the error message but Murphy never sleeps)
  • What is the historical data on server usage?
  • Is the filesystem getting full?
  • Did someone (intentionally or not) reschedule the priority?
share|improve this answer

If there is anything that slows down SQL it is slow disks, or not aligning the partitions correctly. I run a SQL 2008 instance inside a VM with an Equallogic SAN for disk and it out-performs any of our physical SQL boxes hands down.

share|improve this answer

If the virtual server doesnt indicate any problems at all it's probably the host server having problems. These problems are often seen where people put way too many virtual cpu's on each virtual server, it increases the chance of blocking the physical hosts cpu.

share|improve this answer

I would imagine that the answer is already within one of the other responses. However it's also worth running EXEC sp_Who2 and ensuring that your 'simple queries' aren't being blocked by some kind of long-running update or similar.

I've been caught out before with MS Access linked tables which have some awful locking habits.

share|improve this answer

Tell us a bit more about the storage supporting your host / sql vm (local, iscsi(hw/sw), nfs, san, sas, sata, vendor, etc)? From your most recent comment that sounds like a good path to examine more closely.

Let us know what your hypervisor (and potentially host OS is) so folks can speak more directly to your situation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.