It’s interesting because while this is an extreme case of performance improvement, the ROI doesn’t seem amazing. "rewriting in another language reduced the number of servers by 95%" is hard to beat, but at the same time, this saves "only" 2m a year, or about 0.3% of FY22 cost of revenue (per another post) Pinterest per employee revenue seems to be around 1m, which basically suggest that this could even be a worse tha…
Elixir saves Pinterest $2M a year in server costs
41–50 of 481 posts
Re: Elixir saves Pinterest $2M a year in server costs
#42They could have just used different Java/Python libraries and changed the architecture for the same result. The choice of a Programming Language alone has minimal impact on performance at that scale.
Yep, their blog post is carefully worded to say "The combined effect of better architecture and Elixir" but they didn't mention how much of it is related to architecture or what specifically they did with Elixir to make things faster. It feels like a marketing piece for their consulting services.
I mean they put:
> Rewrote an #AWS APIGateway & #lambda service that was costing us about $16000 / month in #elixir. Its running in 3 nodes that cost us about $150 / month
They saved 100x here by moving from an expensive architecture (Serverless lambdas) to potentially reserved instances which are reasonably affordable, at least for cloud standards.
I remember once needing to parse XML in Python. I started with the easy approach of using the first XML parsing library I found which was xmltodict. Eventually I stumbled upon lxml which improved overall performance by 20x and I didn't have to rewrite much code at all. Sometimes it's easy to get big wins in your existing language if you know what the problem is.
Re: Elixir saves Pinterest $2M a year in server costs
#43Earlier 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…
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…
Re: Elixir saves Pinterest $2M a year in server costs
#44Compared to Python. No wonder.
Re: Elixir saves Pinterest $2M a year in server costs
#45By 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…
> 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…
That's an enormous "except". Absolutely gigantic.
Re: Elixir saves Pinterest $2M a year in server costs
#46By 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…
> 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…
Re: Elixir saves Pinterest $2M a year in server costs
#47It’s interesting because while this is an extreme case of performance improvement, the ROI doesn’t seem amazing. "rewriting in another language reduced the number of servers by 95%" is hard to beat, but at the same time, this saves "only" 2m a year, or about 0.3% of FY22 cost of revenue (per another post) Pinterest per employee revenue seems to be around 1m, which basically suggest that this could even be a worse tha…
Re: Elixir saves Pinterest $2M a year in server costs
#48"One of the systems that ran on 200 Python servers now runs on four Elixir servers"
This alone is a major telltale.
Re: Elixir saves Pinterest $2M a year in server costs
#49Re: Elixir saves Pinterest $2M a year in server costs
#50It’s interesting because while this is an extreme case of performance improvement, the ROI doesn’t seem amazing. "rewriting in another language reduced the number of servers by 95%" is hard to beat, but at the same time, this saves "only" 2m a year, or about 0.3% of FY22 cost of revenue (per another post) Pinterest per employee revenue seems to be around 1m, which basically suggest that this could even be a worse tha…
Wouldn't you also need a smaller ops team that way, further reducing your costs?