Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 File Fragmentation and Disk Read Queue

Author  Topic 

SQLexcitesMe
Starting Member

3 Posts

Posted - 2008-05-16 : 04:27:08
I have a poorly performing SQL box.

I have run perfmon and the avg read queue length is pretty much permanently maxed out at 100%.

I have run a database index defrag.

On further inspection the file system is highly fragmented. There is a file fragmentation of 98% with the mdf file fragmented in 25,000 pieces. Running a standard windows defrag does not resolve this.

Two questions?

1- Is heavy file fragmentation of the MDF file a likely cause of the read queue length bottlneck?

2 - Why is the MDF file not defragmenting? Does the SQL server have to be taken offline? Is it possible to defrag a MDF file?

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-05-16 : 11:17:34
1) It can
2) Most likely because the file is open. try shutting down SQL Server, then defragmenting the filesystem.
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-05-16 : 14:32:11
I've done this before and it should help, simply defrag the disk(s) that the mdf (and ldf??) is on, after shutting down the SQL services, as stated. I'd take a full database backup before attempting. Even though I never had any issues doing this, it's better safe than sorry.

Terry
Go to Top of Page
   

- Advertisement -