8

This is a dummy question. I have to give public access to PDFs, let's say 8 MB / file. It seems to me that nginx will serve any kind of files, as long as they are static. But someone tells me nginx isn't suited for this.

Can you provide me some documentation to prove me/him wrong ?

voretaq7
  • 80,749
Elvex
  • 237

3 Answers3

23

There is nothing to prove, nginx is specifically optimized for serving static content.

You were told wrong.

pauska
  • 19,766
14

The typical use for nginx is to serve the static files for a web site, while something else (which nginx proxies to) serves the dynamic content. Unless you're generating the PDFs on the fly, nginx should be perfectly fine.

cjc
  • 25,492
2

When in doubt, benchmark! Fortunately someone else has already done this:

http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/

Conclusion? Allow me to quote:

G-WAN seems again to perform a lot better than the other servers. Nginx always performs slightly better than Lighttpd, while Apache Traffic server is very similar to Lighttpd in term of performance.

And:

Regarding the resources used by each server, Nginx is the winner in term of memory usage, as the amount of memory does not increases with the number of concurrent clients. G-WAN requires 2 times less CPU than the other servers.

The proof is in the numbers. Nginx is second best at requests/second, average for cpu usage, and best for memory usage. So yes, nginx is definitely a good server for statically serving standard size PDFS.

Ben Lee
  • 676