关于tomcat并发的问题。

jobell 发布于 2011/06/29 16:57
阅读 1K+
收藏 0

我的服务器配置:
Intel(R) Core(TM)2 Quad CPU    Q8300  @ 2.50GHz
4G内存
nginx+tomcat配置。
并发100的情况下就开始频繁出错。
但是通过top查看内存和cpu使用率还是非常低。不知道是什么原因呢??

加载中
0
红薯
红薯
这个100%是应用程序的问题啦
jobell
jobell
经过统计,每个页面的响应时间还没有超过20ms呀。
0
SeekerLee
SeekerLee
什么错,jvm什么参数。
jobell
jobell
JAVA_OPTS='-Xms512m -Xmx512m'
0
jobell
jobell
哎呀,头疼呀。现在也不知道问题出在哪里了。

0
jobell
jobell
报的错误是form中的值丢了。在页面中取不到。
光石头
光石头
最好贴出错误......应该是你应用的问题,和容器没有关系
0
dy810810
dy810810
换resin试试
0
天天笑笑
天天笑笑
100个并发还是小意思的。
0
jobell
jobell
谢谢大家,找到问题点了。

现在我才用了两种压力测试。结果差距比较大。大家看看那个比较合适的。

[root@localhost ~]# webbench -c 300 -t 30 http://www.test.com/page/1.html

Webbench - Simple Web Benchmark 1.5

Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

 

Benchmarking: GET http://www.test.com/page/1.html

300 clients, running 30 sec.

 

Speed=56726 pages/min, 10523141 bytes/sec.

Requests: 28263 susceed, 100 failed.

 

[root@localhost ~]# ab -n 10000 -c 300 http://www.test.com/page/1.html

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Copyright 2006 The Apache Software Foundation, http://www.apache.org/

 

Benchmarking www.test.com (be patient)

Completed 1000 requests

Completed 2000 requests

Completed 3000 requests

Completed 4000 requests

Completed 5000 requests

Completed 6000 requests

Completed 7000 requests

Completed 8000 requests

Completed 9000 requests

Finished 10000 requests

 

 

Server Software:        nginx

Server Hostname:        www.test.com

Server Port:            80

 

Document Path:          /page/1.html

Document Length:        11300 bytes

 

Concurrency Level:      300

Time taken for tests:   48.240600 seconds

Complete requests:      10000

Failed requests:        5337

   (Connect: 0, Length: 5337, Exceptions: 0)

Write errors:           0

Total transferred:      114823750 bytes

HTML transferred:       112653810 bytes

Requests per second:    207.29 [#/sec] (mean)

Time per request:       1447.218 [ms] (mean)

Time per request:       4.824 [ms] (mean, across all concurrent requests)

Transfer rate:          2324.43 [Kbytes/sec] received

 

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    0   1.6      0      16

Processing:     2 1442 1638.2    686   10269

Waiting:        2 1442 1638.1    686   10269

Total:          2 1442 1639.1    686   10283

 

Percentage of the requests served within a certain time (ms)

  50%    686

  66%   2107

  75%   2281

  80%   2379

  90%   2799

  95%   4473

  98%   5761

  99%   8903

 100%  10283 (longest request)

ab的测试怎么会有那么多的失败请求呢??

 

0
jobell
jobell
我不知道该相信那个结果了。
0
jobell
jobell
再顶顶
返回顶部
顶部