Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

51–60 of 481 posts

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

#51

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…

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

[flagged]

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

#52

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…

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.

PHP is fast these days raw-speed wise. Concurrency and parallelism matter more than speed as they translate directly to utilisation.

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

#53
post #36

And then they take that $2M and bribe someone at Google to ensure 59% of the image search results are from Pinterest.

I'm really surprised Google Images doesn't block Pinterest.

Google are returning results for image search without the overhead cost. This is the only logical reason I can think of why Pinterest still exists.

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

#54

Earlier quoted context omitted.

Yeah, one thing it really shines at is recommending eating disorder content to teenage girls.

To be honest the world at large doesn't have an anorexia problem but an obesity epidemy. 50 millions children under the age of 5 are already obese (and I think 93% of obese children shall stay obese their entire life ). So... Anorexia may be a hill to die on and it's not fun for parents of anorexic kids but priorities, priorities and priorities. The real eating disorder worldwide leads to obesity, not anorexia and I…

Though I think the original comment was in reference to teen-aged girls and not the world at large.

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

#56
post #37

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…

> it's very likely that a Java-to-Java rewrite would have helped go down too. it depends. The elixir programming paradigm might be one where you are able to more easily write efficient, but still highly concurrent code, where as it would take more work to do the same in java.

Elixir / Erlang does open up a lot of paradigms. However it'll be interesting to see how Java fairs with its new virtual threads. There was already Akka so it should happen fairly quickly.

Still I'd prefer Elixir. The BEAM VM just runs lighter.

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

#58
post #39

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…

It more than just server costs. They reduced the complexity of their services by a lot.

Having to maintain 95% less servers is worth it even if they didn't save any money IMO.

This also could lead to them reducing their engineering team that maintains these services which would reduce costs even more.

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

#59
post #31

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…

Faster doesn’t mean more responsive, in fact very often an increase in throughput leads to an increase in latency.

Erlang and Elixir are famous for maintaining very low latency under load - it's due to the way the Erlang scheduler works.

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

#60
post #53
post #36

Earlier quoted context omitted.

I'm really surprised Google Images doesn't block Pinterest.

Google are returning results for image search without the overhead cost. This is the only logical reason I can think of why Pinterest still exists.

I was never sure where all the hate is coming from. Pinterest is actually one of my favourite apps, that I use regularly – and I use very few apps. I actually really love it and after years I still find new uses for it. As far as I can tell, they have a pretty loyal user base.
Post reply on HN