Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

281–290 of 481 posts

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

#281

Earlier quoted context omitted.

It's one thing to use Pinterest intentionally, a whole other to have it shoved down your throat.

Where / How are you finding Pinterest links? I've just searched about two years of browser history and i haven't landed their once.

?? That just means you haven't clicked on the links. Of course the pollution will not be represented in your browser history.

Nobody is saying they are forced to visit the site.

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

#282

Earlier quoted context omitted.

This is a pretty realistic balanced real-world benchmark of web frameworks (and languages): https://www.techempower.com/benchmarks/ It shows that Python with Django is literally 40 times slower than the fastest framework. Python with uvicorn is 10 times slower. The use of languages like Python and Ruby literally results in >10x the servers being used; which not only results in higher cost, but also greater electricit…

Do you know if there are plans to publish more recent numbers, the newest one is a year old. I'll definitely take a look at JustJS, that's an impressive ranking!!!

The creator of JustJS has written about how it's so fast actually:

https://just.billywhizz.io/blog/on-javascript-performance-01...

(Related GitHub thread: https://github.com/just-js/just/issues/5)

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

#283
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.…

>Handling requests over separate threads, like 99% of languages do, still isn't enough if all the business logic runs on the same thread.

I mean, if your business logic is inherently serial it makes little difference if you run it in a single thread or if each serial segment in between IO requests is run in a different thread. One way or another it's not going to get parallelized.

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

#284

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…

Not to just toss around anecdotes, but I once rewrote an email service in elixir for a company from a literal sketch on a piece of printer paper describing what their old system did. The new service ran on 1 server vs half a dozen and was both faster at crunching through their mail queue and used far fewer resources. Some tasks are embarrassingly parallelization and the BEAM excels at those tasks. Sure you might want features it doesn't have for certain systems, but for some things it really is the right tool.

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

#285

Earlier quoted context omitted.

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

It's a ridiculous thing to say that any version of PHP is slow. You could run PHP5 today and it's still not slow by any modern standard. Even on the hardware of 15 years ago almost any script you throw at it finishes in single digit milliseconds. How is that slow? I'd like to meet the developers that consider this slow.

I guess it depends on what the script is doing, but I'd consider that slow. Code I've worked on in Scala takes more like 50-60 microseconds per http request for a json CRUD type of thing (plus latency to wait for the db, but it can serve other requests during that time).

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

#286

Earlier quoted context omitted.

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

It's a ridiculous thing to say that any version of PHP is slow. You could run PHP5 today and it's still not slow by any modern standard. Even on the hardware of 15 years ago almost any script you throw at it finishes in single digit milliseconds. How is that slow? I'd like to meet the developers that consider this slow.

Ladies and gentlemen, the strongest two-year-old.

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

#289
post #214

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…

They threw DB[s] and Kafka into the mix. Python would get them the same net gain, if not more, with less dev cost. Python's I/O workloads perform on par with Go/NodeJS (See FastAPIs 3rd party quarterly benchmarks as an example). If they rebrand Python to Metal or some other name, people would recommend it left and right. It's just suffering from bandwagon criticism. Yet it remains one of the top 3 languages for years…

Python is the second best language for everything. Even with its warts (which any language gets after 30 years), it's a very solid, defensible choice.

However, it does not have a great concurrency story relative to languages that were built concurrency first (Go, Erlang), and it's fair to acknowledge that.

Post reply on HN