Created
September 14, 2024 03:47
-
-
Save samof76/8744ab377cd1142960f4e37039966441 to your computer and use it in GitHub Desktop.
Revisions
-
samof76 created this gist
Sep 14, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ To investigate high RAM usage in ClickHouse and determine what's consuming so much memory, you can try the following steps: 1. Check system tables: Query the system.metrics and system.asynchronous_metrics tables to get an overview of memory usage: ```sql SELECT * FROM system.metrics WHERE metric LIKE '%Memory%'; SELECT * FROM system.asynchronous_metrics WHERE metric LIKE '%Memory%'; ``` 2. Examine query memory usage: Look at currently running queries and their memory consumption: ```sql SELECT query_id, user, elapsed, memory_usage FROM system.processes ORDER BY memory_usage DESC; ``` 3. Check table sizes: Identify large tables that might be causing memory pressure: ```sql SELECT database, name, total_bytes, total_rows FROM system.tables ORDER BY total_bytes DESC LIMIT 10; ``` 4. Review merge processes: Check if there are any large merges in progress: ```sql SELECT * FROM system.merges; ``` 5. Inspect background processes: Look at background processes that might be consuming memory: ```sql SELECT * FROM system.background_processing_pool; ```