30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7: OS and Hardware Interaction<br />

On the Vista Pro laptop that I am using to write this book, this query returned the<br />

following:<br />

SocketCount physical_memory_mb sql_max_virtual_memory_mb<br />

-------------- --------------------- -------------------------<br />

1 3571 2047<br />

buffer_pool_committed_mb /3GB switch<br />

--------------------------- -----------<br />

228 off<br />

I have a single dual-core processor, hence one socket; the physical memory matched<br />

the memory shown in task manager on the performance tab, and I do not have the<br />

IncreaseUserVa turned on, so my virtual memory is limited to less than 2 GB.<br />

Thankfully, 32-bit processors are on the way out these days, and we can stop worrying<br />

about the limitations of 32-bit addressing.<br />

Investigating CPU Usage<br />

In terms of complexity, <strong>SQL</strong> <strong>Server</strong> is almost an operating system in its own right and its<br />

resource utilization patterns are, likewise, pretty complex. When a request is submitted to<br />

<strong>SQL</strong> <strong>Server</strong>, it is assigned to a worker thread. Each of these threads is assigned to a CPU<br />

by what is known as the <strong>SQL</strong> <strong>Server</strong> OS scheduler. For each CPU, there is only one<br />

scheduler available for use by <strong>SQL</strong> <strong>Server</strong>, to execute user code, and only one request<br />

(SPID or session_id) per scheduler can be running at any time.<br />

Threads waiting for CPU time will be placed in the runnable queue; the longer the queue,<br />

the higher the CPU pressure (see Listing 7.5). Threads whose associated request is waiting<br />

for a resource to become free, or that have to perform I/O, will be moved to the waiter<br />

list. If there are simply no available worker threads, a process will be blocked until one<br />

becomes available, and moved to the work queue.<br />

292

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!