Erlang的最大同时打开端口数是多少? [英] Erlang's maximum number of simultaneous open ports?

查看:239
本文介绍了Erlang的最大同时打开端口数是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

erlang TCP/IP库是否有某些限制?我已经做了一些搜索,但是找不到任何明确的答案.

Does the erlang TCP/IP library have some limitations? I've done some searching but can't find any definitive answers.

我已将ERL_MAX_PORTS环境变量设置为12000,并将Yaws配置为使用无限连接.

I have set the ERL_MAX_PORTS environment variable to 12000 and configured Yaws to use unlimited connections.

我编写了一个简单的客户端应用程序,该应用程序连接到我为Yaws编写的appmod上,并且正在通过同时启动X个客户端数量来测试同时连接的数量.

I've written a simple client application that connects to an appmod I've written for Yaws and am testing the number of simultaneous connections by launch X number of clients all at the same time.

我发现当我到达约100个客户端时,Yaws服务器停止接受更多的TCP连接,并且客户端错误显示为

I find that when I get to about 100 clients, the Yaws server stops accepting more TCP connections and the client errors out with


Error in process  with exit value: {{badmatch,{error,socket_closed_remotely}}

我知道打开的并发连接数必须有一个限制,但是100个看起来确实很低.我仔细阅读了所有的Yaws文档,并删除了对连接的任何限制.

I know there must be a limit to the number of open simultaneous connections, but 100 seems really low. I've looked through all the yaws documentation and have removed any limit on connections.

这是在运行Snow Leopard的2.16Ghz Intel Core 2 Duo iMac上.

This is on a 2.16Ghz Intel Core 2 Duo iMac running Snow Leopard.

在Vista机器上进行的快速测试显示,在大约300个连接处,我也遇到了同样的问题.

A quick test on a Vista Machine shows that I get the same problems at about 300 connections.

我的考试不合理吗? IE.同时打开100个以上的连接以测试Yaws的并发性是愚蠢的吗?

Is my test unreasonable? I.e. is it silly to open 100+ connections simultaneously to test Yaws' concurrency?

谢谢.

推荐答案

尝试了所有人的建议并仔细阅读了Erlang文档后,我得出的结论是我的问题是Yaws无法跟上负载

After trying out everybody's suggestion and scouring the Erlang docs, I've come to the conclusion that my problem is with Yaws not being able to keep up with the load.

在同一台机器上,Apache Http Components Web服务器(非阻塞I/O)在以相同阈值处理连接时不会遇到相同的问题.

On the same machine, an Apache Http Components web server (non-blocking I/O) does not have the same problems handling connections at the same thresholds.

感谢您的所有帮助.我将继续使用其他基于erlang的Web服务器,例如Mochiweb.

Thanks for all your help. I'm going to move on to other erlang based web servers, like Mochiweb.

这篇关于Erlang的最大同时打开端口数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆