|
对服务器硬件、软件进行测试,本文仅仅是一个开端,等以后有时间会给出一些更科学的测试结果。
测试系统环境: 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
测试代码说明:
因小弟用pc测试,程序和数据库都较为简单,
mysql的表结构: CREATE TABLE tt ( id text; );
用来测试的jsp程序: <%
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上面说明的问题能有多少呢?一点点吧!
|