Monday, July 2, 2007
Next version of BPA forSQL Server 2005
The new version of the Best Practices Analyzer from MSDN Downloads.
Bookmark Lookup Logical Operation removed from SQL Server 2005
The Bookmark Lookup logical operation was removed in SQL Server 2005 and replaced with clustered index seek and RID lookup. Previous versions of SQL Server displayed the Bookmark Lookup icon but actually performed the clustered index seek and RID lookup.
patterns & practices Performance Testing Guidance project Community site.
Perfect resource for Performance Testing. Worth to read and implement. Atleast gothrough once ,stuffed with lot of information.
http://www.codeplex.com/PerfTesting
http://www.codeplex.com/PerfTesting
Few SQL OS DMVs Query- Courtesy to Slava
Taken from Slava Oks's Blog.
http://blogs.msdn.com/slavao/archive/2006/09/28/776437.aspx
sys.dm_os_schedulers
Q. Do I need to by more CPUs?
In order to answer this question you have to find out if your load is really CPU bounded. Your load is really CPU bounded if a number of runnable tasks per each scheduler always greater than 1 and all of your queries have correct plan. The latter statement is very important, your load can be CPU bounded due to the fact that somehow optimizer generated bad plan – it can happen if your statistics out of date or you tried to perform handcrafted optimization. In this case you don’t want to run to Circuit City to buy more CPUs right a way – you want to fix the plan. Here is the query to find out average length of a runable queue on the system:
select
AVG (runnable_tasks_count)
from
sys.dm_os_schedulers
where
status = 'VISIBLE ONLINE'
Buying more CPUs has also to do with capacity planning. You have to be very careful when performing capacity planning on hardware with HT enabled – remember you don’t have extra physical CPUs. Keep in mind that if your load runs at 60% CPU utilization - it doesn’t mean that you have 40% of extra CPU capacity. You will be very surprise how fast CPU load will jump from 60% to 80% and then even faster to 100% once you apply more and more load.
Q. What is affinity of my schedulers to CPUs?
select
scheduler_id,
CAST (cpu_id as varbinary) AS scheduler_affinity_mask
from
sys.dm_os_schedulers
Does my machine have either hard or soft NUMA configuration enabled?
select
CASE count( DISTINCT parent_node_id)
WHEN 1 THEN 'NUMA disabled'
ELSE 'NUMA enabled'
END
from
sys.dm_os_schedulers
where parent_node_id <> 32
Q. Should I configure SQL Server to use more threads – sp_configure ‘max server threads’?
You can answer this question by looking at the work queue length for each scheduler. If on average such value is above 1 then you might benefit from adding more threads to the system but only if
A. Your load currently is not CPU bounded (See info above on how to find out if your load is CPU bound)
B. Your load currently doesn’t experience any other heavy waits (If you add more threads in this case they will just end up waiting as everyone else)
select
AVG (work_queue_count)
from
sys.dm_os_schedulers
where
status = 'VISIBLE ONLINE'
Q: Is my system I/O bound?
You can answer this question by monitoring length of I/O queues.
select
pending_disk_io_count
from
sys.dm_os_schedulers
If over time they keep on growing or you are seeing periodic jumps or numbers stay relatively high most likely your system is I/O bound. In order to identify the cause you will have to dive further.
http://blogs.msdn.com/slavao/archive/2006/09/28/776437.aspx
sys.dm_os_schedulers
Q. Do I need to by more CPUs?
In order to answer this question you have to find out if your load is really CPU bounded. Your load is really CPU bounded if a number of runnable tasks per each scheduler always greater than 1 and all of your queries have correct plan. The latter statement is very important, your load can be CPU bounded due to the fact that somehow optimizer generated bad plan – it can happen if your statistics out of date or you tried to perform handcrafted optimization. In this case you don’t want to run to Circuit City to buy more CPUs right a way – you want to fix the plan. Here is the query to find out average length of a runable queue on the system:
select
AVG (runnable_tasks_count)
from
sys.dm_os_schedulers
where
status = 'VISIBLE ONLINE'
Buying more CPUs has also to do with capacity planning. You have to be very careful when performing capacity planning on hardware with HT enabled – remember you don’t have extra physical CPUs. Keep in mind that if your load runs at 60% CPU utilization - it doesn’t mean that you have 40% of extra CPU capacity. You will be very surprise how fast CPU load will jump from 60% to 80% and then even faster to 100% once you apply more and more load.
Q. What is affinity of my schedulers to CPUs?
select
scheduler_id,
CAST (cpu_id as varbinary) AS scheduler_affinity_mask
from
sys.dm_os_schedulers
Does my machine have either hard or soft NUMA configuration enabled?
select
CASE count( DISTINCT parent_node_id)
WHEN 1 THEN 'NUMA disabled'
ELSE 'NUMA enabled'
END
from
sys.dm_os_schedulers
where parent_node_id <> 32
Q. Should I configure SQL Server to use more threads – sp_configure ‘max server threads’?
You can answer this question by looking at the work queue length for each scheduler. If on average such value is above 1 then you might benefit from adding more threads to the system but only if
A. Your load currently is not CPU bounded (See info above on how to find out if your load is CPU bound)
B. Your load currently doesn’t experience any other heavy waits (If you add more threads in this case they will just end up waiting as everyone else)
select
AVG (work_queue_count)
from
sys.dm_os_schedulers
where
status = 'VISIBLE ONLINE'
Q: Is my system I/O bound?
You can answer this question by monitoring length of I/O queues.
select
pending_disk_io_count
from
sys.dm_os_schedulers
If over time they keep on growing or you are seeing periodic jumps or numbers stay relatively high most likely your system is I/O bound. In order to identify the cause you will have to dive further.
Connecting to SQL Server 2005 on Vista and Longhorn
I have seen lots of post in forums connecting to sql server 2005 on Vista. Check out this post by Protocol Team. http://blogs.msdn.com/sql_protocols/archive/2007/06/18/connecting-to-sql-server-2005-on-vista-and-longhorn.aspx#comments
Default Trace in SQL Server 2005
When i saw *SQL Trace ID 1 was started by login "sa" * in my Error Log I was little surprised. Since i have never started any trace I was wondering what is this all about. Then i came to know that this is the default trace started which is a new feature introduced in SQL Server 2005. Then i was curious about how can i see the contents. here we go...
To See All the Trace and its location :
select * from ::fn_trace_getinfo(default)
To get the File Location
select * from ::fn_trace_getinfo(default) where Property=2
And copy paste the Value column text.
To Get the Trace Data
SELECT * FROM fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc', default) where starttime>'2007-10-15'
To See All the Trace and its location :
select * from ::fn_trace_getinfo(default)
To get the File Location
select * from ::fn_trace_getinfo(default) where Property=2
And copy paste the Value column text.
To Get the Trace Data
SELECT * FROM fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc', default) where starttime>'2007-10-15'
Subscribe to:
Posts (Atom)