对服务器硬件、软件进行测试,本文仅仅是一个开端,等以后有时间会给出一些更科学的测试结果。
测试系统环境: pc机, windows xp sp2
cpu:amd athlon(tm) 64 processer 3000+ 1.80ghz
内存:1.00gb
硬盘:7200转
数据库:mysql 5.0.17
数据库引擎:innodb, max connection:2000
测试工具:microsoft web application stress tool 1.1
测试模拟环境:200 users, 20 stress multiper(sockets per thread), 60 seconds
测试代码说明:
mysql的表结构:
create table tt (
id text;
);
string url="jdbc:mysql://localhost/test?user=root&password=mysql";
class.forname("com.mysql.jdbc.driver").newinstance();
connection connection=drivermanager.getconnection(url);
statement statement = connection.createstatement();
string sql="select * from tt";
int dd = statement.executeupdate("insert into tt values(’you are my angel’)");
out.println("insert::::" + dd + "<br>");
resultset rs = statement.executequery(sql);
resultsetmetadata rmeta = rs.getmetadata();
int numcolumns=rmeta.getcolumncount();
rs.next();
out.print("result:: " + rs.getstring(1)+" ");
out.print("<br>");
rs.close();
statement.close();
connection.close();
%>
服务器:weblogic 9.1
测试结果:平均每秒钟响应14.71个请求,总共响应882个请求
内存占用约:335mb
tool reports:
================================================================================
================================================================================
report name: 12/30/2005 11:15:36 am weblogic 250-u 20-thread
run on: 12/30/2005 11:15:36 am
run length: 00:01:00
web application stress tool version:1.1.293.1
number of test clients: 1
number of hits: 882
requests per second: 14.71
socket statistics
--------------------------------------------------------------------------------
socket connects: 902
total bytes sent (in kb): 240.83
bytes sent rate (in kb/s): 4.02
total bytes recv (in kb): 209.48
bytes recv rate (in kb/s): 3.49
socket errors
--------------------------------------------------------------------------------
connect: 0
send: 0
recv: 0
timeouts: 0
rds results
--------------------------------------------------------------------------------
successful queries: 0
script settings
================================================================================
server: localhost
number of threads: 20
test length: 00:01:00
warmup: 00:00:00
cooldown: 00:00:00
use random delay: no
follow redirects: yes
max redirect depth: 15
clients used in test
================================================================================
localhost
clients not used in test
================================================================================
result codes
code description count
================================================================================
200 ok 882
page summary
page hits ttfb avg ttlb avg auth query
================================================================================
get /ttg/dbtest.jsp 882 1320.73 1321.09 no no
服务器:jbossas-4.0.3 sp1
测试结果:平均每秒钟响应22.88个请求,总共响应1374个请求
内存占用约:165mb
tool reports:
================================================================================
================================================================================
report name: 12/30/2005 11:10:08 am jboss 250-u 20-thread
run on: 12/30/2005 11:10:08 am
run length: 00:01:00
web application stress tool version:1.1.293.1
number of test clients: 1
number of hits: 1374
requests per second: 22.88
socket statistics
--------------------------------------------------------------------------------
socket connects: 1394
total bytes sent (in kb): 378.45
bytes sent rate (in kb/s): 6.30
total bytes recv (in kb): 440.74
bytes recv rate (in kb/s): 7.34
socket errors
--------------------------------------------------------------------------------
connect: 0
send: 0
recv: 0
timeouts: 0
rds results
--------------------------------------------------------------------------------
successful queries: 0
script settings
================================================================================
server: localhost
number of threads: 20
test length: 00:01:00
warmup: 00:00:00
cooldown: 00:00:00
use random delay: no
follow redirects: yes
max redirect depth: 15
clients used in test
================================================================================
localhost
clients not used in test
================================================================================
result codes
code description count
================================================================================
200 ok 1374
page summary
page hits ttfb avg ttlb avg auth query
================================================================================
get /dbtest.jsp 1374 847.70 847.71 no no
服务器:apache-tomcat-5.5.12
测试结果:平均每秒钟响应14.94个请求,总共响应897个请求
内存占用约:50mb
tool reports:
================================================================================
================================================================================
report name: 12/30/2005 11:12:55 am tomcat 250-u 20-thread
run on: 12/30/2005 11:12:55 am
run length: 00:01:00
web application stress tool version:1.1.293.1
number of test clients: 1
number of hits: 897
requests per second: 14.94
socket statistics
--------------------------------------------------------------------------------
socket connects: 917
total bytes sent (in kb): 232.34
bytes sent rate (in kb/s): 3.87
total bytes recv (in kb): 197.93
bytes recv rate (in kb/s): 3.30
socket errors
--------------------------------------------------------------------------------
connect: 0
send: 0
recv: 0
timeouts: 0
rds results
--------------------------------------------------------------------------------
successful queries: 0
script settings
================================================================================
server: localhost
number of threads: 20
test length: 00:01:00
warmup: 00:00:00
cooldown: 00:00:00
use random delay: no
follow redirects: yes
max redirect depth: 15
clients used in test
================================================================================
localhost
clients not used in test
================================================================================
result codes
code description count
================================================================================
200 ok 897
page summary
page hits ttfb avg ttlb avg auth query
================================================================================
get /ttg/dbtest.jsp 897 1305.27 1305.28 no no
服务器:websphere 6.0
测试结果:平均每秒钟响应23.04个请求,总共响应1384个请求
内存占用约:217mb
tool reports:
================================================================================
================================================================================
report name: 12/30/2005 1:50:31 pm websphere 250-u 20-thread
run on: 12/30/2005 1:50:31 pm
run length: 00:01:00
web application stress tool version:1.1.293.1
number of test clients: 1
number of hits: 1384
requests per second: 23.04
socket statistics
--------------------------------------------------------------------------------
socket connects: 1403
total bytes sent (in kb): 341.65
bytes sent rate (in kb/s): 5.69
total bytes recv (in kb): 293.80
bytes recv rate (in kb/s): 4.89
socket errors
--------------------------------------------------------------------------------
connect: 0
send: 0
recv: 0
timeouts: 0
rds results
--------------------------------------------------------------------------------
successful queries: 0
script settings
================================================================================
server: localhost
number of threads: 20
test length: 00:01:00
warmup: 00:00:00
cooldown: 00:00:00
use random delay: no
follow redirects: yes
max redirect depth: 15
clients used in test
================================================================================
localhost
clients not used in test
================================================================================
result codes
code description count
================================================================================
200 ok 1384
page summary
page hits ttfb avg ttlb avg auth query
================================================================================
get /ttg/dbtest.jsp 1384 848.31 848.32 no no
结论:
呵呵,pc上面说明的问题能有多少呢?一点点吧!
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器