简体   繁体   English

Jmeter关闭TCP连接

[英]Jmeter closing tcp connections

I have a server written in Java using Netty, and I'm testing it using Jmeter. 我有一台使用Netty用Java编写的服务器,并且正在使用Jmeter对其进行测试。 What Jmeter is doing is every time it sends a request to the server, it sends it using a different port and different connection, not reusing the same TCP connection with the threads. Jmeter所做的是每次将请求发送到服务器时,它都使用不同的端口和不同的连接发送请求,而不是与线程重用相同的TCP连接。

As a sample I set up a test with 5 Threads with an infinite loop, and a timer of 1 second between requests. 作为示例,我设置了一个具有5个线程的无限循环测试,两次请求之间的计时器间隔为1秒。 It sends the requests, but doesn't reuse the connection and after that one second, it sends another request using a different port every time. 它发送请求,但不重用连接,一秒钟后,每次都使用不同的端口发送另一个请求。

Is there any way to make it so Jmeter reuses connections? 有什么方法可以使Jmeter重用连接吗?

First, make sure you enable the 'Re-use connection' checkbox. 首先,请确保启用“重新使用连接”复选框。 Then, take a look at TCP Sampler Config: http://jmeter.apache.org/usermanual/component_reference.html#TCP_Sampler_Config 然后,看一下TCP Sampler Config: http : //jmeter.apache.org/usermanual/component_reference.html#TCP_Sampler_Config

Also take a look at the following: jmeter tcpsampler - unchecked 'reuse connection' on 3.1 forces new connection? 还可以看一下以下内容: jmeter tcpsampler-3.1上未选中的“重用连接”会强制建立新连接吗?

Connections can be reused among samplers in the same thread but multiple thread groups sharing the same connection I don't think is possible. 可以在同一线程中的采样器之间重用连接,但是多个线程组共享同一连接,我认为这是不可能的。

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

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