首先你必须确定你的要求。喜欢的东西:
之后,我会建议做广泛的负载测试。创建基本(但接近现实生活)的服务器实现并开始测试。例如,
最初,您可以使用ab工具,然后切换到JMeter。
AB将产生类似如下:
ab -c 10 -n 100 http://www.xyz.com/
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.xyz.com (be patient).....done
Server Software: Apache-Coyote/1.1
Server Hostname: www.xyz.de
Server Port: 80
Document Path:/
Document Length: 3112 bytes
Concurrency Level: 10
Time taken for tests: 0.659 seconds
Complete requests: 100
Failed requests: 0
Broken pipe errors: 0
Total transferred: 367003 bytes
HTML transferred: 339208 bytes
Requests per second: 151.75 [#/sec] (mean)
Time per request: 65.90 [ms] (mean)
Time per request: 6.59 [ms] (mean, across all concurrent requests)
Transfer rate: 556.91 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 6
Processing: 8 63 144.6 12 514
Waiting: 8 63 144.7 12 513
Total: 8 64 144.8 12 514
Percentage of the requests served within a certain time (ms)
50% 12
66% 15
75% 19
80% 19
90% 491
95% 491
98% 512
99% 514
100% 514 (last request)
这可能有助于创造一个情节:
有,你可以与所有性能优化和调整继续,因为将有可能立即看到结果。
很可能你需要调整你的应用程序第一次,但在此之后,你有相当多的选项,包括以下内容:
- JVM调整(GC优化等)
- 连接器调谐
- 压缩
- NIO
- HTTP 1.1具体的东西
- 等
只要使用正确的方法,并开始做一些事情 - 这将需要一些时间。
编辑 Tomcat的调整技巧
坦率地说也有对这个话题这么多不同的文章:
没有100%的通用解决方案,你应该做深入调查自己
谢谢Renat。其实我以前看过ab。你有详细的调整点练习吗?问题是即使我拿到了基准,我仍然不知道从哪里开始调整 –
不客气,看到更新。我建议在每次创建构建时开始生成基准测试结果。 –