We’re implementing a general subscription manager, but we’ll be subscribing people to everyone on their friends list automatically - so you could also think of this as a friends database for now. (Although I’ve not heard of anyone except Facebook using Erlang for this kind of thing). FriendFeed even have a realtime API in beta, so this kind of thing is definitely topical. timeout() An interval to make a dummy SQL request to keep alive the connections to the. For SQLite this must be a full path to a database file. Flickr photo uploads, Facebook newsfeed items, Twitter messages etc. A time to wait for connection to an SQL server to be established. It could equally apply to other events generated on social networks. My intention is to use this for Last.fm so I can get a realtime feed of songs my friends are currently listening to. We want the application store who your friends are, so it can push you all events generated by people on your friends list. Before we launch into a large-scale test, let’s add one more module - a subscription database. This is fine for a chat/IM system, but that there are sexier things we could do instead. In Part 2 we used the router to send messages to specific users. Writing a server to accept 1M connections is easier than actually creating 1M connections to test it with, so a fair amount of this article is about the techniques used to open 1M connections from a single machine. One of the challenging parts of this test was actually being able to open 1M connections from a single test machine. Benchmark with 1 Million connected users.Opening a million connections from one machine.Tune mnesia and bulk load in our friends data.To enable it, simply add modmam in ejabberd modules configuration. It support Mnesia internal storage and relational database backend (aka odbc, but actually use native drivers). Generate a realistic friends dataset for a million users ejabberd now comes with its own full feature message archiving implementation: It support both version 0.2 and the more recent version 0.3 of the protocol.Add a pubsub-like subscription database using Mnesia.It was fun, but now it’s time to make good on the claims made in the title, and turn it up to 1 million connections. About 'validate the photo', yes we want check if it's not a pornographic photo for example. I just want that our administrator for the ejabberd server can see the photo of each user in the Web interface. We did ye olde c10k test, and observed what happened with 10,000 connected users. In fact, it's not a modification but simply a consultation of the photo that I'd like. We managed to squeeze application memory down to 8KB per connection. In Part 1 and Part 2 of this series we built a comet application using mochiweb, and learned how to route messages to connected users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |