ejabberd, Rosters and mySQL
A quick background.
We're running a ejabberd server with a fairly large userbase connecting to it (700k+ users). We had a problem with the roster size being too big for mnesia to handle, so we decided to have the web interface, add and remove roster entries for a user开发者_高级运维 when they log in/off. The problem with this method, is that it was delaying their log in's, which we couldn't have. Our work around for this, was to have the roster requests go into a delayed task table, which would get picked up by a cron and add the entries. The problem we then ran into was the rate at which entries were piling up in the DB was out stripping the time it was taking to process it. Testing showed it wasn't the script, but the actual response time from the ejabberd server.
After this, we decide to move the rosters from the internal menesia DB to mysql. By doing this, we could insert/delete rosters entries straight form the DB, which would have no impact on the ejabberd server.
I've successfully added and removed roster entries for users, and they are successfully showing up in the web interface.
Now for the problem: After I've added reciprocal roster entries, I need to tell users that this person is online, so that they show online in the web interface. Currently, after I've added the roster entries, the users just show as offline.
From my understanding, it should be a rather simple presence request that does this, but I'm having trouble getting it to work. Is there a module, or a easy way of sending a presence request, so people who have you in your roster know you are online and also a way to quickly probe your own roster.
Any help appreciated.
You also need to send the related <presence/> stanzas for propagating the roster updates to the clients.
You should read the relevant part of the RFC, conveniently linked here:
http://xmpp.org/rfcs/rfc3921.html#int
精彩评论