-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
异步tcp服务端 链接不稳定 #3707
Comments
[自动回复] 为了中文搜索引擎收录以便于后人检索和Github各国友人参与理解所需,本repo只接受英文issue 中文issue请前往Swoole中文问答社区 谢谢合作! |
请检查你的 ulimit -n 配置 或者 max_connection 配置 是否过小 |
谢谢峰哥; 代码里面没有设置max_connection 配置,linux系统值为1048576 |
可以从 swoole log_file 寻找有没有可疑的错误信息 |
[2020-09-25 17:31:29 #298.4] INFO Server is shutdown now 嗯,日志里面只有关闭 服务的记录,记录日志的级别是默认的 |
通过 strace 和 tcpdump 抓包分析 |
客户端在这个时间控制台有这个警告[2020-09-29 09:17:42 *32.0] WARNING swSignalfd_onSignal (ERRNO 707): Unable to find callback function for signal Broken pipe: 13 编号为3 的包 客户端发送的 RST类型的No. Time Source Destination Protocol Length Info Frame 1: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) No. Time Source Destination Protocol Length Info Frame 2: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) No. Time Source Destination Protocol Length Info Frame 3: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) No. Time Source Destination Protocol Length Info Frame 4: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) No. Time Source Destination Protocol Length Info Frame 5: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) No. Time Source Destination Protocol Length Info Frame 6: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) No. Time Source Destination Protocol Length Info Frame 7: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) No. Time Source Destination Protocol Length Info Frame 8: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) No. Time Source Destination Protocol Length Info Frame 9: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) |
1. What did you do? If possible, provide a simple script for reproducing the error.
tcp连接抓包内容:
https://qfx.oss-cn-shenzhen.aliyuncs.com/pdf/1601200014(1).png
https://qfx.oss-cn-shenzhen.aliyuncs.com/pdf/bf5adfca84c81e6751d96d62f7d1a98.png
tcp服务端代码:
2. What did you expect to see?
这种问题该如何规避和优化
3. What did you see instead?
异步tcp服务端 链接不稳定 ,100左右的并发下 即使使用连接池连接经常被重置或者被拒绝,没有并发的时候偶尔会出现
4. What version of Swoole are you using (show your
php --ri swoole
)?swoole
Swoole => enabled
Author => Swoole Team [email protected]
Version => 4.4.18
Built => Aug 11 2020 11:54:51
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1d 10 Sep 2019
http2 => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
5. What is your machine environment used (show your
uname -a
&php -v
&gcc -v
) ?Linux bb2e3a769840 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 GNU/Linux
PHP 7.2.33 (cli) (built: Aug 6 2020 22:31:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
The text was updated successfully, but these errors were encountered: