News for hackers. Stuff that matters.

Ask HN: The best way store thousands of Images on a server

Hello. I've got a server of my own handling the multimedia files for a website. It has around 200Gb of images (all JPG's) stored in nested folders.

I have Apache 2 on Linux and nothing else. I don't know if it is the best solution, but I think is not.

What system (http server, cache, or anything) would you recommend me?

( 12 comments | 2 points | on HN )
Re:Ask HN: The best way store thousands of Images on a server by soult on Monday April 06, 2009 @12:24PM (#549090)
I recommend gatling: http://www.fefe.de/gatling/ It's the fastest httpd I know of.

You might also want to try thttpd: http://www.acme.com/software/thttpd/ I heard all the porn sites use it to host their images.

With only the http server for the images running it should work quite well to rely on the filesystem cache.

Re:Ask HN: The best way store thousands of Images on a server by kierank on Monday April 06, 2009 @11:22AM (#548987)
MogileFS might be what you're looking for:

http://www.danga.com/mogilefs/

with an nginx or lighttpd frontend.

The documentation is a little sparse though the mailing list and irc are useful for help.

Also it would somewhat depend on your traffic profile. If you've got thousands of random reads (e.g. thumbnails with dozens per page, ssds might be better; specifically the Intel X-25).

Otherwise MogileFS with an array of fast drives would probably do the job. Mogile can also do load balancing based on drive I/O because each image is replicated across different files/machines.

EDIT: Make sure you've got browser caching set up correctly (though admittedly that's a tiny bit harder with Mogile)

If you can use a expiry time that's far in the future. Also don't send a Last-Modified nor an ETag Header. Only send Expires.

Re:Ask HN: The best way store thousands of Images on a server by blurry on Monday April 06, 2009 @11:59AM (#549056)
Check out this Stanford presentation

Facebook - Needle in a Haystack: Efficient Storage of Billions of Photos

http://www.flowgram.com/p/2qi3k8eicrfgkv/

Re:Ask HN: The best way store thousands of Images on a server by _b8r0 on Monday April 06, 2009 @01:01PM (#549164)
How about Publicfile? - http://cr.yp.to/publicfile.html

Super duper secure and very, very quick, especially for smaller files.

I'd try and run some tests against it, thttpd and your existing apache setup.

Re:Ask HN: The best way store thousands of Images on a server by mqatrombone on Monday April 06, 2009 @11:16AM (#548980)
A smaller web server like lighttpd or cherokee may be a better choice if all you are serving is images.
Re:Ask HN: The best way store thousands of Images on a server by pclark on Monday April 06, 2009 @11:03AM (#548948)
Re:Ask HN: The best way store thousands of Images on a server by barredo on Monday April 06, 2009 @11:08AM (#548960)
30 days a month * 1024 Gb of transfer a day * 0,17$/Gb = more than 5,000$ a month. Am I right?

My own 200mbps connection costs me the equivalent of 300$ a month.

Re:Ask HN: The best way store thousands of Images on a server by frisco on Monday April 06, 2009 @11:25AM (#548994)
A /terabyte/ of transfer a day?!?
Re:Ask HN: The best way store thousands of Images on a server by barredo on Monday April 06, 2009 @11:44AM (#549030)
Yes. It has a lot of traffic. Btw, it's not porn! :-)
Re:Ask HN: The best way store thousands of Images on a server by leej on Monday April 06, 2009 @04:57PM (#549611)
dont forget nginx
Re:Ask HN: The best way store thousands of Images on a server by catch23 on Monday April 06, 2009 @11:00AM (#548942)
Amazon S3
Re:Ask HN: The best way store thousands of Images on a server by barredo on Monday April 06, 2009 @11:05AM (#548952)
I have my own server to do that. With 1TB of transfer a day, I cannot afford Amazon S3 (I have my own 200mbps low latency connection)

Thanks, but I was looking for technology to install on my own server. Not moving to Amazon S3