简体   繁体   English

getsockopt:连接超时

[英]getsockopt: connection timed out

I rewrite my project from python tornado to go(use iris framework). 我将我的项目从python龙卷风重写为go(使用iris框架)。 The basic function tested ok. 基本功能测试OK。 When I test under high concurrence.the app always stops a while and then comes out the errors: 当我在高并发性下进行测试时,该应用程序总是会停一会儿然后出现错误:

(dial tcp 192.168.1.229:6543: getsockopt: connection timed out)

the 6543 port is the postgresql port used with pgbouncer...the pgbouncer and postgresl process runs Ok. 6543端口是用于pgbouncer的postgresql端口... pgbouncer和postgresl进程运行正常。

Also, I find that the memcache connect time out sometimes(the memcache process is still working). 另外,我发现内存缓存有时会超时(内存缓存进程仍在工作)。

Does this happen because too many connections? 是否因为连接过多而发生? Or some connections not closed on time? 还是某些连接未按时关闭? How can I avoid this problem? 如何避免这个问题?

Check your PgBouncer config . 检查您的PgBouncer配置 Try to increase max_client_conn option. 尝试增加max_client_conn选项。 Then experiment with concurrency level and requests count during stress test. 然后在压力测试期间尝试并发级别和请求计数。 Another possible issue can be that you don't return connections to pool. 另一个可能的问题是您不将连接返回池。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM