Kernel Poll on ejabberd
来源:互联网 发布:windows防火墙功能 编辑:程序博客网 时间:2024/05/21 15:05
Support in Erlang/OTP
Several implementations of Kernel Poll are supported since Erlang/OTP R11B-3:
- FreeBSD (kqueue)
- Linux 2.4 (/dev/kpoll)
- Linux 2.6 (/dev/epoll)
- Solaris (/dev/poll)
How to enable Kernel Poll on an Erlang/OTP node
When starting an Erlang node, by default Kernel Poll is disabled:
$ erl
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
1> q().
ok
To start an Erlang node with Kernel Poll support, you have to provide this argument:
$ erl +K true
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:true]
Eshell V5.7.5 (abort with ^G)
1> q().
ok
If Erlang or your system does not support Kernel Poll, this would report an error.
Check the performance tuning page for more details.
How to enable Kernel Poll on ejabberd
ejabberd starts Erlang with Kernel Poll enabled by default: the script ejabberdctl starts the Erlang node with the argument mentioned previously. You can disable this by editing the file ejabberdctl.cfg and setting this line:
POLL=false
To know if your configuration will work as you expect, you can start ejabberd in Live mode. This way it will show at the beginning whether Kernel Poll is being used or not. This is the result with the default configuration:
$ ejabberdctl live
--------------------------------------------------------------------
IMPORTANT: ejabberd is going to start in LIVE (interactive) mode.
All log messages will be shown in the command shell.
You can interact with the ejabberd node if you know how to use it.
Please be extremely cautious with your actions,
and exit immediately if you are not completely sure.
To exit this LIVE mode and stop ejabberd, press:
q(). and press the Enter key
--------------------------------------------------------------------
To bypass permanently this warning, add to ejabberdctl.cfg the line:
EJABBERD_BYPASS_WARNINGS=true
Press any key to continue
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:true]
Eshell V5.7.5 (abort with ^G)
(ejabberd@localhost)1>
=PROGRESS REPORT==== 15-Mar-2010::20:44:15 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.52.0>},
{name,alarm_handler},
{mfa,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
...
How much does it improve performance?
Kernel poll reduces ejabberd's CPU usage when it has hundreds (or more) network connections.
It does not affect memory consumption or latency, so if you plan to support great amounts of simultaneous connected users, you really want to have a Jabber server with Kernel Poll support.
An experiment was ran to compare ejabberd performance with and without Kernel Poll support.
The environment, tools, process and results are available on the Benchmark page, Test 3.
The next screenshot was taken during the experiment. It shows the ejabberd debug window, Jabsimul window and top. There are 3000 concurrent online users chatting and making roster changes. After 47 minutes of constant stress the ejabberd system process (beam) takes around 5% of CPU usage and nearly 200 megs of RAM.
- Kernel Poll on ejabberd
- ejabberd
- ejabberd
- linux kernel poll & 等待队列
- Linux kernel [select poll epoll]区别
- Linux kernel [select poll epoll]区别
- Update Kernel on EeePC
- Intel IOMMU on Linux kernel
- Andrew Morton on kernel development
- Linux Kernel 3.9 on Ubuntu
- [linux-kernel] 实现支持poll的驱动设备
- [linux-kernel] 实现支持poll的驱动设备
- Linux kernel 中的轮询操作-select poll
- How to install and configure Jabber Server (Ejabberd) on Debian Lenny GNU / Linux
- poll()
- poll
- poll
- poll
- C内存管理
- 嵌入式系统需掌握的基础知识
- 十个优秀的求职网站
- 成就DBA职业生崖
- 【模拟】【RQNOJ】图书馆书目检索
- Kernel Poll on ejabberd
- PHP调试环境搭建-Zend Debugger安装
- 关于IFRMAE访问引用页面的元素
- 页面自动刷新或跳转--说明
- BIOS的磁盘读取
- MSDN的快捷方式
- C语言字节对齐详解
- 吹尽黄沙始见金,历述CPU架构与工艺
- c# 动态改变panel大小的问题