Apache HTTP now officially supports HTTP/2. After HTTP/2 came, Nginx Community Web Server is Going Towards Scrap. Because Nginx community edition lacks HTTP Server Push and other features. Nginx now supports dynamic modules. That is not exactly good news for the community developers because Nginx Plus makes money from the free modules. Here is an Informal Comparison of Apache Traffic Server vs Varnish vs Nginx For Proxy. You should know about the developer of Nginx before thinking to develop Nginx stuffs or write guides. You can use Nginx community edition as it is free.
Background of Comparison of Apache Traffic Server vs Varnish vs Nginx
Apache HTTPD Server is just a web server (which is fully free software without any question) but Nginx is not only web server. Human commonly can not understand the difference between Apache HTTPD Server and Apache Traffic Director. Varnish is not in game unless they natively support newer protocols. We probably should talk about Apache Traffic Server vs Nginx.
- In First In First Out (FIFO) algorithm the cache evicts the first block accessed first without any regard to how often or how many times it was accessed before. Think of FIFO as cars going through a tunnel. The first car to go in the tunnel will be the first one to go out the other side.
- In Last In First Out (LIFO) algorithm the cache evicts the block accessed most recently first without any regard to how often or how many times it was accessed before.
- In Least Recently Used (LRU), algorithm requires keeping track of what was used when, which is expensive if one wants to make sure the algorithm always discards the least recently used item. Think of the LRU cache as cleaning out the garage. You will throw away items that you have not used for a long time, and keep the ones that you use frequently.
Most of our caches are sized to hold over a weeks worth of objects in cache. Most objects/traffic is temporal in nature. The popular images and videos are normally only popular for a certain time period. We have looked at not evicting objects on disk if they are in the RAM cache and that has a LRU like eviction algorithm. Doing this would help in not evicting really popular objects. FIFO has advantages over LRU for disks. It is very efficient with writes since they are all sequential. We use rotational disks when building out very large second tier caches. There are other things to consider when looking at cache in a proxy server. How many bytes does the in memory index take per object in cache. For Apache Traffic Server 10 bytes is extremely efficient) Also, does the cache use the filesystem and/or use sendfile for HTTP (like Nginx), but can not use sendfile when using HTTPS or HTTP/2. Every proxy server some advantage, easy of use, well supported APIs, flexible configuration, dynamic loadable modules, HTTP specification compliance, HTTP/2 support, TLS support, performance, etc. It really depends on what you are looking for when choosing a proxy server.
Apache Traffic Server vs Varnish vs Nginx : Any Conclusion?
ATS have extensive documentations and some important historical blog posts :
Apache Traffic Server is not for feeble hearted server with weak (read virtual) processor :
Nginx has a very fast learning curve, and it is also a native Web Server. Varnish and Nginx wants that their software is used all over the place and they want to make a living at it. That kind of business model not suitable in long run. It is not like Percona or even original MySQL – charge for support and custom engineering. We need to talk about H2O than Nginx :