Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

131–140 of 481 posts

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

#131

> José: Why did you choose Elixir? > Steve: We chose Elixir because we were looking for a system that was easy for programmers to understand and could take better advantage of our servers. I was intrigued at Elixir’s combination of friendly syntax, powerful metaprogramming features, and incorporation of the Actor model. Am I wrong or is this guy in some sort of bubble where only functional languages are taught?

You seem to be wrong, at least based on the quote you chose to use here, as Steve doesn't even mention anything related to functional programming?

Elixir is a functional language for the Erlang VM. Most C++/Java/Rust/... programmers wpuld have hard time understanding it.

But if you are in a bubble where everyone uses Haskell and talks about Monads, then OPs statement may be valid

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

#133

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.

That perfectly describes my usage of Pinterest. People have written browser extensions to remove Pinterest from search results, as it is almost always a dead-end

Maybe to you, but my wife uses Pinterest a ton. It is where a lot of the women I know go to for ideas for just about everything, from house decor to even the ideas for our wedding.

Pinterest is useful just not for us nerdy guys. I am not sure why Google keeps it though or how they benefit, unless Pinterest uses AdSense exclusively, then one can determine that its some sort of partnership. You would think Google would be smarter about who to send over to Pinterest if thats the case.

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

#134
post #29

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

Can you give a concrete example where such a result was achieved by only switching libraries and modifying architecture?

https://news.ycombinator.com/item?id=37305247

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

#135
post #86

They just stopped coding lambda... This is not a matter of a language. Lambda is costly.

Author of the “Lambda” piece [0], all of the cost savings I discussed came from API Gateway alone. The lambdas were negligible.

That being said, I don’t think we could have processed the traffic more efficiently in another language.

We were processing 12M requests per hour. You could run the entire thing on 2 vCPU we “over provisioned the crap out of it” by running it on 4 pods w 2 vCPU as the upper request limit.

> Our service didn’t quite grow exponentially in use, but it did hockey stick. It went from free, to a few hundred bucks, to around $12,000 just for API Gateway. No Kinesis. No Lambda. Just API Gateway.

> A good part of this entire system still runs in Lambda, although it will be moving into Elixir over time to make it easier to reason about and develop on locally.

> What everyone should do is think about where your service is going, and can you afford those costs when you get there. If you don’t have a team of ops people and you aren’t familiar with serverful stuff, spending $30k/mo on HTTP requests might be cheaper than an ops team.

[0] https://medium.com/coryodaniel/from-erverless-to-elixir-4875...

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

#136

Earlier quoted context omitted.

Managing 200 Python servers/nodes certainly sounds operationally challenging.

i disagree, not much more then 2 servers.. you should automate it fully for documentation purposes alone at this scale & test failover regulary if you do this with 4 or 200 machines, does not make a big difference.

Actually it does because the chance of hitting strange edge cases grow significantly, as do the runtime of your deployment, plus networking problems risks.

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

#137
If anyone is struggling with analysis paralysis, remember it is ok to do things wrong the first time because then you can farm that sweet internet karma bragging about how you fixed your crappy first iteration.

If you always do things right the first time, you don't get to brag about putting out the fire your started.

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

#138
post #3

By 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…

So really "Python cost Pinterest $2M/year"...

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

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

I'd take noisy syntax over the noise that is Python API docs any day.

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

#140
post #100

Earlier quoted context omitted.

[flagged]

It’s not even remotely similar. Node’s cluster is just bog-standard OS subprocesses running their own event loop. To spread work over multiple cores with the cluster (or even worker-threads) modules you have to do so explicitely and manually. It’s essentially the same model you get with pthreads, or java, or python. BEAM is a completely different model, the “processes” are internal tasks, which the runtime will sched…

[deleted]
Post reply on HN