Live data from Hacker News

How We Went from 30 Servers to 2: Go

blog.iron.io

31–40 of 511 posts

Re: How We Went from 30 Servers to 2: Go

#31
post #23

Why Go over Erlang?

(Note: I'm a big Erlang supporter and 90% of my startup's code is written in Erlang)

Erlang is not memory efficient (compared to Go? I don't have benchmarks to back this up) AND the learning curve for developers not exposed to functional programming (which is a lot) is quite a bit higher than it is in Go.

Re: How We Went from 30 Servers to 2: Go

#32

Interesting to hear of Go being used in production. It'd be great to hear some more details on your setup when deploying the go processes - how are you managing failover, what's your load balancer, and how are you handling swapping out processes etc? Are you compiling on the server or local machines before deployment? Most other languages have lots of solutions on the deployment side now but Go is so new there isn't…

For my (toy) apps, I've been compiling locally and pushing to the server. It's trivial to compile for a target platform and architecture, and you get a single compiled binary. Certainly my response isn't getting all the way to what you're looking for, but it's not difficult to write shell scripts that manage the deploy process from here.

Re: How We Went from 30 Servers to 2: Go

#33
post #6

Why was Go chosen over NodeJS ?

Mostly because I can't stand Javascript. It makes me cringe just thinking about it. Go is much nicer to work with.

Although I personally like CoffeeScript, I must say that Go fills me with joy for some reason.

It feels "fresh" and lightweight to the beginner, and reminds me of TurboPascal in some ways.

Re: How We Went from 30 Servers to 2: Go

#34
post #13

I've read this domino-effect on server clusters on several HN postmortems and I've seen various flavors of this on our own web servers. I'd like to think there's a simple configuration in most servers that prevent 100% cpu utilization from taking place and preventing the server from telling its cluster that it's still alive. Anyone have any experience with this?

It's not really possible without adding resources (ie a new server).

The problem is, once your servers get saturated, requests queue up, processing slows down and users start to hit refresh which artificially and exponentially increases traffic. Then to compound things, servers buckle, which means you lose a resource right when you needed it the most.

A domino effect is one analogy, another might be how a small hole in a damn can buckle and blow open from the force of the water pushing through.

Re: How We Went from 30 Servers to 2: Go

#35

Last month I picked NodeJS and build couple of sites with it. This month, I want to pick up something new. I was hesitating between Python and Go. Can you answer couple of questions about Go from someone coming from NodeJS: 1- What is the state of the external Go libraries, especially DB (MySql), caching libraries (memcached), protocol libraries (Oauth). Are they stable 100% 2- How easy is logging and tracing in go?…

Memcached's author (Brad Fitzpatrick) is a Go user, and wrote a memcache client for Go. Go has a bunch of good stuff surrounding SQL. I haven't used MySQL, personally, so I can't comment on which MySQL driver is best, but I know YouTube uses Go for something related to MySQL, though I can't say for certain exactly what. http://code.google.com/p/vitess The goauth2 ( http://code.google.com/p/goauth2 ) library is writte…

Well, Go has a bunch of libraries for different SQL servers. I wouldn't go so far as to say it has lots of good SQL stuff; it's in approximately the same place as C is w.r.t. databases.

Having to interface with complicated SQL is a reason not to use Go (but not an insurmountable one).

Re: How We Went from 30 Servers to 2: Go

#37
post #2

Excellent success story with Go. Love this quote... "We also weren't sure if we would be able hire top talent if we chose Go, but we soon found out that we could get top talent because we chose Go."

the lisp community used to hold this as a truism - there are some languages so good (powerful, satisfying and pleasurable to work with) that they become a compelling reason to take a job regardless of the nature of the actual product.

Re: How We Went from 30 Servers to 2: Go

#39

Last month I picked NodeJS and build couple of sites with it. This month, I want to pick up something new. I was hesitating between Python and Go. Can you answer couple of questions about Go from someone coming from NodeJS: 1- What is the state of the external Go libraries, especially DB (MySql), caching libraries (memcached), protocol libraries (Oauth). Are they stable 100% 2- How easy is logging and tracing in go?…

Memcached's author (Brad Fitzpatrick) is a Go user, and wrote a memcache client for Go. Go has a bunch of good stuff surrounding SQL. I haven't used MySQL, personally, so I can't comment on which MySQL driver is best, but I know YouTube uses Go for something related to MySQL, though I can't say for certain exactly what. http://code.google.com/p/vitess The goauth2 ( http://code.google.com/p/goauth2 ) library is writte…

Brad Fitzpatrick is not just a Go user, he is a core Go developer :-).

Re: How We Went from 30 Servers to 2: Go

#40
post #25

Has anyone had an experience of running websites from Go; or more specifically, how you handle none-HTML content? I've been considering porting my CMS from mod_perl to Go, but I'm not sure how you work with the other files (CSS et al). I did read somewhere that you run Go from Apache but it's not recommended.

I've just started creating toy projects in Go. I put these Go projects (and Apache, which runs older PHP projects) behind nginx. For hosting CSS, you either generate it programmatically and send the right Header, or you can use http.FileServe from the standard library [1]. (Surely other approaches are possible, but those are the two I've played with so far.) [1] https://code.google.com/p/go-wiki/wiki/HttpStaticFiles

Thanks for that.

The issue I have is that I would prefer to keep Apache around if I can (I have a few sites - some of which I host for friends). While my web server does have a few IPs attached, I'd rather not have to buy more IPs just to separate Apache from Go.

And to be perfectly honest, I do quite like Apache. (each to their own I know, but I've had little reason to complain about it).

Post reply on HN