Network backends

Prosody ships with several alternative modules for keeping track of network connections, reading incoming data when available and sending outgoing data when appropriate.

select

The original network backend is called net.server_select. It needs only LuaSocket to work. It uses the select() system call, is suitable for smaller servers. It has bad scaling properties and a limit of 1024 connections.

To use this backend, add the following in the global section of the config:

network_backend = "select"

libevent

The first alternative network backend, net.server_event introduced with Prosody 0.7 uses the luaevent binding of the libevent event notification library to handle connections.

See documentation on using Prosody with libevent.

To use this backend, add the following in the global section of the config:

network_backend = "event"

epoll

First available in Prosody 0.11, net.server_epoll uses the included util.poll library to keep track of connections. It has been written from scratch to be easier to maintain, without having external dependencies. Despite the name it is not bound to the Linux epoll API, but uses an abstraction that can also use the POSIX poll1 or the select() APIs.

Starting with 0.12.0 this is the default, so no configuration is required to use it. If you enjoy explicit configuration, you can add the following in the global section of the config:

network_backend = "epoll"

  1. starting with 0.12.0↩︎