Non-Blocking MySQL Roster

Yann Kerherve yann at
Mon Feb 1 18:15:57 UTC 2010

On Sun, Jan 31, 2010 at 7:37 PM, Austin Brkich <austin.brkich at> wrote:
> I was taking a look at the SQLite Roster Storage that is provided with
> DJabberd and was wondering what would be needed to convert it to use
> MySQL without blocking. I don't know to much details about the Perl +
> MySQL section which is why I am asking for some help. I know you can
> setup a MySQL table to use InnoDB which uses row locking instead of
> table locking (better for multiple applications accessing the same
> table and updating). However from my understanding even if I did use
> InnoDB that the Perl DBI stuff will still only execute it one at a
> time.
> Does anyone have any idea on how I would go about doing this?


There are multiple ways of doing this, you'll probably find some
examples around (LJ auth comes to mind, and there is probably more) of
processing these blocking requests in another process, using gearman.
In this scenario Djabberd instanciates non-blocking Gearman Clients
talking to Gearmand. And this or (those) Gearman server delegates the
work to Gearman workers (yet another processe(s)). When the job is done
geamand asynchonously notifies Djabberd which in the meantime did
other stuff.


More information about the Djabberd mailing list