2012年7月17日
nginx、mysql、drizzle、性能优化、效率
nginx高效安装和使用mysql访问模块drizzle
编译并安装libdrizzle-1.0
3358 agent zh.org/misc/nginx/drizzle7- 2011.07.21.tar.gz
tarxzvfdrizzle7- 2011.07.21.tar.gz
cd drizzle7-2011.07.21/
./configurewithout-server
make libdrizzle-1.0
生成安装- lib drizzle-1.0
下载drizzle-nginx -模块
wget 3359 github.com/chaos lawful/drizzle-nginx-module/tarball/v 0.1.2 rc7-ochaoslawful-drizzle-nginx-module
下载rds-json-nginx-module
wget 3359 github.com/agent zh/rds-JSON-nginx-module/tarball/v 0.12 rc10-oagentzh-rds-JSON-nginx-module
4 .编译并安装tengine
./configureprefix=/server/t engine-with-file-AIO-with-http _ Lua _ module-with-http _ stub _ status _ module-with-http _ sssl _ matu me 2c abf-add-module=./agent zh-rds-JSON-nginx-module-74 c21 B3
生成sudo生成安装
5 .安置
http节点下:
upstream群集{
drizzle _ server 127.0.0.1:3306 dbname=MySQL password=Liang Wei user=root protocol=MySQL;
}
服务器节点下:
set $my_sql 'select * from user ';
drizzle_query $my_sql;
drizzle_module_header off;
drizzle_pass cluster;
rds_json on;
}
6 .简单的压力测试:
梁圩@梁圩- Ubuntu :/server/t engine/conf $ web bench-t20-c 100003358192.168.56.101/MySQL
copyright(c ) Radim Kolar 1997-2004,GPL Open Source Software。
benchmarking : get http://192.168.56.101/MySQL
10000客户端,运行20秒。
Speed=82350 pages/min,7930495 bytes/sec。
请求: 26978 sus ceed,472故障。
梁圩@梁圩- Ubuntu :/server/t engine/conf $ web bench-t20-c 100003358192.168.56.101/index.PHP
copyright(c ) Radim Kolar 1997-2004,GPL Open Source Software。
benchmarking : get http://192.168.56.101/index.PHP
10000客户端,运行20秒。
Speed=48501 pages/min,4362751 bytes/sec。
请求: 16167 sus ceed,0故障。
7 .错误解决
1 )、/configure : error : sslmodulesrequiretheopenssllibrary。
apt-get install libssl-dev
2 )、/configure : error : ngx _ http _ Lua _ modulerequiresthelualibrary。
apt-get install liblua5.1-0-dev