今天在看Nginx官网是看到Nginx推出了Windows版。
最新的开发为nginx/Windows-0.7.52,下载地址为:http://sysoev.ru/nginx/nginx-0.7.52.zip
今天在看Nginx官网是看到Nginx推出了Windows版。
最新的开发为nginx/Windows-0.7.52,下载地址为:http://sysoev.ru/nginx/nginx-0.7.52.zip
一、http_load
程序非常小,解压后也不到100K
http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是它不同于大多数压力测试工
具,它可以以一个单一的进程运行,一般不会把客户机搞死。还可以测试HTTPS类的网站请求。
下载地址:http://soft.vpser.net/test/http_load/http_load-12mar2006.tar.gz
安装很简单
#tar zxvf http_load-12mar2006.tar.gz
#cd http_load-12mar2006
#make && make install
命令格式:http_load -p 并发访问进程数 -s 访问时间 需要访问的URL文件
参数其实可以自由组合,参数之间的选择并没有什么限制。比如你写成http_load -parallel 5 -seconds
300 urls.txt也是可以的。我们把参数给大家简单说明一下。
-parallel 简写-p :含义是并发的用户进程数。
-fetches 简写-f :含义是总计的访问次数
-rate 简写-p :含义是每秒的访问频率
-seconds简写-s :含义是总计的访问时间
准备URL文件:urllist.txt,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好.文件格式
如下:
https://www.vpser.net/uncategorized/choose-vps.html
https://www.vpser.net/vps-cp/hypervm-tutorial.html
https://www.vpser.net/coupons/diavps-april-coupons.html
https://www.vpser.net/security/vps-backup-web-mysql.html
例如:
http_load -p 30 -s 60 urllist.txt
参数了解了,我们来看运行一条命令来看看它的返回结果
命令:% ./http_load -rate 5 -seconds 10 urls说明执行了一个持续时间10秒的测试,每秒的频率为5。
49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds5916 mean bytes/connection4.89274
fetches/sec, 28945.5 bytes/secmsecs/connect: 28.8932 mean, 44.243 max, 24.488 minmsecs/first
-response: 63.5362 mean, 81.624 max, 57.803 minHTTP response codes: code 200 — 49
结果分析:
1.49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
说明在上面的测试中运行了49个请求,最大的并发进程数是2,总计传输的数据是289884bytes,运行的时间是10.0148秒
2.5916 mean bytes/connection说明每一连接平均传输的数据量289884/49=5916
3.4.89274 fetches/sec, 28945.5 bytes/sec
说明每秒的响应请求为4.89274,每秒传递的数据为28945.5 bytes/sec
4.msecs/connect: 28.8932 mean, 44.243 max, 24.488 min说明每连接的平均响应时间是28.8932 msecs
,最大的响应时间44.243 msecs,最小的响应时间24.488 msecs
5.msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
6、HTTP response codes: code 200 — 49 说明打开响应页面的类型,如果403的类型过多,那可能
要注意是否系统遇到了瓶颈。
特殊说明:
测试结果中主要的指标是 fetches/sec、msecs/connect 这个选项,即服务器每秒能够响应的查询次数,
用这个指标来衡量性能。似乎比 apache的ab准确率要高一些,也更有说服力一些。
Qpt-每秒响应用户数和response time,每连接响应用户时间。
测试的结果主要也是看这两个值。当然仅有这两个指标并不能完成对性能的分析,我们还需要对服务器的
cpu、men进行分析,才能得出结论
二、webbench
webbench是Linux下的一个网站压力测试工具,最多可以模拟3万个并发连接去测试网站的负载能力。下载地址可以到google搜,我这里给出一个
下载地址:http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz
这个程序更小,解压后不到50K,呵呵
安装非常简单
#tar zxvf webbench-1.5.tar.gz
#cd webbench-1.5
#make && make install
会在当前目录生成webbench可执行文件,直接可以使用了
用法:
webbench -c 并发数 -t 运行测试时间 URL
如:
webbench -c 5000 -t 120 https://www.vpser.net
三、ab
ab是apache自带的一款功能强大的测试工具
安装了apache一般就自带了,
用法可以查看它的说明
$ ./ab
./ab: wrong number of arguments
Usage: ./ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-p postfile File containing data to POST
-T content-type Content-type header for POSTing
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. ‘Apache=1234. (repeatable)
-H attribute Add Arbitrary header line, eg. ‘Accept-Encoding: gzip’
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-h Display usage information (this message)
参数众多,一般我们用到的是-n 和-c
例如:
./ab -c 1000 -n 100 https://www.vpser.net/index.php
这个表示同时处理1000个请求并运行100次index.php文件.
四、Siege
一款开源的压力测试工具,可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
官方:http://www.joedog.org/
Siege下载:http://soft.vpser.net/test/siege/siege-2.67.tar.gz
解压:
# tar -zxf siege-2.67.tar.gz
进入解压目录:
# cd siege-2.67/
安装:
#./configure ; make
#make install
使用
siege -c 200 -r 10 -f example.url
-c是并发量,-r是重复次数。 url文件就是一个文本,每行都是一个url,它会从里面随机访问的。
example.url内容:
http://www.licess.com
https://www.vpser.net
http://soft.vpser.net
结果说明
Lifting the server siege… done.
Transactions: 3419263 hits //完成419263次处理
Availability: 100.00 % //100.00 % 成功率
Elapsed time: 5999.69 secs //总共用时
Data transferred: 84273.91 MB //共数据传输84273.91 MB
Response time: 0.37 secs //相应用时1.65秒:显示网络连接的速度
Transaction rate: 569.91 trans/sec //均每秒完成 569.91 次处理:表示服务器后
Throughput: 14.05 MB/sec //平均每秒传送数据
Concurrency: 213.42 //实际最高并发数
Successful transactions: 2564081 //成功处理次数
Failed transactions: 11 //失败处理次数
Longest transaction: 29.04 //每次传输所花最长时间
Shortest transaction: 0.00 //每次传输所花最短时间
下午在XLinux(分享Linux)群里有人,如何删除编译安装的MySQL或者其他软件,在这里顺便说一下。
直接运行下面的命令就行了。
make uninstall
make clean
rm -rf mysql //mysql目录
如果是编译过程出错,要重新编译
那就
make clean
然后再
./configure
make && make install
VPS购买来了,不能就这么放在,对吧。下面给大家说一下VPS买来之后的初始化操作,及Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator这些软件的编译安装。
一、登录VPS
登录的方式很多,如果是Linux直接ssh就可以。
下面以Windows下putty为例:
填写上IP或域名,再写个名字,save ,然后Open
二、安装LNMP
安装Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator使用Licess的LNMP。
有些VPS默认是安装Apahche的,如果安装了,请先执行:yum -y remove httpd
下面是按照的过程使用的命令,及相关注释(注释用 //,红色加粗为所使用的命令)
Using username “root”.
root@67.215.242.196’s password:
[root@vpser ~]#cd /usr/local/src
[root@vpser src]#ls
[root@vpser src]#wget http://licess.googlecode.com/files/LNMP.zip //下载LNMP文件
–11:29:51– http://licess.googlecode.com/files/LNMP.zip
Resolving licess.googlecode.com… 209.85.173.82
Connecting to licess.googlecode.com|209.85.173.82|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 11261 (11K) [application/x-zip]
Saving to: `LNMP.zip’
100%[=======================================>] 11,261 –.-K/s in 0.1s
11:29:52 (111 KB/s) - `LNMP.zip’ saved [11261/11261]
[root@vpser src]#unzip LNMP.zip //解压LNMP压缩包
Archive: LNMP.zip
creating: LNMP/
creating: LNMP/conf/
inflating: LNMP/conf/fcgi.conf
inflating: LNMP/conf/nginx-load.conf
inflating: LNMP/conf/nginx-proxy.conf
inflating: LNMP/conf/nginx.conf
inflating: LNMP/conf/php-fpm.conf
inflating: LNMP/down.sh
inflating: LNMP/install.sh
inflating: LNMP/opt.sh
inflating: LNMP/readme.txt
inflating: LNMP/startup.sh
[root@vpser src]#cd LNMP
[root@vpser LNMP]#ls
conf down.sh install.sh opt.sh readme.txt startup.sh
[root@vpser LNMP]#chmod +x install.sh down.sh //为install.sh和down.sh添加执行权限
[root@vpser LNMP]#./down.sh //下载安装所需的源代码文件
=========================================================================
LNMP v0.0.1 for VPS Written by Licess
=========================================================================
For more information please visit http://blog.licess.com/lnmp/
start download LNMP package
………………………….省略下载过程
download package finished!
=========================================================================
[root@vpser LNMP]#clear
[root@vpser LNMP]#ls
conf mysql-5.0.22.tar.gz
down.sh nginx-0.7.19.tar.gz
eaccelerator-0.9.5.3.tar.bz2 opt.sh
install.sh pcre-7.7.tar.gz
libiconv-1.12.tar.gz php-5.2.6-fpm-0.5.9.diff.gz
libmcrypt-2.5.8.tar.gz php-5.2.6.tar.gz
mcrypt-2.6.7.tar.gz phpMyAdmin-3.1.1-all-languages.tar.gz
memcache-2.2.3.tgz readme.txt
mhash-0.9.9.tar.gz startup.sh
[root@vpser LNMP#]./install.sh //开始安装
=========================================================================
LNMP v0.0.1 for VPS Written by Licess
=========================================================================
A tool to auto-compile & install Nginx+MySQL+PHP on Linux
For more information please visit http://blog.licess.com/lnmp/
The path of some dirs:
mysql dir: /usr/local/mysql
php dir: /usr/local/php
nginx dir: /usr/local/nginx
web dir /web/www
=========================================================================
在此步中输入你要绑定的域名,例如:diavps.vpser.net ,回车确认。
Please input domain:
(Default domain: www.lnmp.org):diavps.vpser.net
===========================
domain=diavps.vpser.net
===========================
Press any key to start… \\再次按任意键确认,开始安装
Loading “fastestmirror” plugin
………………………………..
开始安装……..
PS:屏幕疯狂的滚动…….欣赏一下
经过漫长的等待(时间不确定,根据实际情况,我的是半个多小时),终于安装完了。
下面看一下PHPInfo
PHPMyAdmin:
程序安装路径:
MySQL : /usr/local/mysql
PHP : /usr/local/php
Nginx : /usr/local/nginx
PHPMyAdmin /web/www/phpmyadmin
Web目录 /web/www
MySQL 用户:root 密码:root
通过下面这几个链接查看phpinfo和管理MySQL
phpinfo http://ip/phpinfo.php
phpMyAdmin http://ip/phpmyadmin
让Nginx开机后手动执行 /root/run.sh 后Nginx会运行 ,开机自动运行可以运行 LNMP目录下面的 startup.sh 文件即可。
opt.sh 为优化文件,如果内存小于128MB可以通过执行 ./opt.sh 添加swap分区,并修改时区为东8区。注:并不一定在所有的VPS上都可以添加swap分区,swvps不可以,其他没有测试。
安装完后,请立即修改您的MySQL的root密码,使用命令cd /usr/local/mysql/bin
再执行:./mysqladmin -u root -p password mypasswd //mypasswd为自己的密码
输入这个命令后,需要输入root的原密码,然后root的密码将改为mypasswd。
把命令里的root改为你的用户名,你就可以改你自己的密码了。
进入phpmyadmin目录/web/www/phpmyadmin 将 config.default.php 修改为config.inc.php
修改这个文件的 $cfg['Servers'][$i]['auth_type'] = ‘http’;
$cfg['blowfish_secret'] = ‘VPSER’; //VPSER为任意字符
保存,然后就可以登录了。
因为没有安装ftp服务器软件,可以使用winscp这个软件管理文件。
更详细的关于LNMP的可以看:http://blog.licess.com/lnmp/
可能在安装过程中遇到什么问题可以在下面留言。
今天在WHT上看到FodyHost正在搞活动,384MB内存、25GB空间、250GB流量、3个IP,可以说相当超值,适合刚接触VPS的新手买一个月练习使用。而且他们承诺30天内可以退款(不确定,用它29天的时候我退款试试^_^)!
优惠码: VPS90 (2009.4.1结束),VPS新手抓紧时间了~
本站已经购买,等待开通。开通后,本站会及时公布相关信息供VPSer们测试。
已开通(开通速度很快,赞),测试IP:216.245.197.78 域名:fodyhost.vpser.net
1、看到了传说中的Virtuozzo Power Panel (VZPP)登录界面
2、Virtuozzo Power Panel (VZPP)管理面板
顺便说一下,我现在正在修改LNMP-Linux下Nginx+MySQL+PHP+phpMyAdmin+eAcelerator一键安装包,相信很快就会发布基于Debian/Ubuntu的lnmp了。
很久就知道Yahoo有个1.99$的域名,因为一直也不需要这个域名,也就一直没有太关注这方面的信息,前几天想做个“VPS侦探”的网站,写一些VPS优惠信息、VPS环境搭建、VPS优化管理等方面的文章。
可以注册.com/.net/.org/.biz/.info/.us类型的域名,选者的余地较大。
注册地址 http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
Yahoo的域名只适合第一年这次,以后续费就很贵,我注册完,发现下年续费要30多美元,不过没事,域名注册超过60天就可以转出,可以转到name.com或者Godaddy都可以,当然转到国内也可以(不推荐!)。
大家可以看一我注册的域名 https://www.vpser.net