from Hacker News

Ask HN: What does it mean to you as DBA if DB is running at 99% CPU utilization?

by sirkarthik on 10/8/21, 9:51 AM with 3 comments

  • by LinuxBender on 10/8/21, 11:36 AM

    If you mean a constant 99% on all cores, then I would agree with what gjvc said. There is no more processing capacity. That said, 99% CPU is not a problem if you are keeping up with the work demand. More important to me is looking at CPU load vs. Run-Queue. If I have high CPU at times, my servers are doing their job. If I have processes waiting for CPU time that is an actual problem. You can of course see this in your DB stats and slow query logs but this is also obvious in the OS.

      vmstat 4 40
    
    Watch the first two columns. r is active processes in the run queue and b is blocked in uninterruptible sleep. r should always be higher than b and if I am a DBA concerned about performance, b should nearly always be 0 or very close to it. If b is higher than 0 then I need to start looking at other columns in vmstat and other commands such as iostat to start to see at a high level where my bottlenecks are. CPU queues can be deceiving because the CPU can be waiting on disk. If you provide more system stats in a pastebin-like site, it would be easier to answer your question.

    For what it's worth, you should also be browsing around on ServerFault [1] For your sanity sake, lurk on that site for some time before asking any questions. Make heavy use of their search and label functions. People can be a little rough if you have not made a best effort to dig into your particular issue first.

    [1] - https://serverfault.com/

  • by gjvc on 10/8/21, 9:55 AM

    you've got no headroom left for load spikes!

    but this sort of question obscures the reality. are you asking this in the context of a machine which is running slowly? are the clients which are querying the DBMS acting differently? has there recently been a change to the application which might have brought this about? have the marketing department started an advertising campaign without telling you?

  • by markus_zhang on 10/8/21, 1:01 PM

    Hey boss your investment is being fully utilized! Get ready to put down more dough!

    disclaimer not a dba