Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

71–80 of 481 posts

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

#71

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…

Obesity is not due to an eating disorder, it's due to sedentary lifestyles, pedestrian hostile neighborhoods, and market forces in the food industry.

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

#72

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.

It depends on what is actually being benchmarked though; if it's the simple JSON payload, more time will be spent on HTTP parsing (done in nginx for the PHP benchmark so really really fast) and some JSON parsing (done in a C library for the PHP benchmark so really really fast). Basically, how much PHP is actually being benchmarked?

Are you looking at a benchmark that compares real-world usage, or a microbenchmark like hello world or a small JSON payload?

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

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

It earns them money, and people aren't using competitors; Google has seemed to give up on the quality of results a long time ago in favor of plain volume and whatever numbers they use to measure success.

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

#74

Earlier quoted context omitted.

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…

Obesity is not due to an eating disorder, it's due to sedentary lifestyles, pedestrian hostile neighborhoods, and market forces in the food industry.

> Obesity is not due to an eating disorder

Wrong. Not in most cases, but binge eating disorder is a thing.

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

#76

I am very skeptical about this. The title makes it look like it's all about Elixir, but there seems to have been a fair amount of re-architecturing. "One of the systems that ran on 200 Python servers now runs on four Elixir servers" This alone is a major telltale.

For sure; Elixir comes with a whole new architecture as well, and they COULD have gained a significant performance improvement if they rewrote / re-architected it in Python.

However, could they have done a 50x performance improvement in Python? And what about the other numbers, like speed and concurrency?

That said, I'm confident they crunched the numbers and did the tradeoffs; after all, adding another language and/or architecture will make your company more complex, makes hiring more complex.

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

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

On the other hand, dealing with dependencies, deployment, even containerisation is a breeze in Elixir, so it balances out.

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

#78

I wonder how much of their traffic is angry people who ended up there by mistake. They could save a lot more than $2M if they just set robots.txt to disallow everything.

Or allow convenient usage without registration. It seems whatever I look for mostly is there, I just go away because I don't want to sign-up&in nor be tracked. I wouldn't realy mind if there were some reasonable non-intrusive content-relevant ads though.

I probably might even sign-up some day if I weren't repelled by this being required every time I come. I even stopped reading Quora, and, most recently, Twitter because of this - they started requiring signing-in while I don't want to stay signed in and be tracked even though I actually have respective accounts.

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

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

Unfair comparison, your Elixir example includes a module definition.

That said, code volume is never the issue, code clarity is. Right now you're comparing trivial examples, but what does in this case Pinterest's high volume spam detection code look like? I wouldn't judge a language on microscopic code snippets, or disregard them as "too noisy" when it usually isn't a deciding factor in programming languages.

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

#80

By the way, why Elixir and not just Erlang? (I mean a genuine question, not a dislike to Elixir, I don't code either of these yet and am curious)

Elixir is easier out of the box; Erlang, or rewriting small parts into 'pure' Erlang would be an option if needs be, but it's generally better to go with the easier of the two.
Post reply on HN