Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Impact of multiple user database files?


Impact of multiple user database files?

Author
Message
msmithson
msmithson
Mr or Mrs. 500
Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)

Group: General Forum Members
Points: 505 Visits: 578
My company recently migrated to new hardware. The decision was made to create a database file per core per filegroup so now the database is spread across > 80 files. All of these files reside on one RAID10 volume. I cannot find any evidence online to support this configuration for a user database (only tempDB and even then its 1/2 to 1/4 the number per core). Is this configuration ok or is there something we should look at specifically to see if it is causing performance issues?
Igor Micev
Igor Micev
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4180 Visits: 4855
What is the size of your database?
Do you have 80+ RAID10 volumes?
You're good with the tempdb files. Start with 1/4 and add up to 1/2 (the number of cores) if necessary.
This survey is pretty good - http://www.sqlskills.com/blogs/paul/files-and-filegroups-survey-results/

Regards,
Igor Micev


Igor Micev,
‌SQL Server developer at Seavus
www.seavus.com
msmithson
msmithson
Mr or Mrs. 500
Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)

Group: General Forum Members
Points: 505 Visits: 578
Database was ~250GB but then was sized up to 750GB to avoid auto-grow so there is a ton of free space in there.

All files reside on a single RAID10 volume. This setup would have made more sense to me if each file was on its own set of drives but that is not the case.
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47404 Visits: 44399
The one database file per core recommendation is an outdated one for TempDB only. It's never been a recommendation for user databases and even for TempDB now it's 1/4-1/2 the number of cores, max 8 to start.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Igor Micev
Igor Micev
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4180 Visits: 4855
80+ filegroups is too much for that size of a database.
80+ files is also a big number, but it's more normal for files.
There are benefits of having multiple filegroups. Do you have a reason for having such many filegroups?

I've worked on 100-500GB databases. They were having 15-20 filegroups and double number of files.
However you can see in the survey that there are databases like yours.


Igor Micev,
‌SQL Server developer at Seavus
www.seavus.com
msmithson
msmithson
Mr or Mrs. 500
Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)Mr or Mrs. 500 (505 reputation)

Group: General Forum Members
Points: 505 Visits: 578
Igor Micev (3/14/2014)
80+ filegroups is too much for that size of a database.
80+ files is also a big number, but it's more normal for files.
There are benefits of having multiple filegroups. Do you have a reason for having such many filegroups?

I've worked on 100-500GB databases. They were having 15-20 filegroups and double number of files.
However you can see in the survey that there are databases like yours.


Sorry I wasn't very clear. There are four file groups all residing on one RAID10 volume:

Primary: one file
Filegroup2: forty files
Filegroup3: forty files
Filegroup 4: one file

I was told that this was done to reduce read and write latency but i just can't find any evidence that this is correct.
mrdenny
mrdenny
SSC Journeyman
SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)

Group: General Forum Members
Points: 95 Visits: 222
There's no need for 80 database files for a user database. This gives you no performance benefit at all. All you are doing is making the database very hard to manage when it comes to moving the database to another drive, server, restoring the database, etc.

I would highly recommend removing the extra database files from the database. One file per LUN is all you need. I've got clients with 3TB databases and only two data files and they perform just fine.

99.9% of SQL instances need no more than 8 files for tempdb. The only reason to have more than 8 tempdb database files is because you are seeing latch waits for PFS pages (or GAM, but that's even less likely). If you are seeing PFS page waits then you should increase the number of files. If you aren't seeing PFS page waits then adding tempdb files won't do anything but slow down the SQL instance restart time. Of all the clients I work with only one that has more than 8 tempdb files on an instance, and they have 110 tempdb files.

The files per core thing is a total myth at this point. The recommendation was made back in the SQL 2000 time because we only had 1 core per CPU so the math worked out easily.
mrdenny
mrdenny
SSC Journeyman
SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)SSC Journeyman (95 reputation)

Group: General Forum Members
Points: 95 Visits: 222
Sorry I wasn't very clear. There are four file groups all residing on one RAID10 volume:

Primary: one file
Filegroup2: forty files
Filegroup3: forty files
Filegroup 4: one file

I was told that this was done to reduce read and write latency but i just can't find any evidence that this is correct.


That's because there isn't any benefit to doing this.
sqlbuddy123
sqlbuddy123
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1240 Visits: 2243
msmithson (3/14/2014)
My company recently migrated to new hardware. The decision was made to create a database file per core per filegroup so now the database is spread across > 80 files. All of these files reside on one RAID10 volume. I cannot find any evidence online to support this configuration for a user database (only tempDB and even then its 1/2 to 1/4 the number per core). Is this configuration ok or is there something we should look at specifically to see if it is causing performance issues?


Having 80 files for a DB is not a good design. It will have a negative impact on the performance and make administration complex.

--
SQLBuddy
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45390 Visits: 39941
I guess I'll be alone in this. :-D I don't believe it's necessarily a bad design at all.

First, having the 80 files won't degrade performance. It won't enhance it, but it won't degrade it.

As for maintenance and administration, it won't cause any heartache if you've automated things like backups. It fact, it could reduce backup times if your automation checks to see if there have been inserts, updates, or deletes and backing up only those files that have actually experienced a change.

It will also make dropping a customer easier in the future if the system was setup to tolerate just dropping a file.

Last but not least, if will also allow for "piecemeal" restores if that was a consideration in the grand design of things.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search