Erlang vs Rails processes FUD
Murphees Rant - Werner Schuster - June 07, 2007Wow… I just read a uniquely silly piece of FUD in Is DHH right about concurrency? Actually, the text is OK, I guess. It wonders whether Erlang’s shared nothing is better than Rails shared nothing approach. After all: Rails allows you to make use of multiple cores despite Ruby‘s userspace threads… it just starts multiple processes.
The silly bit comes later on in the article:
This argument also completely omits the memory overhead of Rails. With a 50–70MB baseline and a real-world Rails process growing to nearly 200MB over time, a 64 core CPU will require at least 13GB of RAM to even run a single Rails instance per CPU core.
The silly bit? Here it goes:
Now, let‘s compare to Erlang processes, which have approximately 300 bytes of overhead… perhaps a naive comparison, but you get the idea.
Oh yes, I do get the idea, and don’t worry, the comparison is not naive It’s Bullshit He’s basically comparing the memory usage of a Rails process filled with data necessary for serving requests to the management overhead of an Erlang process.
After all: Erlang processes can be compared to userspace threads (the difference is that they don‘t share the address space). Every process needs some management overhead: entries in the scheduler or manager, some stack space or whatever else it needs. This is the 300 bytes of overhead of an Erlang process that was just created and hasn‘t yet had the time to do anything.
So… this comparison is comparing apples to orchards, and it‘s complaining that the latter is soooooo big and full of trees.
What‘d be a fair comparison? Well, one approach would be to check how much data the OS needs to create a new OS process (Rails process), which means page tables, internal structures, etc. This could then be compared to the 300 bytes of an Erlang process… naively. And yes: this ignores the loaded Ruby code (which, as far as I can tell, is not shared across Ruby instances), but then the 300 bytes don‘t include that either.
Approaching it from the other end, you‘d compare an Erlang process actually busy serving page, looking up stuff in Mnesia or caches or whatever. Of course, this is still problematic, since processes are a dime a dozen in Erlang, and it‘s as easy to start a process as to print “Hello World”, so there‘s the question what to compare against what.
Oh… and just to be clear: this is not a dig against Erlang, which is a great system and I guess ErlyWeb is worth looking at.
However the linked article/comparison is, frankly, Bullshit. Try again…
Categories: Blogs Murphees Rant
Erlang on Twitter
» vsovietov (vsovietov): RT @FrancescoC: Lots of companies in finance use Erlang, but they don’t want to speak about it in public. Morgan Stanley does: http://t.co/…
» nivertech (Zvi): RT @lhoguin: Cowboy Function Reference http://t.co/nA2x66QNPO the functions listed are part of the stable API that’s going into Cowboy 1.0 …
» nivertech (Zvi): RT @erlangfactory: #EUC2013: Early bird ends in 4 hours!
Last chance to get a discount ticket for the biggest #Erlang event in Europe http:…
» nivertech (Zvi): RT @FrancescoC: Lots of companies in finance use Erlang, but they don’t want to speak about it in public. Morgan Stanley does: http://t.co/…
» yunomu11 (Yusuke Nomura): RT @benymd_bot: @yunomu11 さんの特徴語。ビルド,ラブライブ,Haskell,Java,ライブラリ,パーサ,はてなブログ,コンパイル,モナド,面白い,バグ,プログラマ,TARI TARI,コード,サーバ,関数,AWS,Erlang,API,データ,クォー…
» macintux (John Daily): RT @aeden: I’ll be speaking at @strangeloop_stl on Erlang for Authoritative DNS: https://t.co/Jx4GoQ0ByY - I’m so excited!
» FrancescoC (Francesco Cesarini): RT @joeerl: reading the program of #erlang users confernce http://t.co/dsYbZiuKMy
this is going to be *very* interesting, and in june in st…
» cmeik (Chris Meiklejohn): RT @aeden: I’ll be speaking at @strangeloop_stl on Erlang for Authoritative DNS: https://t.co/Jx4GoQ0ByY - I’m so excited!
» ErlangInfo (Erlang!): RT @aeden: I’ll be speaking at @strangeloop_stl on Erlang for Authoritative DNS: https://t.co/Jx4GoQ0ByY - I’m so excited!
» ErlangInfo (Erlang!): RT @JonGretar: An suggestion for a good connection pool lib for using with eredis? #erlang #lazytweet
Statistics
Number of aggregated posts: 10648
Most recent article: May 14, 2013
Latest comments
» Moraru on This is Why You Spent All that Time Learning to Program: It is true that computer science was a pain in the back at time that i’ve had to learn it…
» Commercial hand dryers on Couchbase Meetup at new HQ: Buy online from here where you will get so much of variety in Commercial hand dryers for people. If you…
» Fort McMurray Homes on Motivated Reasoning and Erlang vs Python vs Node: I don’t really understand why this post is motivational? I don’t even see a post, just a title. Fort McMurray…