fastos / fastsocket

Fastsocket is a highly scalable socket and its underlying networking implementation of Linux kernel. With the straight linear scalability, Fastsocket can provide extremely good performance in multicore machines. In addition, it is very easy to use and maintain. As a result, it has been deployed in the production environment of SINA.
GNU General Public License v2.0
3.76k stars 730 forks source link

Error "apr_socket_recv: Connection reset by peer (104)" using ab to test nginx #25

Closed cloudlander closed 9 years ago

cloudlander commented 9 years ago

我在CentOS6.5上成功安装了fastsocket, 但是用它启动nginx之后: LD_PRELOAD=/opt/fsocket/libfsocket.so nginx 再在另一台机器上用ab测试: ab -n 100000 -c 1000 http://node1/ 始终是这样的错误: apr_socket_recv: Connection reset by peer (104) 当不用LD_PRELOAD启动nginx时就不会有任何错误。 请教是哪个环节有问题呢? 谢谢

breezewoods commented 9 years ago

是否关闭accept_mutex?

在 2014年12月19日,下午4:51,cloudlander notifications@github.com 写道:

我在CentOS6.5上成功安装了fastsocket, 但是用它启动nginx之后: LD_PRELOAD=/opt/fsocket/libfsocket.so nginx 再在另一台机器上用ab测试: ab -n 100000 -c 1000 http://node1/ 始终是这样的错误: apr_socket_recv: Connection reset by peer (104) 当不用LD_PRELOAD启动nginx时就不会有任何错误。 请教是哪个环节有问题呢? 谢谢

— Reply to this email directly or view it on GitHub https://github.com/fastos/fastsocket/issues/25.

breezewoods commented 9 years ago

你的网卡是否支持RSS?还有提供一下出现异常时的dmesg输出?

cloudlander commented 9 years ago

worker_processor设置成1的时候有这个问题。 accept_mutex关闭后性能有明显提升27xxx -> 36xxx dmesg还是有些错误,不知是否正常: possible SYN flooding on port 80. Sending cookies. Fastsocket [CPU5][PID-113539] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883fae6b71c0 Fastsocket [CPU5][PID-113539] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883fae6b71c0 Fastsocket [CPU9][PID-113545] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883ff28e0580

breezewoods commented 9 years ago
  1. worker数量最好和cpu数量匹配
  2. Fastsocket已经彻底解决accept互斥问题,所以accept_mutex是多余的
  3. 这个dmesg的错误提示可以忽略

2014-12-22 9:35 GMT+08:00 cloudlander notifications@github.com:

worker_processor设置成1的时候有这个问题。 accept_mutex关闭后性能有明显提升27xxx -> 36xxx dmesg还是有些错误,不知是否正常: possible SYN flooding on port 80. Sending cookies. Fastsocket [CPU5][PID-113539] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883fae6b71c0 Fastsocket [CPU5][PID-113539] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883fae6b71c0 Fastsocket [CPU9][PID-113545] fsocket_spawn:1171 Spawn on a already spawned file 0xffff883ff28e0580

— Reply to this email directly or view it on GitHub https://github.com/fastos/fastsocket/issues/25#issuecomment-67794021.