5 ms·
I will take the advice provided the day I deploy a Go app that prints a single static string to the stream. In other words, absolutely never. This is the core
by corresation 13y ago
I will take the advice provided the day I deploy a Go app that prints a single static string to the stream. In other words, absolutely never.
This is the core problem with such benchmarks - that 'overhead' quickly becomes proportionally irrelevant when you're actually doing something worth doing. But with Nginx in front, suddenly you have so much flexibility without reinventing the wheel, including load balancing, mixing server technologies with ease, not dealing with static junk in your go code, proxy caching (recently used this to really good effect with a Go service, putting zero caching in the Go code and instead using standard http expiration headers to allow Nginx to do the magic), anti-DOS, streaming compression, security, SPDY, and on and on.
As fair disclosure, I have written on this before - http://dennisforbes.ca/index.php/2013/08/07/ten-reasons-you-should-still-use-nginx/ http://dennisforbes.ca/index.php/2013/08/07/ten-reasons-you-...
- pstuart 13y agoExcellent points. Now cruising through your blog -- good stuff!
- mrweasel 13y agoI'm not sure how big the issue is, but I would add the ability to run your Go app as an restricted user. Using Nginx or another webserver in front of your app means that you won't have to deal with privilege seperation yourself. Just run the Go binary in a chroot as an restricted user and let Nginx deal with the binding on port 80/443.
- BarkMore 13y agoIf all you want is binding to port 80/443, then it's simpler to use iptable port forwarding than Nginx.