1. 程式人生 > >查看mysql當前設置的內存已經使用了多少

查看mysql當前設置的內存已經使用了多少

內存 log 數據庫服務器 24* ota thread mys stack key

以下sql為在250連接數的時候所需要的內存為多少。此sql可以計算數據庫服務器的內存在當前數據庫中的相關配置 是否超過系統total的內存,以防止內存的濫用。
select ((@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@query_cache_size)/1024/1024/1024)+((@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@thread_stack)/1024/1024/1024*250);

查看mysql當前設置的內存已經使用了多少