The page contains an experimental patch to enable Kernel Poll for the Erlang interpreter on Linux 2.6 based systems. Use at your own risk.
For Erlang programs that maintain many persistent network connections, the main limiting factor becomes the poll() system call used to determine which network connections have data. The overhead of poll() increases as O(N).
The Erlang interpreter can be compiled to support faster polling interfaces, but none of these are provided with Linux 2.6. Linux 2.6 has a faster polling interface -- epoll. (See epoll(2), epoll_create(2), epoll_ctl(2), and epoll_wait(2)). This patch adds support for the Erlang interpreter to use the epoll interface. This results much greater performance for erlang processes which hold open many network connections.
Instructions:
Download the erlang OTP source code: otp_src_R11B-1.tar.gz
$ wget http://www.erlang.org/download/otp_src_R11B-1.tar.gzDownload the epoll patch: otp_src_R11B-1_epoll.patch
$ wget http://developer.sipphone.com/ejabberd/erlang_epoll_patch/download/otp_src_R11B-1_epoll.patchUnpack the source:
$ tar zxvf otp_src_R11B-1.tar.gzApply the patch:
$ cd otp_src_R11B-1
$ patch -p1 < ../otp_src_R11B-1_epoll.patchConfigure with the --enable-kernel-poll option:
$ ./configure --enable-kernel-pollMake:
$ makeTest:
$ ./bin/erl +K trueInstall:
$ sudo make install
Notes:
Patches for older versions of OTP available here