Score:0

High CPU usage and less than 5% ram usage (MYSQL). Should I add more CPU Cores?

gh flag

My current server has 12 cores and 96gb of RAM. But due to my MYSQL queries, up to 100% of the server is always in usage while ram is less than 5%. I know the major issue is with the SQL queries. From logs, it turned out to be some queries that sums up values in all columns. Now due to how huge the application is, optimizing the queries will not be possible in the short term.

As a short term solution, should I get a new server with 32 cores? Or is there a way to move some of the processing power to the server's RAM? That way over 90gb of RAM won't just be going to waste.

kr flag
Tune your queries.
us flag
less than 5% including buffers?
Wilson Hauck avatar
jp flag
Additional information request, please. Any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; AND very helpful OS information, includes - htop OR top 1st page, ulimit -a for list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to provide suggestions.
Score:2
ua flag

No.

I have yet to see a MySQL server that ran out of cores before running out of other resources.

Often, high CPU usage is cured by adding a better index (especially a composite index) and/or reformulating some slow query.

Find the slow queries and let's discuss them. SlowLog

"Low RAM usage" usually means a too-low value of innodb_buffer_pool_size. That setting should be about 70% of RAM. However, a low setting of that usually implies high I/O, not high CPU. Please show us SHOW CREATE TABLE and SELECT... for some naughty queries.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.