JMeter,Jetty性能测试和Keep

编程入门 行业动态 更新时间:2024-10-27 21:11:26
JMeter,Jetty性能测试和Keep-Alive问题(JMeter, Jetty Performance test and Keep-Alive issues)

好的,所以我创建了一个非常简单的WAR,它提供了一个简单的Hello World .jsp。 使用所有HTML大约200字节。

在我的服务器上部署它运行Jetty 7.5.x jdk 6u27在我的客户端计算机上创建简单的JMeter测试计划:线程组,HTTP请求,响应断言,摘要报告客户端也运行jdk6u27

我将线程组设置为5个线程运行60秒,我得到5800个请求/秒然后我设置10个线程并获得6800个请求/秒

我在HTTP请求采样器上禁用JMeter中的Keep-Alive的那一刻。 我想客户端似乎有很多大停顿,看起来服务器似乎没有收到任何东西。 我得到的停顿时间少于5个线程或几乎没有,但是在10个线程中它几乎一直挂起。

这究竟是什么意思?

请记住,我在技术上创建了一个REST服务,我遇到了同样的问题,所以我可能在我的服务中做了一些时髦的事情,直到我发现它是一个Keep-Alive问题因为它几乎在staic网络应用程序。 所以实际上我将有1个客户端请求1服务器响应。 客户端不会保持连接打开。

Ok, so I created a very simple WAR which serves a simple Hello World .jsp. With all the HTML it's about 200bytes.

Deployed it on my server running Jetty 7.5.x jdk 6u27 On my client computer create simple JMeter test plan with: Thread Group, HTTP Request, Response Assertion, Summary Report Client also running jdk6u27

I set up the thread group to 5 threads running for 60secs and I got 5800 requests/sec Then I setup 10 threads and got 6800 requests/sec

The moment I disable Keep-Alive in JMeter on the HTTP Request sampler. I seem to get lots of big pauses on the client side I suppose, it doesn't seem the server is receiving anything. I get less pauses at 5 threads or barely none but at 10 threads it hangs pretty much all the time.

What does this mean exactly?

Keep in mind I'm technically creating a REST service and I was getting the same issue, so I though maybe I was doing something funky in my service, till I figured out it's a Keep-Alive issue as it's doing it pretty much on a staic web app. So in reality I will have 1 client request 1 server response. The client will not be keeping the connection open.

最满意答案

我的猜测是,由于Keep-Alive是允许HTTP连接(从而套接字)重用的原因,因此可用的短暂端口号很少 - 只有64k端口号,并且由于连接必须具有唯一的客户端/服务器端口组合(和服务器端口是固定的),你可以快速通过那些。 现在,如果一方连接关闭后端口可以重复使用,那就不重要了;但是,根据TCP规范,双方必须等待可配置的时间(默认值:2分钟),直到重用被认为是安全的。

有关更多详细信息,您可以阅读TCP书籍(如“史蒂文斯书”); 以上是一种简化。

My guess is that since Keep-Alive is what allows HTTP Connection (and thereby, socket) reuse, you are running out of available ephemeral port numbers -- there are only 64k port numbers, and since connections must have unique client/server port combos (and server port is fixed), you can quickly go through those. Now, if ports were reusable as soon as connection was closed by one side, it would not matter: however, as per TCP spec, both sides MUST wait for configurable amount of time (default: 2 minutes) until reuse is considered safe.

For more details you can read a TCP book (like "Stevens book"); above is a simplification.

更多推荐

本文发布于:2023-07-30 06:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1336688.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:性能测试   JMeter   Jetty

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!