BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 18th, 2003, 09:01 PM
ace2600 ace2600 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Austin, Texas
Posts: 126 ace2600 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 50 m 34 sec
Reputation Power: 5
Too many files hurts performance?

Note: This was originally posted in the MySQL forum http://forums.devshed.com/t106677/s.html

For every record in my database I am storing two files named after the records primary key. When a user submits a query, the files are called for each record that matches his query. I will be having several million records and the files will range from 5kb to 2mg.

This is working fine on a small scale (5,000 records), but I read this from http://lists.mysql.com/java/900
Quote:
One of the things to watch for is that you can't put too many files, more than a few hundreds, in the same directory on Unix or performance will suffer.

So I am trying a directory structure using the first four digits of the primary key. Ex: 1234 would go into /1/2/3/4/ and 12345 would go into /2/3/4/5/. I am currently using Windows XP but plan to use FreeBSD 4.X or 5.X.

How does FreeBSD handle several files in a directory (like 10,000-100,000)? Am I better off breaking the files up by digits, or is this directory structure inefficient?

Thank you,
Brandon

Reply With Quote
  #2  
Old December 18th, 2003, 09:21 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It's not about directory alone but partition, if you run out of inode, creating more subdirs and relocate files under it doesn't change your inode capacity.

Reply With Quote
  #3  
Old January 5th, 2004, 05:33 PM
ace2600 ace2600 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Austin, Texas
Posts: 126 ace2600 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 50 m 34 sec
Reputation Power: 5
I'm relatively new to Unix and have researched Inode since FreeBSD's post, but I still am a little unsure of the inodes default setting and how to set it larger.

I’m using FreeBSD’s default partition. I have a pretty minimal install, only using the command line interface and just a couple programs (MySQL, Java SDK). I plan to add anywhere from 500 million to 1 billion files. Will the default partition for a 100gig hard drive have a large enough inode capacity?

Also, does it matter how many files are in a given directory (assuming it’s under the inode limit) when locating a given file? I am splitting them up as mentioned earlier so there won’t be too many files in one directory, but if it doesn’t matter then I will put all the files in one.

Thanks again,
Brandon

Last edited by ace2600 : January 5th, 2004 at 07:36 PM.

Reply With Quote
  #4  
Old January 6th, 2004, 12:29 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,478 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 12 h 33 m 8 sec
Reputation Power: 852
>> but I still am a little unsure of the inodes default setting and how to set it larger.
See the -i option for newfs. Online man page at: http://www.freebsd.org/cgi/man.cgi?...ASE&format=html
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #5  
Old January 11th, 2004, 02:12 PM
ace2600 ace2600 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Austin, Texas
Posts: 126 ace2600 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 50 m 34 sec
Reputation Power: 5
Thank you Scorpions4Ever, I had no idea what command to search for. As for my second question:

"does it matter how many files are in a given directory (assuming it’s under the inode limit) when locating a given file? I am splitting them up as mentioned earlier so there won’t be too many files in one directory, but if it doesn’t matter then I will put all the files in one."

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Too many files hurts performance?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway