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

Now that more websites are switching to a set-up with nginx in the front and Apache in the back (or a different webserver doing a better job at serving static media than Apache), I was wondering the following:

Would it make sense to put static media on a dedicated server (running nginx), instead of running nginx in front of Apache?

I'm not talking about budget, maintenance, etc. (I know that running 2 servers is more expensive than running 1). What I mean is:

How would you fully optimize a system dedicated to serving static files? What things can be done on the hardware and software level to optimize for static files that can't be done on a system that's also running Apache?

share|improve this question

1 Answer 1

You are right. Installing two servers instead of one should provide some advantage.

To be honest for serving static files I cannot see any advantage. For load balancing you can use either a dedicated load balancer or use DNS round robin. For fail-over you need some HA setup (see Pacemaker for more details).

So for serving static files I would take care on other elements like big bandwith of the Internet connection, fast HDD (or maybe a SDD) and more cores instead of much RAM (I wouldn't deny it). I would avoid virtualized server solutions and would take care to have sendfile installed and configured.

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.