Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
2  
I can't think of any web server that couldn't do a good job of serving mid-sized static files. Out of curiosity, what would they suggest be used instead? –  Shish Feb 7 '12 at 13:12
    
Whenever I see a question like this I can only wonder why you didn't just try it. Surely that would have been much quicker than posting the question and waiting for answers. –  John Gardeniers Feb 10 '12 at 8:05

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
2  
"Except running G-WAN with root priviledges, nothing has to be done to further optimize the performance". This - is why you don't look at benchmarks to decide what works best for you. You set up the software in your own environment, and do your own tests to see what fits the best. –  pauska Feb 10 '12 at 7:47
1  
I agree that personal benchmarks are better than trusting other sources (though I haven't done any benchmarks myself -- I use nginx to serve apps and static files and it works fine for my servers so I have no reason to switch or benchmark). But I don't see how looking at another benchmark is worse than just making a blanket assertion or assumption? –  Ben Lee Feb 10 '12 at 17:56
    
If you find the source unsatisfying, and don't have the time/inclination to do your own benchmark, you can always look for another. –  Ben Lee Feb 10 '12 at 17:58
    
There is plenty of information on this. Here's another one I just found on google: ruby-forum.com/topic/150120, and it further has links to others. My point isn't about the specific benchmark. My point is, when you don't know something about performance, use benchmarks, even if they are not your own. The one I put in my answer was just an example, but the other results I'm finding online all tend to be in line with this one that nginx is near the top for request/second and memory usage. –  Ben Lee Feb 10 '12 at 18:00
    
And @pauska, did you downvote this? I just noticed a downvote on it. The benchmark I used as an example was perfectly clear about what configuration it did for all servers, and was not sneaky about anything, so you can draw legitimate conclusions from it. The only real optimization for nginx it made was aligning the number of workers to the number of cores. I find the configuration choices the author made pretty acceptable for good comparison metrics. –  Ben Lee Feb 10 '12 at 18:04

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

You were told wrong.

share|improve this answer
10  
"You were told wrong." -- I think this is the most polite way of calling your "someone" a twit :-) –  voretaq7 Feb 6 '12 at 17:35
    
That was my guess. Just needed confirmation, he is my adminsys... –  Fabien Polley Feb 7 '12 at 9:35
    
@voretaq7: Or he meant that you should never attribute to stupidity that which can adequately be explained by malice. :-) –  Blrfl Feb 7 '12 at 14:48
    
Proof by forceful assertion? –  Ben Lee Feb 10 '12 at 4:53

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.