阿良
2022 年8 月 26 日 15:25
#1
【 使用环境 】测试环境
【 OB or 其他组件 】OB
【 使用版本 】3.1.4
【问题描述】我使用sysbench做压测,开启512个线程,直连obproxy可以正常测试,但是使用Nginx转发就不得行了,nginx在500个线程的时候还可以正常跑,512就出现异常: error 2013: Lost connection to MySQL server at ‘handshake: reading initial communication packet’
【附件】
obproxy直连测试
nginx测试
nginx配置
当前租户的一些配置
宁封
2022 年8 月 26 日 15:34
#3
nginx 测试的时候,observer会有什么报错吗
阿良
2022 年8 月 26 日 15:35
#4
nginx做测试的时候,报错就是上面那个,在只开500个线程的时候没有报错
宁封
2022 年8 月 26 日 15:37
#5
error 2013: Lost connection to MySQL server at ‘handshake: reading initial communication packet’
nginx 发包没有发全?
阿良
2022 年8 月 26 日 15:39
#6
有可能,我也根据这个错误,尝试去找答案,但是看了些配置,无果。OB这边是撑的起这些连接的,nginx这边也没找到哪里有配置限制这个连接数。所以就只能求助了。下面这个是500个连接nginx正常的测试
君野
2022 年8 月 26 日 16:02
#7
可以试试调大下nginx的proxy_read_timeout、proxy_send_timeout
阿良
2022 年8 月 26 日 16:15
#8
nginx的stream里不支持这俩配置
我把参数里timeout相关的都调整到300s,但依然还是原来的报错,没有等到300s
君野
2022 年8 月 26 日 16:58
#9
可以再试试调整下OBProxy 前端连接数参数 max_connections
和 client_max_connections
,参考https://www.oceanbase.com/docs/community/tutorials-cn/V1.0.0/10000000000012280#title-63c-vcb-f99
君野
2022 年8 月 29 日 17:42
#11
阿良
2022 年8 月 30 日 10:12
#12
大佬,从nginx查找到了原因,是worker_rlimit_nofile没有配置,采用的是默认值512,所以出现这个问题,把worker_rlimit_nofile调高就好了。感谢大佬帮助
1 个赞