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.

I want to set up nginx as a reverse proxy for static files (images and videos).

Can anybody share some throughput statistics he got with nginx (and other servers in general)? Do you think a high-end server can handle hundreds or even thousands Mbit/s? (I know streaming servers can, don't know about HTTP servers.)

share|improve this question

closed as not constructive by mailq, Shane Madden, Ward, Iain, MDMarra Nov 13 '11 at 17:24

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you have the bandwidth. –  mailq Oct 28 '11 at 20:38
    
The servers are planned to be connected on a 10GE connection, and most clients are at a distance of maximum 186 miles (300 kilometers). –  Ron Oct 28 '11 at 20:44

2 Answers 2

Usually the throughput is limited by the number of requests per second. This is dependent of a lot of factors.

The first bottleneck will be the storage. You can remove this bottleneck by using a lot of memory for file system cache.

The next bottleneck will be CPU load caused by interrupts. You will solve this by using NICs that allow offloading of various tasks and configuring interrupt coalescing.

Next will be the nginex CPU usage. You will solve this by scaling up (use better CPUs), then horizontally (add more CPUs and servers).

For all changes do load testing and monitor everything (CPU, I/O, switches load, etc). Make sure that you will use some good hardware as test machines, otherwise the bottleneck might become your test machine.

share|improve this answer

It depends. Median request size, number of keep-alive connections, filesystem cache hit ratio, NIC driver quality, and dirver/OS tuning parameters all matter a great deal. With the filesystem cache being the most important.

For example, it will be easy to hit 10 Gbps if your sending out copies of the same 500 Mbyte video to a few hundred clients simultaneously and the whole video file is in cache. If you are serving billions of small images or javascripts, and the cache hit ratio is low, you will be lucky to serve 100 Mbps.

As good as nginx is, how fast it can send is limited by how fast it can read data. 10 Gbps is roughly 1 GByte/sec. If the data set is all coming from RAM cache, that's do-able. Otherwise, you're going to bottleneck at the storage layer (unless you have a several fast SSDs in a RAID configuration or a whole lot of spinning rust). Also note that you will need to run several nginx worker processes per core in order to avoid blocking on disk access under Linux because asynchronous IO in Linux is basically broken by design.

share|improve this answer

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