
June 25th, 2008, 07:04 AM
|
|
Contributing User
|
|
Join Date: Aug 2002
Posts: 30
Time spent in forums: 2 h 28 m 23 sec
Reputation Power: 7
|
|
|
Directory structure optimization
I have a directory containing about 100Gb of pictures, that are frequently (some of them very frequently) fetched by Apache.
Every file has 3 versions, that is: there is an "original" file, a resized one (smaller) and a thumbnail.
We have several users, which have several albums.
Most of the time, the files are fetched by "album".
Is there any gain in having a special directory structure?
Currently, we have all of those files in directories, on a "one directory per user per type of file" basis (e.g. "pictures/<<user_id>>/thumbs/<<picture_id>>.jpg")
There are about 7000 users, and about 30000 albums.
Would it be faster to re-order the files?
e.g.
- pictures/user_id/<<gallery_id>>/thumbs/picture_id
- pictures/<<first digit of user_id>>/<<user_id>>/...
|