如何检查我的应用程序的可扩展性

发布于 2024-08-06 01:49:18 字数 135 浏览 8 评论 0原文

我开发了一个应用程序,可以创建大量 PDF 并提供这些文件。 (其正常的 Servlet 缓冲服务)。

如何确保我的应用程序能够有效处理多个请求?是否有任何工具可用于测试负载/可扩展性/效率以及我的代码在当前服务器配置下处理多少个并行请求?

I have developed an application that will create lot of PDF's and serve those file.
(Its normal Servlet-Buffering serving).

How to make sure my application works efficient with multiple request? Is there any tool available to test the load/scalability/efficiency and how many parallel request does my code handle with the current server configuration?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

不一样的天空 2024-08-13 01:49:18

您可以使用负载测试器,例如 Tsung

You can use a load tester like Tsung

倚栏听风 2024-08-13 01:49:18

您应该考虑使用负载测试工具,例如 grinderjmeter. grinder 支持脚本编写,而 jmeter 可以让您将 junit 变成负载测试客户端。我个人喜欢 jmeter,因为它支持 junit 以及它良好的 GUI 控制和报告。 jmeter 开箱即用地支持http 和soap。此外,您可以编写自己的插件来满足您的自定义需求。

You should consider using load test tools like grinder or jmeter. grinder supports scripting while jmeter lets you turn junit into load test client. I personally like jmeter because of junit support and also its fine gui control and reporting. jmeter support http and soap out of the box. Additionally, you can write you own plugins to fit your custom needs.

深巷少女 2024-08-13 01:49:18

我还推荐 JMeter。您还可以记录浏览器的页面请求以创建 JMeter 测试(HTTP 代理服务器< /a>)。

I would also recommend JMeter. You can also record the page requests of your browser to create a JMeter test (HTTP Proxy Server).

东北女汉子 2024-08-13 01:49:18

您还应该有适当的监视工具来查看应用程序在负载下的行为。

一个好的开始是 jvisualvm,它位于最新的 Sun JDK 中。

You should also have surveillance tools in place to see how the application behaves under load.

A good start is jvisualvm which is in the latest Sun JDK.

沫尐诺 2024-08-13 01:49:18

您可以做的最简单的事情是 Apache 基准测试,如果您运行的是基于 Unix 的系统,或者附带了适用于 Windows 的 Apache Webserver 2.x,则该基准测试可能已经安装。

使用示例;

$ ab -n 1000 -c 20 http://www.google.com/

给我这个输出;

This is ApacheBench, Version 2.3 <$Revision: 655654 
gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        gws
Server Hostname:        www.google.com
Server Port:            80

Document Path:          /
Document Length:        218 bytes

Concurrency Level:      20
Time taken for tests:   1.826 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Non-2xx responses:      1000
Total transferred:      807000 bytes
HTML transferred:       218000 bytes
Requests per second:    547.55 [#/sec] (mean)
Time per request:       36.527 [ms] (mean)
Time per request:       1.826 [ms] (mean, across all concurrent requests)
Transfer rate:          431.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   12  14.7     10     337
Processing:    11   24  26.8     17     306
Waiting:       11   22  21.1     16     297
Total:         21   36  30.5     28     350

Percentage of the requests served within a certain time (ms)
  50%     28
  66%     36
  75%     39
  80%     41
  90%     45
  95%     54
  98%     93
  99%    253
 100%    350 (longest request)

The simplest thing you can do is Apache benchmark which is probably already installed if you're running a Unix based system or comes with Apache Webserver 2.x for Windows.

Example use;

$ ab -n 1000 -c 20 http://www.google.com/

Gives me this output;

This is ApacheBench, Version 2.3 <$Revision: 655654 
gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        gws
Server Hostname:        www.google.com
Server Port:            80

Document Path:          /
Document Length:        218 bytes

Concurrency Level:      20
Time taken for tests:   1.826 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Non-2xx responses:      1000
Total transferred:      807000 bytes
HTML transferred:       218000 bytes
Requests per second:    547.55 [#/sec] (mean)
Time per request:       36.527 [ms] (mean)
Time per request:       1.826 [ms] (mean, across all concurrent requests)
Transfer rate:          431.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   12  14.7     10     337
Processing:    11   24  26.8     17     306
Waiting:       11   22  21.1     16     297
Total:         21   36  30.5     28     350

Percentage of the requests served within a certain time (ms)
  50%     28
  66%     36
  75%     39
  80%     41
  90%     45
  95%     54
  98%     93
  99%    253
 100%    350 (longest request)
戏蝶舞 2024-08-13 01:49:18

Apachebench 是一个单线程工具。这意味着它将无法使 SMP 服务器(无论是多线程或多进程)饱和。

您应该考虑 weighttp,它使用 AB 语法(唯一的区别是 -t 4 表示使用 4 个工作线程而不是 4 秒测试)。

Apachebench is a single-thread tool. It means that it will not be able to saturate a SMP server (either muti-thread or multi-process).

You should rather consider weighttp, which is using the AB syntax (the only difference is that -t 4 means use 4 worker threads instead of a 4-second test).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文