Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

141–150 of 481 posts

Re: Elixir saves Pinterest $2M a year in server costs

#141

Earlier quoted context omitted.

Is this a cpu-heavy workload? If it's mostly io-heavy, I could see a gevent + pypy approach getting 50x better.

[flagged]

Flagged for being silly flamebait. The Python projects you have personal experience with might have been poorly run but that’s not representative of the language, and it’s not going to lead to a conversation where anyone learns something.

Re: Elixir saves Pinterest $2M a year in server costs

#142

If anyone is struggling with analysis paralysis, remember it is ok to do things wrong the first time because then you can farm that sweet internet karma bragging about how you fixed your crappy first iteration. If you always do things right the first time, you don't get to brag about putting out the fire your started.

Exactly. Goal number one is a working product. All you know is python? Write it in Python.

Re: Elixir saves Pinterest $2M a year in server costs

#144
post #93

Earlier quoted context omitted.

Elixir is slower than plain PHP according to the techempower benchmarks. I'm not even sure how that's possible but it is. By like a factor of 2 iirc. I'm not sure how elixir is that slow since it's compiled.

> Elixir is slower than plain PHP according to the techempower benchmarks. I'm not even sure how that's possible but it is. You're "Not even sure how that's possible" as if implying PHP is slow? Even old pre-7 PHP was much faster than Ruby, Python, and others. And most PHP libs are just wrappers over C code.

Ruby and Rails especially, aren't fast in terms of fast running programs. But they are fast in terms of launching features quickly.

Playing with Elixir, I feel similar speed of development, but it also comes with speed of running, which is incredible.

Re: Elixir saves Pinterest $2M a year in server costs

#145

Earlier quoted context omitted.

They rewrote, which is known to help too. Going from 30 to 15 instances is not bad but it's very likely that a Java-to-Java rewrite would have helped go down too. The big one however is going from 200 Python servers to 4 Erlang ones: a 50x reduction is quite something and a Python-to-Python rewrite would not have allowed to achieved a 50x gain: > All this is possible because Elixir, and the Erlang platform underneath…

> The big one however is going from 200 Python servers to 4 Erlang ones If your rewrite or refactor gives you a 10X in performance, that's not an optimization, but a bugfix. Unless you are a researcher who have just found a revolutionary algorithm.

I’m going to be cynical and say that if they went from 200 to 4 servers they were probably spawning the python code via cgi, synchronously…

Re: Elixir saves Pinterest $2M a year in server costs

#147

> The combined effect of better architecture and Elixir saved Pinterest over $2 million per year in server costs So it may not even be Elixir that is saving most of that money. Who knows.

My bet is that the bulk of the savings came from the re-architecture and, at best, Elixir sped up the path to get there.

I wrote the lambda piece, you could say re-arch saved us the money (although we could only re-arch cheaply because we already had other massive scale serverful systems in place), but I don’t believe I could have made it as efficient and dependency free in any other language.

i had been developing in ruby for over a decade and about 5 years of Node exp at the time.

im not a language enthusiast and mostly write in go today.

Re: Elixir saves Pinterest $2M a year in server costs

#148

> José: Why did you choose Elixir? > Steve: We chose Elixir because we were looking for a system that was easy for programmers to understand and could take better advantage of our servers. I was intrigued at Elixir’s combination of friendly syntax, powerful metaprogramming features, and incorporation of the Actor model. Am I wrong or is this guy in some sort of bubble where only functional languages are taught?

If I didn't know the context, I'd think this is a troll comment.

I bought a book about Elixir and genuinely tried to learn it, but noped out quickly as in I find programs written in it to be unworkable mess quickly.

It's like Perl on crack.

Re: Elixir saves Pinterest $2M a year in server costs

#149
post #116
post #100

Earlier quoted context omitted.

[flagged]

NodeJS was designed to run single-threaded. Sure, you can use cluster module to run it with multiple but there's memory overhead and the ergonomics of sharing state and message-passing is nowhere near GenServer. Not to mention all the other benefits of BEAM. But about the specifics of implementing a web-crawler, a NodeJS way to implement it would be to parallelize using lambdas.

[deleted]
Post reply on HN