> Thanks for the tip about the watermarking class. That will DEF come in
> handy.
Feedbacks or improvement about the algorithm are appreciated.
> About my original question, I am more interested in your thoughts on
> how to
> store more then just a few thousand images. What sort of directory
> structure
> algorithm would maximize the number of images I can store on a single
> server.
The max number of images that you can store on a single server depends
on the server storage capacity. However, common filesystems decrease
performances when it increase the number of files stored in the same
directory. A simple way to solve this problem is creating a multi-
level directory structure. The number of levels depends on the number
of files that you have to store.
The basic approch:
1) You need a unique file id (for ex. the filename, if it's unique)
2) Calculate an hash of the file id
3) Use the first hash characters to create the multi-level directory
path
Example:
filename = 'demo.jpg'
MD5 hash = '58742c8b92bbb73be0789340fc0ade77'
2-levels directory = /5/8/demo.jpg
Marco Pracucci
> I am setting up a seperate cdn domain for a web project with a
> subdomain(s)
> to store uploaded images, and I expect to be storing ALOT of images.
没有评论:
发表评论