採用Atlas mysql 讀寫分離工具

來源:互聯網
上載者:User

標籤:server   mysql   文章   

前陣子測試了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


本文出自 “目標:印度” 部落格,請務必保留此出處http://shunzi115.blog.51cto.com/5184443/1825940

採用Atlas mysql 讀寫分離工具

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.