Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

111–120 of 481 posts

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

#111
> 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?

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

#112
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.

> Even old pre-7 PHP was much faster than Ruby, Python, and others.

No, PHP 7 was an impressive step forward in speed because it switched to better bytecode and object representations internally, but Python wiped the floor with most versions of PHP 5 for exactly the same reason. (PHP 5.5 with opcaching was roughly comparable.)

But this comparison overall is like trying to find the strongest two-year-old...

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

#113

I wonder how much of their traffic is angry people who ended up there by mistake. They could save a lot more than $2M if they just set robots.txt to disallow everything.

That perfectly describes my usage of Pinterest.

People have written browser extensions to remove Pinterest from search results, as it is almost always a dead-end

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

#114
post #100
post #64

Earlier quoted context omitted.

The advantages of Elixir are not performance-related. There is a lot of focus on raw performance on web-related services, when in reality most of their running time is spent waiting for IO. If there are two things the BEAM excels at, is IO and turning almost any problem into half a dozen processes that are scheduled and run in parallel, if not geographically-distributed, with 1/50th the effort of any other language.…

[flagged]

Async/await and any module won't save you from global state, data races, and the fact that you're running on an imperative language with mutable state. Additionally, the ergonomics are not the same, so even if you could replicate the BEAM in Node or any other language, you'd have to be a masochist to do it.

Lastly, the concurrency are primitives to the entire runtime, not a set of external libraries maintained by whoever, which might be incompatible with other libraries you might want to use.

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

#115
post #3

By the title alone, this means nothing. How much would it cost otherwise? What is the percentage savings? In TFA, it gets better though: "Steve: That’s pretty easy. When I started on the spam team, we had close to 1,400 servers running. When we converted several parts to Elixir, we reduced that by around 95%. One of the systems that ran on 200 Python servers now runs on four Elixir servers (it can actually run on two…

It's really strange to me how people continue to build services using python, knowing it is 100 times slower than appropriate languages, and then get surprised by it being 100 times slower, so they eventually rewrite it.

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

#116
post #100
post #64

Earlier quoted context omitted.

The advantages of Elixir are not performance-related. There is a lot of focus on raw performance on web-related services, when in reality most of their running time is spent waiting for IO. If there are two things the BEAM excels at, is IO and turning almost any problem into half a dozen processes that are scheduled and run in parallel, if not geographically-distributed, with 1/50th the effort of any other language.…

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

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

#117
post #66

My problem with Elixir is that the syntax is too noisy: defmodule Math do def sum(a, b) do a+b end end Compare that with Python: def sum(a, b): return a+b Having the name of the file be the name of the module and whitespace defining the blocks is the perfect approach for me.

You're not seriously complaining about 2 extra lines of code in what would typically be a 100+ line file, are you?

Besides, the equivalent of Elixir's module (a struct with functions) is Python's class, not a plain file.

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

#118
post #14

Does anyone has any followup information about the companies and people mentioned? Sadly last blog from Cory O'Daniel is from 2019 and Bleacher Report engineering blog post shows 2019 as the last post. Pinterest has 81 public repos on GitHub but only 3 with Elixir code base.

waves

Haha, Hi Cory, I would really like if 5 years after that article and blog posts if you are still in the Elixir ecosystem?

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

#119
post #64

Earlier quoted context omitted.

> When our notifications system was running on Java, it was on 30 c32.xl instances. When we switched over to Elixir, we could run on 15. Would be curious to know how they tried to optimise the Java stack. Because on every benchmark I've seen the JVM is faster in every which way than Elixir. Except for memory where often people will over-provision the JVM rather than look at where their code might be over-allocating o…

The advantages of Elixir are not performance-related. There is a lot of focus on raw performance on web-related services, when in reality most of their running time is spent waiting for IO. If there are two things the BEAM excels at, is IO and turning almost any problem into half a dozen processes that are scheduled and run in parallel, if not geographically-distributed, with 1/50th the effort of any other language.…

Those naive sequential services don't really exist in prod though.

It would be a dark day to discover my AWS t1.337metal was blocking 63 cores on I/O when nearly every modern lang has a wealth of async functionalities just awaiting to be exploited.

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

#120

> 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?

You seem to be wrong, at least based on the quote you chose to use here, as Steve doesn't even mention anything related to functional programming?
Post reply on HN