论坛首页 综合技术论坛

erlang的IO高效不是传说

浏览 3069 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-12-07  
[root@haserver ~]# erl -smp +K true
Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:true]

Eshell V5.6.5  (abort with ^G)
1> erlang:system_info(check_io).
[{name,erts_poll},
{primary,epoll},
{fallback,poll},
{kernel_poll,epoll},
{memory_size,9064},
{total_poll_set_size,2},
{fallback_poll_set_size,0},
{lazy_updates,true},
{pending_updates,0},
{batch_updates,false},
{concurrent_updates,true},

{max_fds,1024}]

erl_poll.c是erlang的poll实现。对epoll的lazy update和concurrent_update进行了大量的优化,batch update在freebsd下管用。我讲过的框架包括libevent,ACE,haproxy等等。只有haproxy进行了lazy update但是没有concurrent方面的努力。

erlang的IO读写大多采用gather write, scatter read 方式,在语法方面就有强大的优势,列表操作隐含的就是这个语义。

致敬,多年前就这门挖空心思高性能!


论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics