Saturday, December 30, 2017

[以管窺天] AWS RDS Query Thruoughput 太高.

公司的網站在改版後, 雖然使用同樣的database (Aurora RDS), 但一直有個奇怪的現象.
每秒的select 數一直偏高. 工程師猜測應該只是RDS 統計介面的一個Bug...





Well, 在Google 的幫忙下, 我們找到了一個Script(run in python)可以做這統計.
https://www.centos.bz/2015/02/analysis-mysql-general-log/



After the new version of web site launched, we found that the number of select/sec goes high all the time. The db is running on AWS Aurora service with MySQL compatible. Engineer of my department says that is an bug of RDS, while I dont think so. After the great 'Google', we found a tool that could help us what are the often-run statements.



預設這個script 會將所有的資料印出在螢幕上, 為了使用方便, 建議轉向寫入檔案來觀看,
下圖是我們主機執行的結果 (query 內文先馬賽克起來 *笑*)
嗯, 前幾名加起來跑了超過100萬次. (一小時內). 後面看來有不小的調整要進行啊.


By default the script directly shows the result on STDOUT, and we suggest you may using I/O redirection to check it.
The following screenshot(with mozaic mask, lol), tell us that the top queries run more than 1,000,000 times in an hour. well, we have lot's of things to do...






No comments:

Followers

About Me

My photo
有人叫我肯公, 有人叫我肯公公 或是 肯爺. 總之, 有肯, 又有老的感覺就是了