前阵子测试了360开源出来的Atlas,总的来说挺好的,这里先标记下,备用。
听说amoeba也不错,大牛还给我推荐了一篇文章,也先留着。
测试了下atlas的性能,挺给力的。
在并发2000时,atlas会提示I have no server backend,closing connection。判断应为mysql不能及时提供空闲连接导致,但atlas并未出现任何瓶颈。但是,atlas自身没有断开mysql连接的设置,完全依赖于mysql自身的超时时间。
其读写分离策略是除了完全的读请求,其余的都会将请求发给主库。
测试脚本:
#!/bin/bash
#***For pressure test Atlas***
date +"%H:%M:%S"
for ((i=0;i<1500;i++));do
{
num=`echo $RANDOM`
mysql -ushanks -p51cto -h192.168.122.100 -P8306 zabbix -e "insert into test_atlas values(\"${num}\")"
} &
done
date +"%H:%M:%S"
配置文件:
[mysql-proxy]
plugins = admin,proxy
admin-username = admin
admin-password = [email protected]
admin-lua-script = /usr/local/mysql-proxy/lib/mysql-proxy/lua/admin.lua
proxy-backend-addresses = 172.16.220.242:3306
proxy-read-only-backend-addresses = 172.16.220.243:[email protected]
daemon = true
keepalive = true
event-threads = 4
log-level = message
log-path = /usr/local/mysql-proxy/log
instance = test
proxy-address = 0.0.0.0:8306
admin-address = 0.0.0.0:8307
min-idle-connections = 128
#tables = person.mt.id.3
#pwds = 8Z9V7iLZoR0=
charset = utf8