指环王-内测8月25日中午12:58正式开启!
[ 2009/08/25 11:30 | by selboo ]
各位亲爱的玩家:
《指环王Online》不删档内测于明日(8月25日)中午12:58正式启动!
《指环王Online》四个游戏大区:电信一区、电信二区、网通一区、网通二区,正式与各位中土的勇士们见面!
8月25日12:58第一批开放区组:
【电信一区】
· 秘银之惑 · 安都瑞尔 · 杜林之门 · 梵贡森林
【电信二区】
· 卡恩杜姆
【网通一区】
· 金色萝林 · 罗翰隘口
【网通二区】
· 莫里亚深渊
同时,“挑战指环王,畅游新西兰”的活动将于开服当日开启。8月25日当日开启的所有服务器,每组服务器中第一个满级的玩家,将可获得双飞新西兰的机会,体验魔戒三部曲电影的恢宏场景。
挑战指环王,畅游新西兰,立即 >>>>点击加入<<<<
中土的勇士们,战斗的时刻到了,让我们一同踏上护戒征程!
已经注册CDC Games通行证的玩家,请您 >>>>点击登陆<<<< CDC Games账号管理中心,激活游戏分区(激活游戏分区无须任何激活码);
还未注册CDC Games通行证的玩家,请先 >>>>点击注册<<<< CDC Games通行证,同时激活游戏分区(激活游戏分区无须任何激活码);
还没有安装客户端的玩家,请下载完整客户端 >>>>点击下载<<<<
客户端安装常见问题,请 >>>>点击查看<<<<
《指环王Online》官方网站:http://lotro.cdcgames.net/
《指环王Online》官方论坛:http://bbs.lotro.cdcgames.net
官方宣传视频
Flash Player文件
下载观看
《指环王Online》中国运营团队
2009年8月24日
《指环王Online》不删档内测于明日(8月25日)中午12:58正式启动!
《指环王Online》四个游戏大区:电信一区、电信二区、网通一区、网通二区,正式与各位中土的勇士们见面!
8月25日12:58第一批开放区组:
【电信一区】
· 秘银之惑 · 安都瑞尔 · 杜林之门 · 梵贡森林
【电信二区】
· 卡恩杜姆
【网通一区】
· 金色萝林 · 罗翰隘口
【网通二区】
· 莫里亚深渊
同时,“挑战指环王,畅游新西兰”的活动将于开服当日开启。8月25日当日开启的所有服务器,每组服务器中第一个满级的玩家,将可获得双飞新西兰的机会,体验魔戒三部曲电影的恢宏场景。
挑战指环王,畅游新西兰,立即 >>>>点击加入<<<<
中土的勇士们,战斗的时刻到了,让我们一同踏上护戒征程!
已经注册CDC Games通行证的玩家,请您 >>>>点击登陆<<<< CDC Games账号管理中心,激活游戏分区(激活游戏分区无须任何激活码);
还未注册CDC Games通行证的玩家,请先 >>>>点击注册<<<< CDC Games通行证,同时激活游戏分区(激活游戏分区无须任何激活码);
还没有安装客户端的玩家,请下载完整客户端 >>>>点击下载<<<<
客户端安装常见问题,请 >>>>点击查看<<<<
《指环王Online》官方网站:http://lotro.cdcgames.net/
《指环王Online》官方论坛:http://bbs.lotro.cdcgames.net
官方宣传视频
![](template/digiart1/images/swf.gif)
下载观看
《指环王Online》中国运营团队
2009年8月24日
MySQL的性能调优工具 tuning-primer.sh
[ 2009/08/23 13:17 | by selboo ]
wget http://www.day32.com/MySQL/tuning-primer.sh
chmod +x tuning-primer.sh
./tuning-primer.sh
chmod +x tuning-primer.sh
./tuning-primer.sh
![](template/digiart1/images/download.gif)
和mysqlreport一样,tuning-primer.sh也支持.my.cnf
[client]
user = USERNAME
password = PASSWORD
socket = /tmp/mysql.sock
样例输出:在终端上按照问题重要程度分别用黄色/红色字符标记问题
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.0.45 i686
Uptime = 19 days 8 hrs 32 min 54 sec
Avg. qps = 0
Total Questions = 264260
Threads Connected = 1
Server has been running for over 48hrs.
It should be safe to follow these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 264274 that take longer than 10 sec. to complete
Your long_query_time may be too high, I typically set this under 5 sec.
BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 1
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 1
Historic max_used_connections = 33
The number of used connections is 33% of the configured maximum.
Your max_connections variable seems to be fine.
MEMORY USAGE
Max Memory Ever Allocated : 96 M
Configured Max Per-thread Buffers : 268 M
Configured Max Global Buffers : 7 M
Configured Max Memory Limit : 276 M
Physical Memory : 1.97 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 8 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 1817
Key buffer fill ratio = 6.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere
QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size
SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
OPEN FILES LIMIT
Current open_files_limit = 1024 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
TABLE CACHE
Current table_cache value = 64 tables
You have a total of 125 tables
You have 64 open tables.
Current table_cache hit rate is 9%, while 100% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 564 temp tables, 6% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 1 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 0 : 264392
Your table locking seems to be fine
更有用是作者总结的处理MySQL性能问题处理的优先级:尤其是头3条,基本上可以解决大部分瓶颈问题的原因。
# Slow Query Log 慢查询 尤其是like操作,性能杀手,轻易不要使用,让全文索引交给Lucene或者利用Tag机制减少like操作;
# Max Connections 并发连接数:一个MySQL deamon缺省最大连接数是100,调到更高只是为了出现问题是给我们更多的缓冲时间而不是任其一直处于那么高的状态,并发连接数类似于等候大厅:当等候人数过多的时候,一味扩大等候厅不是根本解决问题的办法,提高业务的处理速度,多开几个窗口才是更好的解决方法;我的经验就是超过100: 数据就要想办法(镜像或者分片)分布到更多Deamon上;
# Worker Threads: Jeremy Zawondy 曾在部落格上說到:Thread caching 並不是我們最需要關心的問題,但當你解決了所有其他更嚴重的問題之後,它就會是最嚴重的問題。(thread caching really wasn't the worst of our problems. But it became the worst after we had fixed all the bigger ones.)
# Key Buffer
# Query Cache
# Sort Buffer
# Joins
# Temp Tables 临时表
# Table (Open & Definition) Cache 表缓存;
# Table Locking 表锁定
# Table Scans (read_buffer)
# Innodb Status
其他一些工具:
1 mytop: 一个top like的show processlist;
2 使用cacti做MySQL的监控:推荐配置模板;
3 把binlog导出成文本和slowquery的格式几乎是一样的,调用mysqlslowquery脚本分析,有时候也会有意外收获;
谢谢 oldplantegg 补充:
mysqlsla(hackmysql.com推出的一款日志分析工具该网站还维护了,mysqlreport, mysqlidxchk 等比较实用的mysql工具)能够分析slow query 和binlog等,这样就不用将binlog导出来了
Siege:压力模拟/测试工具
[ 2009/08/23 12:55 | by selboo ]
Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
最早使用的压力测试工具是apache的ab(apache benchmark),apache ab做重复压力测试不错,但是每次只能测试一个链接,如何测试一组链接(比如从日志中导出的1个小时的日志,做真实压力测试),后来找到了这个:
SIEGE is an http regressive testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress, to see how it will stand up to load on the internet. It lets the user hit a webserver with a configurable number of concurrent simulated users. Those users place the webserver “under siege.” The duration of the siege is measured in transactions, the sum of simulated users and the number of times each simulated user repeats the process of hitting the server. Thus 20 concurrent users 50 times is 1000 transactions, the length of the test.
下载/安装
Siege时一个开放源代码项目:http://www.joedog.org
下载:
wget ftp://sid.joedog.org/pub/siege/siege-latest.tar.gz
安装:
%./configure ; make
#make install
siege包含了一组压力测试工具:
SIEGE (1) Siege是一个HTTP压力测试和评测工具.
使用样例:
任务列表:www.chedong.com.url文件
http://www.chedong.com/tech/
http://www.chedong.com/tech/acdsee.html
http://www.chedong.com/tech/ant.html
http://www.chedong.com/tech/apache_install.html
http://www.chedong.com/tech/awstats.html
http://www.chedong.com/tech/cache.html
http://www.chedong.com/tech/click.html
http://www.chedong.com/tech/cms.html
http://www.chedong.com/tech/compress.html
http://www.chedong.com/tech/cvs_card.html
http://www.chedong.com/tech/default.html
http://www.chedong.com/tech/dev.html
http://www.chedong.com/tech/gnu.html
….
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.chedong.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
注意:由于速度很快,可能会达不到并发速度很高就已经完成。Response time显示的是测试机器和被测试服务器之间网络链接状况。Transaction rate则表示服务器端任务处理的完成速度。
辅助工具:
增量压力测试:
为了方便增量压力测试,siege还包含了一些辅助工具:
bombardment (1)
是一个辅助工具:用于按照增量用户压力测试:
使用样例:
bombardment urlfile.txt 5 3 4 1
初始化URL列表:urlfile.txt
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出成CSV格式:
siege2csv.pl (1)
siege2csv.pl将bombardment的输出变成CSV格式:
Time Data Transferred Response Time Transaction Rate Throughput Concurrency Code 200 (note that this is horribly broken.)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07 0.78
参考:
开源测试工具:http://www.opensourcetesting.org/performance.php
压力测试工具:HammerHead 正在试用中
最早使用的压力测试工具是apache的ab(apache benchmark),apache ab做重复压力测试不错,但是每次只能测试一个链接,如何测试一组链接(比如从日志中导出的1个小时的日志,做真实压力测试),后来找到了这个:
SIEGE is an http regressive testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress, to see how it will stand up to load on the internet. It lets the user hit a webserver with a configurable number of concurrent simulated users. Those users place the webserver “under siege.” The duration of the siege is measured in transactions, the sum of simulated users and the number of times each simulated user repeats the process of hitting the server. Thus 20 concurrent users 50 times is 1000 transactions, the length of the test.
下载/安装
Siege时一个开放源代码项目:http://www.joedog.org
下载:
wget ftp://sid.joedog.org/pub/siege/siege-latest.tar.gz
安装:
%./configure ; make
#make install
siege包含了一组压力测试工具:
SIEGE (1) Siege是一个HTTP压力测试和评测工具.
使用样例:
任务列表:www.chedong.com.url文件
http://www.chedong.com/tech/
http://www.chedong.com/tech/acdsee.html
http://www.chedong.com/tech/ant.html
http://www.chedong.com/tech/apache_install.html
http://www.chedong.com/tech/awstats.html
http://www.chedong.com/tech/cache.html
http://www.chedong.com/tech/click.html
http://www.chedong.com/tech/cms.html
http://www.chedong.com/tech/compress.html
http://www.chedong.com/tech/cvs_card.html
http://www.chedong.com/tech/default.html
http://www.chedong.com/tech/dev.html
http://www.chedong.com/tech/gnu.html
….
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.chedong.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
注意:由于速度很快,可能会达不到并发速度很高就已经完成。Response time显示的是测试机器和被测试服务器之间网络链接状况。Transaction rate则表示服务器端任务处理的完成速度。
辅助工具:
增量压力测试:
为了方便增量压力测试,siege还包含了一些辅助工具:
bombardment (1)
是一个辅助工具:用于按照增量用户压力测试:
使用样例:
bombardment urlfile.txt 5 3 4 1
初始化URL列表:urlfile.txt
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出成CSV格式:
siege2csv.pl (1)
siege2csv.pl将bombardment的输出变成CSV格式:
Time Data Transferred Response Time Transaction Rate Throughput Concurrency Code 200 (note that this is horribly broken.)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07 0.78
参考:
开源测试工具:http://www.opensourcetesting.org/performance.php
压力测试工具:HammerHead 正在试用中
Apache 压力测试
[ 2009/08/23 12:45 | by selboo ]
压力测试是一种基本的质量保证行为,它是每个重要软件测试工作的一部分。压力测试的基本思路很简单:不是在常规条件下运行手动或自动测试,而是在计算机数量较少或系统资源匮乏的条件下运行测试。通常要进行压力测试的资源包括内部内存、CPU 可用性、磁盘空间和网络带宽等。一般用并发来做压力测试。
1.apache安装
下载:
从Apache官方网站http://httpd.apache.org/download.cgi下载httpd-2.0.58.tar.gz。
安装:
先解压缩tar文件
tar -zxvf httpd-2.0.58.tar.gz
(1)./configure -prefix=/usr/local/apache2test -enable-so -enable-shared=max -with-mpm=worker -enable-deflate -enable-headers -enable-rewrite -enable-proxy -enable-proxy -enable-ssl -with-ssl=/path/to/install/openssl_0.97i -enable-modules=all && make && make install
(这是正式服务器上的apache2的编译参数,其中–with-mpm=worker –with-ssl=/path/to/install/openssl_0.97i可以根据实际情况做出修改)
然后安装php,并且在/usr/local/apache2test/conf目录下的httpd.conf里面的DSO支持之后加入
AddType application/x-httpd-php .php .phtml .html .htm
AddType application/x-httpd-php-source .phps
最后将测试的php网页文件添加到/usr/local/apache2test/htdocs目录下
(2) make
(3)make install
2.测试工具说明以及安装
ab:
ab是Apache超文本传输协议(HTTP)的性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能,主要是显示你安装的Apache每秒可以处理多少个请求;
概要:运行/usr/local/apache-install-path/bin/ab -help查看ab的具体命令选项;
命令选项-c concurrency 一次产生的请求个数。默认是一次一个。
-n requests 在测试会话中所执行的请求个数。 默认时,仅执行一个请求,但通常其结果不 具有代表意义
运行结果:主要要注意的是以下内容
Time taken for tests: 总共执行所花费的时间.(以上 1000 次共多久)
Requests per second: 每秒平均可以处理多少个connection.
备注:每次仅仅能针对一个连接做重复的测试。
Siege:
是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
下载/安装
Siege时一个开放源代码项目,可以在http://www.google.com上查找
备注:最好选择2.5以上版本,因为高版本多包括一个辅助工具,能够做增量压力测试,低版本不包括此工具。
安装:
./configure -prefix=/path/to/install && make && make install
使用说明:
siege使用
在/path/to/install/bin/目录下创建需要测试的链接文件,如www.test.com.url,添加需要的测试的链接
http://10.5.3.122/test/google.php/
http://10.5.3.122/test/baidu.php/
http://10.5.3.122/test/sogou.php/
然后保存。
siege使用样例:
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.test.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
bombardment使用样例:
bombardment www.test.com.url 5 3 4 1
初始化URL列表:www.test.com.url
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出样例和siege一致,但是会在每一次增量结束之后都有输出。
3.测试方法说明
测试步骤:
方法1.安装apache2后,直接使用apache2的默认设置配置,不做任何修改,进行测试;
方法2.按照以前文档提出的Web容量规划和内存的大小,计算出相应的启动进程数,配置httpd.conf文件,再进行测试;
ServerLimit 400
StartServers 20
MinSpareServers 20
MaxSpareServers 50
MaxClients 300
MaxRequestsPerChild 10000
方法3.超过极限设置,进行测试。(规划容量的2倍进行)
1000个链接,分为不同的并发数请求,10、50、100、200、300、500
ab测试:
/usr/local/apache2.53/bin/ab -n 1000 -c 10 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 50 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 100 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 200 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 300 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 500 http://10.5.3.122/test/google.php/
siege测试:
/usr/local/siege/bin/siege -c 10 -r 100 -f www.test.com.url
/usr/local/siege/bin/siege -c 50 -r 20 -f www.test.com.url
/usr/local/siege/bin/siege -c 100 -r 10 -f www.test.com.url
/usr/local/siege/bin/siege -c 200 -r 5 -f www.test.com.url
/usr/local/siege/bin/siege -c 300 -r 3 -f www.test.com.url
/usr/local/siege/bin/siege -c 500 -r 2 -f www.test.com.url
增量测试:
/usr/local/siege/bin/bombardment www.test.com.url 1 100 5 1
/usr/local/siege/bin/bombardment www.test.com.url 1 100 6 1
4.测试结果总结
ab测试:测试并发连接数在50~500的情况下,方法2比方法1性能略有提升,但是相差在10个并发连接数左右,并且方法1方法2在测试并发数100的情况下,实际并发数都相差无几。
siege测试:测试并发数从50之后直到500,性能都有提升,并且在测试并发数100、200、500的情况下,提升相差10~30个实际并发数。
bombardment测试:相差不大。本次测试的结果不太理想,性能的变化不显著,也不明显,可以所属于失败的测试结果。
分析原因:
1.本身硬件配置不高,所以默认设置和修改后的设置变化不明显,对性能的提升也明显不足;
2.负载情况太少,由于系统性能原因,增量测试都不能过大的进行,系统性能load average过高;
3.测试页面程序也太少,没有太大说服力。
网站性能测试报告模板
下载文件 (已下载 255 次)
1.apache安装
下载:
从Apache官方网站http://httpd.apache.org/download.cgi下载httpd-2.0.58.tar.gz。
安装:
先解压缩tar文件
tar -zxvf httpd-2.0.58.tar.gz
(1)./configure -prefix=/usr/local/apache2test -enable-so -enable-shared=max -with-mpm=worker -enable-deflate -enable-headers -enable-rewrite -enable-proxy -enable-proxy -enable-ssl -with-ssl=/path/to/install/openssl_0.97i -enable-modules=all && make && make install
(这是正式服务器上的apache2的编译参数,其中–with-mpm=worker –with-ssl=/path/to/install/openssl_0.97i可以根据实际情况做出修改)
然后安装php,并且在/usr/local/apache2test/conf目录下的httpd.conf里面的DSO支持之后加入
AddType application/x-httpd-php .php .phtml .html .htm
AddType application/x-httpd-php-source .phps
最后将测试的php网页文件添加到/usr/local/apache2test/htdocs目录下
(2) make
(3)make install
2.测试工具说明以及安装
ab:
ab是Apache超文本传输协议(HTTP)的性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能,主要是显示你安装的Apache每秒可以处理多少个请求;
概要:运行/usr/local/apache-install-path/bin/ab -help查看ab的具体命令选项;
命令选项-c concurrency 一次产生的请求个数。默认是一次一个。
-n requests 在测试会话中所执行的请求个数。 默认时,仅执行一个请求,但通常其结果不 具有代表意义
运行结果:主要要注意的是以下内容
Time taken for tests: 总共执行所花费的时间.(以上 1000 次共多久)
Requests per second: 每秒平均可以处理多少个connection.
备注:每次仅仅能针对一个连接做重复的测试。
Siege:
是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
下载/安装
Siege时一个开放源代码项目,可以在http://www.google.com上查找
备注:最好选择2.5以上版本,因为高版本多包括一个辅助工具,能够做增量压力测试,低版本不包括此工具。
安装:
./configure -prefix=/path/to/install && make && make install
使用说明:
siege使用
在/path/to/install/bin/目录下创建需要测试的链接文件,如www.test.com.url,添加需要的测试的链接
http://10.5.3.122/test/google.php/
http://10.5.3.122/test/baidu.php/
http://10.5.3.122/test/sogou.php/
然后保存。
siege使用样例:
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.test.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
bombardment使用样例:
bombardment www.test.com.url 5 3 4 1
初始化URL列表:www.test.com.url
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出样例和siege一致,但是会在每一次增量结束之后都有输出。
3.测试方法说明
测试步骤:
方法1.安装apache2后,直接使用apache2的默认设置配置,不做任何修改,进行测试;
方法2.按照以前文档提出的Web容量规划和内存的大小,计算出相应的启动进程数,配置httpd.conf文件,再进行测试;
ServerLimit 400
StartServers 20
MinSpareServers 20
MaxSpareServers 50
MaxClients 300
MaxRequestsPerChild 10000
方法3.超过极限设置,进行测试。(规划容量的2倍进行)
1000个链接,分为不同的并发数请求,10、50、100、200、300、500
ab测试:
/usr/local/apache2.53/bin/ab -n 1000 -c 10 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 50 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 100 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 200 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 300 http://10.5.3.122/test/google.php/
/usr/local/apache2.53/bin/ab -n 1000 -c 500 http://10.5.3.122/test/google.php/
siege测试:
/usr/local/siege/bin/siege -c 10 -r 100 -f www.test.com.url
/usr/local/siege/bin/siege -c 50 -r 20 -f www.test.com.url
/usr/local/siege/bin/siege -c 100 -r 10 -f www.test.com.url
/usr/local/siege/bin/siege -c 200 -r 5 -f www.test.com.url
/usr/local/siege/bin/siege -c 300 -r 3 -f www.test.com.url
/usr/local/siege/bin/siege -c 500 -r 2 -f www.test.com.url
增量测试:
/usr/local/siege/bin/bombardment www.test.com.url 1 100 5 1
/usr/local/siege/bin/bombardment www.test.com.url 1 100 6 1
4.测试结果总结
ab测试:测试并发连接数在50~500的情况下,方法2比方法1性能略有提升,但是相差在10个并发连接数左右,并且方法1方法2在测试并发数100的情况下,实际并发数都相差无几。
siege测试:测试并发数从50之后直到500,性能都有提升,并且在测试并发数100、200、500的情况下,提升相差10~30个实际并发数。
bombardment测试:相差不大。本次测试的结果不太理想,性能的变化不显著,也不明显,可以所属于失败的测试结果。
分析原因:
1.本身硬件配置不高,所以默认设置和修改后的设置变化不明显,对性能的提升也明显不足;
2.负载情况太少,由于系统性能原因,增量测试都不能过大的进行,系统性能load average过高;
3.测试页面程序也太少,没有太大说服力。
网站性能测试报告模板
![](template/digiart1/images/download.gif)
使用mob_bw管理apache2下载带宽
[ 2009/08/17 19:07 | by selboo ]
有个下载站,提供大文件的上传下载服务,没有盗链,都是正常应用,带宽经常占满。后来查到原来有几个用户使用的带宽是百兆光纤,这几个用户一下载,整个服务器的带宽就基本上被用光了,其他用户再来下载,基本上就下载不下来了。
机房给的带宽是百兆共享,最多能用到10M,为了能充分合理的使用带宽,这里使用了apache的bw_module。
安装
wget http://apache.ivn.cl/files/source/mod_bw-0.8.tgz
tar xzvf mod_bw-0.8.tgz
cd mod_bw
/usr/local/apache/bin/apxs -i -a -c mod_bw.c
配置
编辑httpd.conf
添加如下一行
LoadModule bw_module modules/mod_bw.so
设置带宽控制策略
我这里的需求有两点,一是只要带宽足够,则尽量给用户最多的带宽;而是如果同时下载人数过多,则给用户保障一个最低带宽,并且尽量平均分配。
BandWidthModule on
ForceBandWidthModule On
BandWidth all 10240000
MinBandWidth all 204800
在这种情况下,总带宽限制在10M,如果服务器上只有一个用户在下载,那么就给他10M的带宽(如果客户端也能有这么高带宽的话),当有50个用户在下载的话,则保障每个用户都能有200K带宽,当有100个用户在下载的话,则平均每个用户分配100K带宽。
bw_module的策略还有很多种,具体可以看源代码中的mod_bw.txt
机房给的带宽是百兆共享,最多能用到10M,为了能充分合理的使用带宽,这里使用了apache的bw_module。
安装
wget http://apache.ivn.cl/files/source/mod_bw-0.8.tgz
tar xzvf mod_bw-0.8.tgz
cd mod_bw
/usr/local/apache/bin/apxs -i -a -c mod_bw.c
配置
编辑httpd.conf
添加如下一行
LoadModule bw_module modules/mod_bw.so
设置带宽控制策略
我这里的需求有两点,一是只要带宽足够,则尽量给用户最多的带宽;而是如果同时下载人数过多,则给用户保障一个最低带宽,并且尽量平均分配。
BandWidthModule on
ForceBandWidthModule On
BandWidth all 10240000
MinBandWidth all 204800
在这种情况下,总带宽限制在10M,如果服务器上只有一个用户在下载,那么就给他10M的带宽(如果客户端也能有这么高带宽的话),当有50个用户在下载的话,则保障每个用户都能有200K带宽,当有100个用户在下载的话,则平均每个用户分配100K带宽。
bw_module的策略还有很多种,具体可以看源代码中的mod_bw.txt