SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Slow Server
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dboiler
Starting Member

5 Posts

Posted - 02/21/2012 :  11:46:38  Show Profile  Visit dboiler's Homepage  Send dboiler an AOL message  Reply with Quote
One of two databases on this Windows Server 2008 machine with SQL Server 2008 is hogging the disk access. When I open Resource Monitor, it shows this database hitting the disk at over 5GB/min. The entire database itself is less than 3GB ins size. So I don't know why its hitting the disk so heavily. I have autoshrink turned off and the Data File is set to autogrow by 350MB, unrestricted and the Log File is set to autogrow by 10 percent, unrestricted.

Any help would be appreciated.

Dave

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 02/21/2012 :  12:13:07  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
My guess, badly written queries (or inadequate indexing) resulting in queries doing much more data access than necessary and churning the buffer pool as a result.

http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-1/
http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-2/
and look for queries doing huge amounts of reads.

p.s. 10% is not a recommended growth increment for log files. Set it to a fixed MB value, that way all growth operations grow the same amount and take more-or-less the same amount of time.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

dboiler
Starting Member

5 Posts

Posted - 02/21/2012 :  12:49:01  Show Profile  Visit dboiler's Homepage  Send dboiler an AOL message  Reply with Quote
Thanks Gail. I should also mention that this database was working just fine on another server. It was on a legacy machine running Windows Server 2003 and SQL 2005. I then moved it to the current machine, which also is a virtual machine, running the Windows 2008 and SQL 2008. That's when the problems started.
Go to Top of Page

Peter99
Constraint Violating Yak Guru

471 Posts

Posted - 02/21/2012 :  14:58:27  Show Profile  Reply with Quote
Update statistics and rebuild indexes.
Go to Top of Page

dboiler
Starting Member

5 Posts

Posted - 02/24/2012 :  14:14:21  Show Profile  Visit dboiler's Homepage  Send dboiler an AOL message  Reply with Quote
Thanks Gail and Peter99 for your input. However, I'm still having the same issues. I did some searching on the Internet and found this routine to run to determine Index Fragmentation but it always errors with Incorrect syntax near 'my_database_name' in the sys.dm_db_index_physical_stats function. I cannot see what is wrong with the query.

USE my_database_name
GO
SELECT object_name(IPS.object_id) AS [TableName],
SI.name AS [IndexName],
IPS.Index_type_desc,
IPS.avg_fragmentation_in_percent,
IPS.avg_fragment_size_in_pages,
IPS.avg_page_space_used_in_percent,
IPS.record_count,
IPS.ghost_record_count,
IPS.fragment_count,
IPS.avg_fragment_size_in_pages
FROM sys.dm_db_index_physical_stats(db_id(N'my_database_name'), NULL, NULL, NULL , 'DETAILED') IPS
JOIN sys.tables ST WITH (nolock) ON IPS.object_id = ST.object_id
JOIN sys.indexes SI WITH (nolock) ON IPS.object_id = SI.object_id AND IPS.index_id = SI.index_id
WHERE ST.is_ms_shipped = 0
ORDER BY 1,5
GO

Any Ideas?

Dave
Go to Top of Page

Peter99
Constraint Violating Yak Guru

471 Posts

Posted - 02/24/2012 :  16:00:55  Show Profile  Reply with Quote
change my_database_name to your database name. That may help.
Go to Top of Page

jeffw8713
Aged Yak Warrior

USA
693 Posts

Posted - 02/25/2012 :  08:53:36  Show Profile  Reply with Quote
Verify the compatibility level is set to 100 on the database in question. If you are not running Enterprise Edition - then the format of the command you are using will not work. You will need to change it to:

Declare @databaseID int;
Set @databaseID = db_id(N'my_database_name');

Select ...
From sys.dm_db_index_physical_stats(@databaseID, Null, Null, Null, 'Detailed') ips

I would recommend switching from 'Detailed' to 'Limited' - as you really don't need to go to the detailed level to identify fragmentation.

Jeff
Go to Top of Page

stepson
Yak Posting Veteran

Romania
85 Posts

Posted - 02/27/2012 :  02:53:36  Show Profile  Reply with Quote
dump question : You do a log backup ?
Go to Top of Page

Jayam.cnu
Starting Member

India
40 Posts

Posted - 02/27/2012 :  02:58:55  Show Profile  Reply with Quote
yup... the Query level it is perfect ... change the database name into your user-defined database name ...
Go to Top of Page

dboiler
Starting Member

5 Posts

Posted - 02/27/2012 :  08:55:15  Show Profile  Visit dboiler's Homepage  Send dboiler an AOL message  Reply with Quote
Jeff,

Thanks for the reply - worked perfectly. The database (not named my_database_name but just used that name in this post) is VERY fragmented. some tables are 99% fragmented. I've tried various re-indexing queries I've found from browsing but nothing seems to help with the performance. Any thoughts?

Dave
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 02/27/2012 :  09:26:41  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Honestly, if I was in your position I'd be working through slow queries (as per the articles I specified) It is possible for query performance to change across versions of SQL (though regressions are rare) and this wouldn't be the first time I encountered a hardware upgrade resulting in slower performance (usually due to increased blocking or the like)

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 02/29/2012 :  19:48:04  Show Profile  Visit tkizer's Homepage  Reply with Quote
Dave, I am responding due to your email to me. You can't defragment small indexes. How many pages are in the indexes that you say are very fragmented? It matters.

I haven't read through the entire thread here, but Gail has you on the right track. I wouldn't waste any more time on defragmenting the indexes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 03/01/2012 :  20:01:54  Show Profile  Reply with Quote
Dave, I'd be interested to know if you're getting very different execution plans from your longest-running queries on the new server compared to the old server.
Go to Top of Page

dboiler
Starting Member

5 Posts

Posted - 03/02/2012 :  09:56:19  Show Profile  Visit dboiler's Homepage  Send dboiler an AOL message  Reply with Quote
Tara/Gail,

I did run part one of Gails articles and got these results:

ProcedureName TimeImpact IOImpact CPUImpact ExecutionCount

NULL 902603 46497528 290831 33138
sp_prepexec 40295 521153 3500 47
sp_execute 13532 462415 1720 12

I'm trying to work through part 2 now but am wondering about the NULL Procedure.

Dave
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 03/02/2012 :  10:07:00  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Probably ad-hoc SQL. For that you'll have to check the individual (unaggregated) rows. The function that calcs the ProcedureName is far from perfect.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000