-
Notifications
You must be signed in to change notification settings - Fork 114
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
高并发下遇到的问题 #365
Comments
对于“在我使用jmeter进行压力测试的时候,一开始还好好的,但是到了后面就发生了异常,报错内容为EOF。” 我理解下,你的服务端是goalng 写的http服务,使用jmeter进行压力测试,里面有段代码是用gout进行了转发?压力太多,出现EOF的问题? |
是的,场景是这个场景,我仔细描述下就是,使用gin框架搭建的http服务,其中是需要调用其他的web服务端,所以中间是使用了gout进行了http的请求。后来用jmeter进行压力测试的时候,并发数量在70的时候,大概在几万次请求的时候就会出现eof的问题 |
gout请求的服务端也是golang写的吗?还是nginx的? |
gout请求的服务端在测试中是使用的java的springboot的web项目,但是在未来的需求中是不确定的 |
eof一般是对端关闭连接。往这个思路走,你可以先控制下变量,比如jmeter直接压springboot有没有这个现象。 上面提的req.close = true 不建议使用,会让http 1.1的协议会退化成http 1.0一个tcp一个http连接(http 2.0没试过)。对服务端或者客户端来说会占用更多的tcp资源。 |
你修改下gout代码,先开大http client的连接池个数。试下可有改善。 gout.New(&dataflow.DefaultBenchClient).POST(config.Url).
SetProxy(config.Proxy).
SetTimeout(30 * time.Second).
Debug(true).
SetHeader(head).
Code(&request.ResultCode).
SetBody(&request.ResultBody).
Do() |
@zedfaker 好了吗? |
不好意思,测试环境有别的问题,暂时还没有解决环境问题,我这边如果有结论了会第一时间和你联系的 |
进行压力测试时发生的问题
在我使用jmeter进行压力测试的时候,一开始还好好的,但是到了后面就发生了异常,报错内容为EOF。
示例代码如下:
在网上寻求帮助时,可能是因为服务器关闭连接的时候又接收到新的请求,导致此次请求被服务器拒绝而失败。当时他给出的解决方案是设置request的close属性为true,例:req.close = true。
所以,我想请问下,使用gout包的时候,如何解决这个问题。
The text was updated successfully, but these errors were encountered: