0
我已經配置AWS RDS以下參數:AWS RDS帕拉姆long_query_time時間設爲0,但仍然沒有slow_logs
join_buffer_size: 67108864
log_queries_not_using_indexes: 1
long_query_time: 0
query_cache_size: 67108864
query_cache_type: 1
slow_query_log: 1
Mysqltuner給出了下面的輸出:
[!!] Slow queries: 98% (764K/772K)
[OK] Highest usage of available connections: 1% (51/5082)
[OK] Key buffer size/total MyISAM indexes: 16.0M/420.5M
[OK] Key buffer hit rate: 98.1% (41M cached/789K reads)
[OK] Query cache efficiency: 70.2% (381K cached/543K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (50 temp sorts/85K sorts)
[!!] Joins performed without indexes: 3023
[OK] Temporary tables created on disk: 2% (1K on disk/67K total)
[OK] Thread cache hit rate: 99% (51 created/47K connections)
[OK] Table cache hit rate: 25% (1K open/6K opened)
[OK] Open file limit used: 1% (1K/65K)
[OK] Table locks acquired immediately: 98% (985K immediate/998K locks)
我得到很少慢查詢日誌。我想我應該爲每個查詢得到一個。我該如何解決?
你在看RDS控制檯的慢日誌文件嗎?或者查詢mysql數據庫的slow_log表?我有一個類似於你的設置,我的查詢正在寫入slow_log表。我仍然試圖弄清楚如何讓它們進入日誌文件。 – Alex
我想出瞭如何路由到日誌文件,所以如果這與您遇到的情況相同,請參閱本頁中標題爲「訪問MySQL緩慢查詢和常規日誌」的部分:http://docs.aws.amazon .COM/AmazonRDS /最新/ UserGuide/USER_LogAccess.Concepts.MySQL.html – Alex