Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

351–360 of 481 posts

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

#351

Earlier quoted context omitted.

Though if people consistently over decades sing a language's praises on a single point consistently like they do the beam on this point, it's usually not without merit

They wrote it from scratch with the benefit of all the knowledge they had gathered after running the old system for years. A 2X improvement would not be surprising to me, even if they had rewritten it in the same language. . According to others in this discussion they also made architecture changes (DB, Kafka etc.). Do we know if that improved the performance? There is no objective way we can tell if Elixir had any p…

Elixir/BEAM's (Erlang Virtual machine) frugality isn't just theoretical; it's got real-world creds. Originally tailored/optimized for 1980s telecom switches (a fleet of single core extremely low powered machines.) Fast forward, and you've got a setup that's less demanding on your A/C and optimizes multi-core usage like a champ. it utilizes the same concurrency abstractions whether its 2 cores across two machines or 64 cores on the same machine, it makes no difference to the BEAM

Take the hot code reloading and actor model-based concurrency as a prime example. It's like getting AWS-level functionality without the steep bill for a lot of companies.

Though, I gotta admit, it used to be a hard sell for CPU-heavy workloads, especially number crunching. But Elixir is stepping it up with their Nx library, so that's changing.

Examples of companies cashing in on BEAM's efficiency:

    Bleacher Report: Went from 150 servers down to 5. No joke.

    Discord: Handles millions of real-time users without breaking a sweat or the bank.

    Financial Times: Their content recommendation engine got both efficient and cost-effective.

    Change.org: More petitions, fewer servers.

    Podium: A million SMS messages a day and didn't have to massively scale hardware.

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

#352

Earlier quoted context omitted.

No monads though. No pure functions, no Option types, pretty much no recursion in practice. Really it’s got none of the stuff that makes some FP languages hard to learn. (Except maybe “no for loops”).

That's true - Elixir is simpler to learn than, say, Haskell. All I'm saying is that it's not a trivial jump from Elixir to Ruby, despite the superficially similar syntax.

I don’t think eg ruby->go is a bigger jump. Learn defer, structural typing, interfaces vs learn to replace all loops with map/filter/etc + pattern matching. Feels similar, no?

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

#353

Earlier quoted context omitted.

Elixir is a functional language for the Erlang VM. Most C++/Java/Rust/... programmers wpuld have hard time understanding it. But if you are in a bubble where everyone uses Haskell and talks about Monads, then OPs statement may be valid

Rust screams Erlang influence, but maybe it's just me. IIRC, in the beginning they even tried to put in a green threading VM for tail calls, which seems insane for something that you want to be a systems language.

Native green threading instead of async/await would have made for a much more pleasant to use Rust language IMO.

I hate async/await with a passion.

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

#354
post #157

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

I like Elixir as much as any other guy but I am not going to chose it for my team because it was "easy for programmers to understand" If you wanted something that was easy you'd go got Golang or Java, not a language without types. Lots of reasons to love Elixir but this doesn't sound like one

Java is an order of magnitude more difficult to learn vs. Elixir. Especially in the context of Java web frameworks.

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

#355

Earlier quoted context omitted.

Elixir is a functional language for the Erlang VM. Most C++/Java/Rust/... programmers wpuld have hard time understanding it. But if you are in a bubble where everyone uses Haskell and talks about Monads, then OPs statement may be valid

Don’t forget having to know beam and erlang especially if post junior/intern level where it’s more than just “it looks like ruby”

I’ve used Elixir for half a decade and never had to dig into Erlang.

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

#356
post #305

Earlier quoted context omitted.

An even less significant rounding error; on the order of ~0.002% relative to AWS carbon footprint at best using FY23 forward net sales as a rough proxy.

Since there are really many companies and people using AWS, the effect would be noticeable if everyone managed such a decrease. Calling it "an even less significant rounding error" borders on bad faith.

> Since there are really many companies and people using AWS, the effect would be noticeable if everyone managed such a decrease.

Your condition is predicated on "everyone" at Pinterest revenue scale justifying the business case of throwing away their existing tech stack and adopting Elixir with an equivalent architecture---never mind that the article is coming from a company that sells Elixir consulting services---while major CSPs voluntarily bend over to notionally substantial revenue decline...and I'm bordering on bad faith??

At least I bothered to put a supporting numerical estimate on the hypothetical; you're just handwaving greenwashed bullshit with improbable, unsupported outcomes.

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

#357

Earlier quoted context omitted.

I think that's developers using GenServer.cast when they should be using call. Call gives you back pressure mechanism.

TBH at the load we had we got substantial savings by eventually replacing usage of gen_server as well, though that probably isn’t a good idea much of the time. The OOMs were largely being caused by calls to and from other services (i.e. kafka) so the answer proved to be in controlling the rate at which things come in and out at the very edge. From what I saw I got the impression the Beam devs assumed memory and CPU u…

This sounds like ets tables holding on to binaries that were extracted from JSON. This is something that iirc pager duty ran into.

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

#358
post #63

Anecdotally, I am beginning to hear more and more about organisations moving away from high level cloud infrastructure (such as lambda and cloud gateway) and going back to plain old virtual servers (like EC2), or even on-prem. Often the cost of supposedly "cheap" cloud environments is WAY more than you might expect and all booked as operational rather than capital expenditure (the latter being often preferable to sha…

> (...) and going back to plain old virtual servers

Some of us never left ;)

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

#359

Earlier quoted context omitted.

And of course you can just go and buy a much faster JVM from Azul rather then rewrite everything.

then I have to pay Azul for the faster JVM and I may still not sufficiently cut my server costs, or the cost of the JVM paces the reduction I have in server costs. 2 million a year is several developers compensation saved every year. It also opens the door to more savings down the road, potentially, as existing workloads may discover they can use the same approaches to reduce cost / overhead.

I was just adding that in addition to the truth that normal Java could just do it. But if that is really not enough, then paying for a few Azul licenses is an addition can save you time and money.

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

#360

Earlier quoted context omitted.

They wrote it from scratch with the benefit of all the knowledge they had gathered after running the old system for years. A 2X improvement would not be surprising to me, even if they had rewritten it in the same language. . According to others in this discussion they also made architecture changes (DB, Kafka etc.). Do we know if that improved the performance? There is no objective way we can tell if Elixir had any p…

Elixir/BEAM's (Erlang Virtual machine) frugality isn't just theoretical; it's got real-world creds. Originally tailored/optimized for 1980s telecom switches (a fleet of single core extremely low powered machines.) Fast forward, and you've got a setup that's less demanding on your A/C and optimizes multi-core usage like a champ. it utilizes the same concurrency abstractions whether its 2 cores across two machines or 6…

> a fleet of single core low, extremely powered machines.

what are "extremely powered machines"?

> It's like getting AWS-level functionality without the steep bill

which part of AWS functionality? load-balancing Beanstalk-style is free. AWS compute is not free, but neither is compute free with Elixir or whatever stack you run.

Post reply on HN