1. 首页
  2. 主题
  3. Go问与答

开启大概1000个协程,每个协程里面都发送一个post请求,但是大部分请求都报socket错误

golang_gc · · 2286 次点击
错误如下: dial tcp: lookup api.weixin.qq.com on 183.60.83.19:53: dial udp 183.60.83.19:53: socket: too many open files
socket: too many open files 很显然
#2
更多评论
可能与ulimit有关,你的系统是不是redhat或centos?该系统默认的文件句柄比较少,你可以用ulimit -a 查看
#1
ulimit -n 204800 再试下
#3

用户登录

没有账号?注册

今日阅读排行

    加载中

一周阅读排行

    加载中