Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

101–110 of 481 posts

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

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

Or Erlang for even less noise ;)

    -module(math).

    sum(A, B) ->
        A + B.

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

#103

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…

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…

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

A java-to-java rewrite could have been as much if not more painful than a java-to-elixir rewrite, especially if the service is highly concurrent.

Rewriting synchronous code as asynchronous in Java is a lot of work and not fun at all IMO.

Given the recent arrival of virtual threads in Java 21 this may not be necessary any longer but at the time I think it was a perfectly reasonable choice.

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

#105
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

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

#106
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]

I think Node is still single core by default? Elixir (or rather the Beam) will handle core utilisation so if you start a load of Elixir processes they’ll be spread across multiple cores.

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

#107
post #60
post #53

Earlier quoted context omitted.

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.

> 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'm not looking for an _app_ when searching in google, I'm looking for a link to a _web site_ with original image.

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

#109
post #100

Earlier quoted context omitted.

[flagged]

I think Node is still single core by default? Elixir (or rather the Beam) will handle core utilisation so if you start a load of Elixir processes they’ll be spread across multiple cores.

[flagged]

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

#110

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.

Because they are different languages with different VMs and different concerns. Made for different purposes. Number crunching is slower in Erlang VM (you can call C code though).
Post reply on HN