What is Megaphone?

What is Megaphone?
The Megaphone project is about enhancing open source chat software. Specifically, the goal is to allow ejabberd to support 1,000,000 simultaneous users. See The Plan page for more details on how I plan to solve this problem. See the About this Blog page for more details on why I created this blog.

Friday, April 6, 2012

This is Not the Result You Are Looking for

Previously...
  • I changed the pass-through from single to multi-threaded.
  • IT ACTUALLY WORKED!
  • I talked a bit about gen_tcp and active mode.

I did some testing of erlang, ejabberd and megaphone.  I have to say, the results were not what I was hoping for.  

On its own, erlang consumes around 2kB of memory per process and 10kB of memory per TCP connection.  ejabberd uses around 100kB per connection.  This is bad news for megaphone because I was hoping to save a lot of memory by shrinking the number of connections down to one, but if the TCP connection only accounts for 10% of the total memory usage per connection, then megaphone is not going to enable significantly larger numbers of connections per server.

Initial testing with megaphone bears this out...unfortunately.  When using megaphone, ejabberd still uses about 100kB per user.  At 1,000,000 users, while megaphone might save 10GB, if the server still needs roughly 90GB, it's not going to make much difference.  

Another issue is that, during testing, ejabberd issued a number of 404 result codes in addition to 200's.  The headers returned appeared to be the same as for 200 messages, but the message body was empty in the case of a 404 --- as would be expected.  Currently, the megaphone protocol does not return a status code --- if things are to move forward, then this will have to be changed.

Next time: what to do.

No comments:

Post a Comment