9 ms·
Apache Traffic Server
- exelius 11y agoCan someone explain how this is different than how most people use Apache HTTPD these days? I'm not trying to be snarky -- I'm genuinely curious.
- gruez 11y ago> Can someone explain how this is different than how most people use Apache HTTPD these days You mean as a reverse proxy / cache server?. I don't have statistics but I would think that most people use apache as a regular http server (serving files or as part of a *AMP stack)
- exelius 11y agoPeople still use *AMP stacks? Edit: I was serious about that; I was under the impression that most stacks use much lighter weight http daemons than Apache these days. I understand that legacy apps are still out there and not everyone is going to refactor, but anyone developing web applications under Apache in 2016 is just a glutton for punishment...
- mrweasel 11y agoI know a hosting company that exclusively deploy Apache, because that's what they know how to configure. Everything that works under nginx, will still work under Apache. If they need more performance, they put Apache behind a Riverbed Stringray/SteelApp/Brocade Trafic Manager (or whatever it's call these days). I think people are being to hard on Apache, it's still a great webserver for a ton of applications. That being said I prefer to configure Nginx over Apache.
- tempestn 11y agoAlso, if Apache is configured well, using the Event MPM (or even the older Worker) and sane thread counts for the server it's running on, it's a lot faster than it used to be. I can't say how fast compared to Nginx because literally every comparison between the two I've seen has hamstrung Apache by using the ancient Prefork MPM (and I haven't done a rigorous comparison myself), but I expect it's at least on the same order of magnitude.
- rhizome 11y agoThey're both plenty fast for most sites.
- mindcrime 11y agoPeople still use _AMP stacks? Change this to "People still use X?" where the value of X is pretty much any technology you've ever heard of, dating back to the 1970's (if not before). And the answer will, to a first approximation, always be "yes". Now the number of people using X might be small, but you can all but bet your life that somebody, somewhere is, indeed, still using it. And depending on what it is, you might be surprised as how large the number actually is. Keep in mind, HN and Reddit, etc., comprise something of an echo chamber, where people of a certain mindset and orientation flock. The world is MUCH larger. No, RPG on iSeries /AS400 machines isn't "cool" and you won't see it mentioned on HN much (if at all) but this stuff is still used all over the place. LAMP stacks? Yeah, still widely used. OS/2? Not exactly "widely" used, but still used. COBOL? Yep. Fortran? Yep. MVS? Yep. And so on. Now, granted, this stuff isn't used by "hip startups" or "unicorns", but the world is a lot bigger than the SV startup scene. Technologies die VERY slowly for whatever reason, at least in regards to the "long tail" (so to speak) of the usage curve.
- NeutronBoy 11y ago> Now, granted, this stuff isn't used by "hip startups" or "unicorns", but the world is a lot bigger than the SV startup scene. Most of it is used by business that literally manage your life. Banks, electrical and water, manufacturing plants, telephone exchanges, everything.
- jamespo 11y agoIt seems you're another person who hasn't used Apache since 1.3
- pram 11y agothis is closer to varnish or squid
- therein 11y agoApache Traffic Server has support for native C++ plugins which allow you to make transformations to the headers and the body as the request and response passes through it. ATS's power comes mainly from these plugins, I would say, rather than just a reverse caching proxy. https://github.com/apache/trafficserver/tree/master/lib/atscppapi https://github.com/apache/trafficserver/tree/master/lib/atsc...
- skuhn 11y agoAs others have indicated, it's a proxy server rather than a general purpose webserver. There's no code relation between the two servers; it's simply that the team at Yahoo chose to pursue it as an Apache Foundation project when they open sourced it. ATS scales orders of magnitude better than Apache, due to its process model. Whereas at Yahoo we would budget between 30-200 simultaneous connections per Apache server (prefork), the proxy service which I ran using ATS was budgeted for over 100,000 concurrent connections per machine. It's significantly less featureful than Apache, but it does caching substantially better than any other cache server commonly available (nginx, apache, squid, varnish).
- exelius 11y agoYeah; I find many people in the modern web services world end up using Apache HTTPD as a caching proxy for availability reasons. It's probably just because it's old as hell so everyone knows the config file format by heart, but I know I went with Apache HTTPD on a recent project because the features we needed were only in the paid version of Nginx and we just didn't want to deal with licensing (the dollar amount was trivial in corporate dollars, but it would have taken us months to get the purchase through procurement and the entire rest of the project used open source software). So it's good to have another open source option to keep in mind.
- therein 11y agoWhat were these features?
- exelius 11y agoApplication health checks mostly; though we were using it in a caching server context (static files and non-whitelisted endpoints served directly from Apache vs. hitting the app servers). They're available in Nginx Plus, just not the free version. Again, the pricing wasn't the issue; it was the fact we would have had to go through procurement - which involves a few weeks/months of process at any decently large company. So we ended up using Apache because the team was familiar with it and knew it could support our use case. While Nginx probably would have performed better, in the end it was just easier to use Apache because it was a mature Open Source project and throw a few extra VMs at the caching tier to make up for the performance gap.
- aayala 11y agonginx ?
- xinuc 11y agoApache TS is a caching proxy server. It's more similar to varnish than nginx (you can use nginx as a caching proxy if you want, of course). I never use it, but from what I heard, it performs & scale really well too.
- skuhn 11y agoSome people do use nginx as a caching server. CloudFlare, for example, is built on top of it. The reason to do so is because you want the rest of what nginx provides, not to get its caching module. It is an extremely barebones solution that only solves the most basic requirements. I can only presume that CloudFlare and others have written their own caching modules for nginx. A short list of annoyances: 1. No support for multiple disk devices. Files are written to a fixed temp path and then renamed to their real destination. So you need to use RAID to present the disks as one logical device, which is a wholly unnecessary expense in a caching environment. 2. No support for purging in open source. This is an nginx plus feature, which starts at $1900/server/year. 3. Because of the temp file / rename thing, support for streaming subsequent requests off of the first request that is filling cache is janky. Subsequent requests have to acquire a lock. 4. No support for any fancier cache setups, utilizing ICP / HTCP.
- nikolay 11y agoI was considering Varnish + Nginx at some point, but this gets much more complicated than just using ATS.
- skuhn 11y agoIt makes sense, considering that nginx is typically ahead of the pack on support for things like SPDY and H2. Plus if you use OpenResty with its Lua functionality, you can do a lot of fancy things in nginx and reduce your dependency on Varnish's VCL. And you have to have something in front of Varnish to do SSL anyway. VCL in particular is kind of a trap. Early on it can do what you need -- remove a header, set a header, basic branching. Then you want to do basic arithmetic, or validity checking, or anything that isn't suitable for string assignment or regex and you straight up can't do it. VCL makes me long for the power of bash scripts. Ultimately though, it's really not a great solution to separate these concerns between multiple applications. You're going to get bitten somewhere, even if it's just the old ephemeral port exhaustion problem.
- frik 11y agoBetter overview: https://en.wikipedia.org/wiki/Traffic_Server https://en.wikipedia.org/wiki/Traffic_Server Initially created by Inktomi, bought by Yahoo! and got open sourced and brought to Apache Foundation in 2009 because of the good experience of Yahoo! with Hadoop in 2008/09.
- blantonl 11y agoAny advantages to using this over a blended haproxy / varnish setup?
- therein 11y agoApache Traffic Server has support for native C++ plugins which allow you to make transformations to the headers and the body as the request and response passes through it. ATS's power comes mainly from these plugins, I would say, rather than just a reverse caching proxy. https://github.com/apache/trafficserver/tree/master/lib/atscppapi https://github.com/apache/trafficserver/tree/master/lib/atsc... You can do stuff like: > registerHook(HOOK_READ_REQUEST_HEADERS_PRE_REMAP); > registerHook(HOOK_READ_REQUEST_HEADERS_POST_REMAP); > registerHook(HOOK_SEND_REQUEST_HEADERS); > if (transaction.getClientRequest().getUrl().getQuery().find("redirect=1") != string::npos) { > cout << "Sending this guy to google." << endl; > transaction.getClientResponse().getHeaders().append("Location", "http://www.google.com"); > transaction.getClientResponse().setStatusCode(HTTP_STATUS_MOVED_TEMPORARILY); > transaction.getClientResponse().setReasonPhrase("Come Back Later"); > } > transaction.resume();
- voltagex_ 11y agoHuh. You could conceivably replace ISA/TMG (Microsoft Forefront) with ATS. There are still places using those products as load balancers / reverse proxies even though support is almost completely gone.
- skuhn 11y agoNot really at small scale, but if you're building a large service there are several advantages. For one thing, not having to copy response data between processes improves throughput. Since Varnish is so resistant to supporting SSL natively, you'll always have to place something in front of it to use it with the modern web. Whether it's haproxy, Apache or nginx, that's just one more thing to deal with. I have some other beefs with Varnish, but the most annoying one is the absence of a persistent disk cache. If the Varnish process dies, there goes your disk cache. Even though cache data is written out to disk, Varnish punted on saving an index and re-using an old process's cache, so it writes the cache to an unlinked file. Imagine a bad code push or new traffic pattern that causes core dumps across your entire service footprint -- and now it isn't just a problem of getting the process back up and stable, you have also lost hundreds of terabytes of cache data. Or something as simple as rolling out a new version. You can architect around the problem, but why should you even have to? ATS also (recently) supports Lua for plugins, which is way more powerful than VCL. It is a finicky piece of software though, and there are a lot more sharp edges that you're likely to cut yourself on during the initial honeymoon period versus Varnish.
- zerd 11y agoComparison with Varnish from "Performance Evaluation of the Apache Traffic Server and Varnish Reverse Proxies" (2012) [1] ... the results indicated that Apache Traffic Server reached better cache hit rates and slightly better bandwidth throughput with the cost of higher system and network resource usage. Varnish on the other hand managed to response higher request rates with better response time, especially for the cache hits. The findings in this thesis indicates that Varnish seems to be more promising reverse proxy. [1] https://www.duo.uio.no/handle/10852/34903 https://www.duo.uio.no/handle/10852/34903
- X-Istence 11y agoApache Traffic Server is what is used in Comcast's CDN.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- lumanaughty 11y agoI work at a large company that uses ATS heavily (top 5 site). There have been huge improvements in performance and functionality after this paper has been written. In his benchmarks he was running with a single volume configured for cache, which would have a global lock on cache. If he partitioned the cache into multiple volumes (something we do by default now) he would have had much lower cache hit response times. The majority of our cache hit response times in production are less than 1 ms. In the benchmarks I have run ATS has always been faster then Varnish and NGiNX. If they weren't I would have made changes to ATS to make it faster.
- nikolay 11y agoThanks for sharing this great insight!
- eggnet 11y agoIt's obviously working well for you but I'm curious how you deal with the circular buffer cache with ATS. For a large library that would seem to be an immediate disqualifier. Or maybe I'm not understanding how that works. I'm assuming as a top 5 site you probably deal with a large library, and appear to be ok with ATS despite that. Comments?
- cbsmith 11y agoCaches generally need to be bounded to be effective. What am I not getting here?
- skuhn 11y agoATS uses a tornado cache, where the write pointer just moves to the next object no matter what. So the disk cache doesn't work as a LRU in the same way as other cache servers. The benefit is that writing is fast and it's constant time since you don't have to do an LRU lookup to pick a place to store the object. The downside is that you are creating cache misses unnecessarily. It's never really been a problem for me in practice. If you have a lot of heartache over it, I would suggest putting a second cache tier in place. Very unlikely to strike out on both tiers.
- nikolay 11y agoBy the way, Google's PageSpeed module, which is available for Apache [0] and Nginx [1], is also available on ATS [2]! [0]: http://modpagespeed.com/ http://modpagespeed.com/ [1]: http://ngxpagespeed.com/ http://ngxpagespeed.com/ [2]: https://www.iispeed.com/pagespeed/products/ats-pagespeed https://www.iispeed.com/pagespeed/products/ats-pagespeed
- adrianpike 11y agoAt a company I was at a while ago we used/abused ATS _very_ heavily - apart from the pain of a comparatively obscure tool, it was great. It took us some digging and work to get configured exactly right, especially since we were using it fairly nonstandard - as a caching forward proxy to external data sources. Good stuff.
- bobfunk 11y agoOur CDN at Netlify (https://www.netlify.com https://www.netlify.com) is based on traffic server and it's powerful plugin engine. I've used both Squid, varnish and nginx plenty, but traffic server beat them in our benchmarks and the built in ssl termination + plugin api makes it extremely powerful...
- pavs 11y agoAnyone using this as a transparent forward proxy on a decent traffic (3-4gbps)? If so what kind of hardware needed to process 3-4 gbps tarffic?
- ksec 11y agoIt seems strange to me, that Nginx, Varnish and mostly getting the headline and not ATS, any idea why may that be?
- lhedstrom 11y agoLikely because ATS is considered 'difficult' whereas the others are 'easy'. I'd argue that if you are running a serious site, you need expertise engineering regardless of which software you choose.