SinnerA / spserver

Automatically exported from code.google.com/p/spserver
Other
0 stars 0 forks source link

IOCP echo max connect is 3963 #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
用下载的代码反复测试,在windows下只能连接3962次,下一次就提�
��失败.echo server
设定的最大连接数是2万,还差的远呢.

Original issue reported on code.google.com by tigershi...@gmail.com on 9 Jun 2009 at 6:14

GoogleCodeExporter commented 9 years ago
    //Warning: This modifies your operating system. Use it at your own risk.
    //IncreaseConnections();

启用上面这一句注释掉的代码,再试试看

Original comment by stephen....@gmail.com on 9 Jun 2009 at 6:19

GoogleCodeExporter commented 9 years ago
注释掉了,现在是3951
我发现,echo 
server是等客户端断开后,才出现大量的调试数据,我怀疑问题在
这里,如果connect
的同时就输出日志,处理close,应该会提高连接数.

Original comment by tigershi...@gmail.com on 9 Jun 2009 at 7:33

GoogleCodeExporter commented 9 years ago
用来连接 server 的程序是哪个?是什么样一个逻辑?

Original comment by stephen....@gmail.com on 9 Jun 2009 at 7:35

GoogleCodeExporter commented 9 years ago
testiocpecho做server
testiocpstress做client
在client中,修改一个最大连接数,我选的是2万,然后连接testiocpec
ho.我机器一般在3962出错,
提示socket 10055错误 
(由于系统缓冲区空间不足或列队已满,不能执行套接字上的�
��作).
client也改动一下,connect成功后,马上close,理论上讲不会占资源.

Original comment by tigershi...@gmail.com on 9 Jun 2009 at 8:38

GoogleCodeExporter commented 9 years ago
出现 10055 这种错误,测试机器的配置是怎么样的?
之前用 512M 内存的机器测试,大概能到 5K 的并发连接。

Original comment by stephen....@gmail.com on 9 Jun 2009 at 9:03

GoogleCodeExporter commented 9 years ago
cpu e2180,内存1G
MS出的网络编程2一书上面有各种模型的测试数据,完成端口同�
��连接5万,成功在49000以上.机器是P4.
如果现在只能5K,是不是libevent这个模型本身还有可以提高的地
方?

Original comment by tigershi...@gmail.com on 9 Jun 2009 at 9:13

GoogleCodeExporter commented 9 years ago
出现 10055 的错误,主要是和系统的资源有关。可以尝试把 
IncreaseConnections 函数里的参
数改大一些。

ps: spserver 在 windows 平台用的不是 libevent ,而是从头用 iocp 
实现的。

ps2: 在 spserver 的主页也提供了一个支持 iocp 的 libevent 
,里面也有一个 echo 程序。也
可以拿这个来测试一下。

Original comment by liusi...@gmail.com on 10 Jun 2009 at 6:10

GoogleCodeExporter commented 9 years ago
感謝作者的大方提供,小弟找iocp 
lib很久了,不過用testiocpecho測試後發現一個問題是CPU
loading飆到99%~100%,比C++ Builder附的echo server 
vcl元件還差(該元件最多也沒超過
50%),如果需要的話我可以提供測試程式。

Original comment by lee.pion...@gmail.com on 13 Oct 2009 at 3:46

GoogleCodeExporter commented 9 years ago
pioneer 用的测试程序是什么程序?spserver 
自带的,还是重新实现过的?
如果是重新实现过的,那么有针对 spserver 
自带的程序进行测试么?

Original comment by stephen....@gmail.com on 14 Oct 2009 at 3:31