libevent
Introduction
Prosody's core task is to handle multiple client or server connections, and handle incoming data from those connections. Monitoring lots of connections for incoming data efficiently isn't a trivial task, and although the standard POSIX API provides select() and poll() for this task, neither scale well for increasing connection counts.
To solve this problem and help people write efficient scalable servers that could make the most of the system's CPU time, many alternative methods started appearing - for example Linux gained 'epoll' and BSD gained 'kqueue'. To avoid having server developers work to add support for each method to their application libevent was created - a library to provide a standard interface across all the different connection monitoring mechanisms.
In 0.7 Prosody gained optional support for libevent, but still uses select() by default which is still adequate for most servers and requires no additional libraries.
Enabling the libevent backend
luaevent
First of all you need to install luaevent-prosody, a library allowing access to libevent from Lua applications.
You can find the luaevent-prosody source in this repository and you can grab a tarball of the latest release, luaevent-prosody 0.1.1. Users on Debian, Ubuntu and derived systems can find the liblua5.1-event-prosody0 package in our repository.
For more information on obtaining luaevent-prosody on other platforms, see our dependencies page.
Configuration
Next you simply need to add the following line to your configuration file, in the global section:
use_libevent = true
Restart Prosody and enjoy!
