Live data from Hacker News

How We Went from 30 Servers to 2: Go

blog.iron.io

91–100 of 511 posts

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

#91
post #74
post #30

Earlier quoted context omitted.

It's quite strange to me that people would identify as or look for a "[language] programmer". Sure, I happen to write more C++, Python, and C than anything else, but I've dabbled in just about everything and could reach comfortable proficiency in a matter of weeks. Most of programming and all of computer science is universal. Any serious programmer should be a polyglot by default.

This is why Joel Spolsky correctly observed that the replacement of C/C++ and functional languages with Java in university CS curricula is a tragedy. If you don't understand pointers or recursion, you are not a polyglot and you cannot pick up just any language in a matter of weeks. The "[language] programmer" (where [language] usually = Java or .NET) trend is a misguided attempt by industry to commoditize programmer…

I've seen C/C++ programmers failed in writing good readable code.

C/C++ programmers tend to do premature optimization (habit) due to the culture and the problem domain (past experience): device driver, kernel code, game development.

How important Pointer is for say learning any high-level programming language that don't have pointers (pretty much everything outside C/C++/Objective-C)?

Sometimes I felt that knowing Pointer arithmetic and tricks are some sort of chess-thumping that old programmers tend to do. (My background is system programming so I know how pointer works).

It doesn't matter what you know or learn during the university. What matters is whether you continue to hone your skill or not and have a high bar of quality.

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

#92
Why did go "win" over erlang, scala, and clojure? Because it's becoming trendy and "fun?"

And, why are "fun" and "joy" terms ruby bloggers use for languages? Is this code for "easy" and "familiar?" As in, "this language is easy to learn.. It does not require us to learn difficult but mind-expanding concepts to become proficient."

Replacing ruby/rails with something (just about anything!) results in far fewer servers. Isn't this obvious to all? Is this really news to the average HN reader?

If that's an I/O bound API server, bet those two servers could be brought to one in a language/runtime that's more productive but a little less "fun" to learn.

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

#93
post #62

How about BDD, test-driven development and quality insurance? Does Go provide an ecosystem that supports agile refactorings that are common in lean startups? You can say anything bad about the performance of Ruby and Rails etc. but rspec, cucumber, capybara, vcr, factorygirl are really important features to start from zero and reach a viable product.

> test-driven development

`go test`.

> Does Go provide an ecosystem that supports agile refactorings that are common in lean startups?

Go has a compiler and is staticly and strongly typed. Which automatically makes it at least an order of magnitude easier to refactor safely.

Not really sure about the other stuff you mentioned. I've never even heard of BDD before.

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

#94
post #71

Earlier quoted context omitted.

Do you have a citation for Mozilla using Go? I would be a bit surprised given their(Mozilla) development of Rust.

Sure, check out their github pages (here's a few): * https://github.com/mozilla-services/heka-mozsvc-plugins * https://github.com/mozilla-services/heka My friend works for Mozilla - that's how I knew.

Thanks waterside81. Can anyone explain the difference between Mozilla and Mozilla services? A cursory glance seems some of the Github repositories overlap.

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

#95
post #69

Earlier quoted context omitted.

My guess is that removing 2-5 layers of abstraction can get you pretty far along.

We're writing most of the systems for our company in Go, and of the many reasons this ranked highly. Just removing the multiple unnecessary abstractions gets you a hell of a lot of simplicity and performance back.

I work in an area that requires a lot of high performance computing and there is a reason people in this area like code simplicity. Stacking layer upon layer of complex algorithms is a lot more difficult to reason about than having a simple and elegant system that's close to the metal.

There is a recent trend of building more and more complex systems, have less coupling and 'good oop'. That's all good and nice but simple code is:

  - more maintainable (a complex nest of objects & function calls all loosely coupled isn't)
  - a lot more readable
  - easier to optimize
  - better for your sanity
Some languages have build a culture of extreme complexity and are notable for building huge structures and systems to do simple tasks. Having a 50K lines of code dedicated to just inversion of control or O/R mapping makes a problem a lot more complex than it probably needs to be.

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

#97
I'm getting the same experience here by entirely rewriting an old PHP web application [1] in Haskell using the Yesod web framework.

I've been using JMeter to benchmark both versions of the application. On a 10€/month dedicated server [2], the Haskell one was able to generate 220 dynamic pages per second [3] whereas the PHP one tops at 35 pages per second on a equivalent page.

Moreover, concurrence capabilities of Haskell are also pretty sweet : while I was benchmarking the web app using 2,000 concurrent connections, the application server was only using around 90MiB of RAM. I was not able to increase the number of concurrent connections as the client application I was using started to kill my quad core desktop, I suspect Haskell to be able to manage A LOT MORE concurrent connections as I didn't see any decrease in the throughput of the application as I was increasing the number of concurrent connections.

[1] http://files.getwebb.org

[2] http://www.kimsufi.com/fr/

[3] Static content has been ignored as modern servers like NGinx seem to be able to carry the static content (CSS, images, ...) at more than 5,000 req/sec on the same machine.

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

#98
post #40

Earlier quoted context omitted.

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).

I use Apache too (it's all I've ever known), and run a few Go web apps. Everyone lives quite peacefully together. With Apache, I just set up a simple reverse proxy.

Here's an example of one I use to run my own `godoc` server:

    
        ServerAdmin admin@burntsushi.net
        ServerName godoc.burntsushi.net
        ProxyPreserveHost On
        ProxyPass / http://burntsushi.net:8080/
        ProxyPassReverse / http://burntsushi.net:8080/
    

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

#99
“the entire process started up with only a few hundred KB's of memory (on startup)”

There is no way this could be true: last time I checked, a bare minimal Go HTTP server requires at least 2.8MB of memory on 64-bit machine. Are you using the default net/http library?

Post reply on HN