[MDEV-9784] High CPU Usage When Absolutely Idle on OSX Created: 2016-03-23 Updated: 2018-01-21 Resolved: 2017-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Encryption |
| Affects Version/s: | 10.1.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Amy Anuszewski | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OSX |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
I have installed mariadb using homebrew on my development machine. It starts at boot time, but if I am not actively working on my local development environment, no queries are running. Despite no activity, mariadb is using 100% of my CPU. Stopping the service has been my only option. |
| Comments |
| Comment by Elena Stepanova [ 2016-03-24 ] |
|
Can you acquire a stack trace (or better several consequent stack traces) from the running server? |
| Comment by Amy Anuszewski [ 2016-03-24 ] |
|
Would love to, but I'm not seeing information anywhere on how to get one if mariadb hasn't crashed. |
| Comment by Vicențiu Ciorbaru [ 2016-03-24 ] |
|
You can do the following, assuming lldb is installed on your machine: $ ps -ax | grep mysqld $ lldb |
| Comment by Amy Anuszewski [ 2016-03-24 ] |
|
Thank you, Vicentiu. I started mariadb this morning around 8am. At first, the CPU usage is fine. But, by 11 am, it was over 200%. I grabbed a stacktrace per the above directions. I am enclosing it. Something interesting happened. Doing the stacktrace made the CPU usage drop again. I'm also attaching a picture of activity monitor that shows it dropped drastically. I will grab more traces again once the load increases. |
| Comment by Amy Anuszewski [ 2016-03-24 ] |
|
This is interesting. The second I attach the lldb debugger to the mariadb process, the CPU usage immediate drops - before I get a chance to do the trace. If I exit lldb, the CPU usage goes up again. So, I'm not sure a trace is going to capture the problem in action. |
| Comment by Vicențiu Ciorbaru [ 2016-03-24 ] |
|
The CPU usage makes sense. The reason why this happens is that when you attach lldb, the process is halted. If you send lldb the continue command, the CPU usage should go back to where it was before. The thing that could be the culprit is: This seems to be the thread that is actually performing some work. |
| Comment by Elena Stepanova [ 2016-03-24 ] |
|
amykhar, thanks for providing the stack trace.Please also attach your cnf file(s). jplindst, since encryption is the main suspect here, could you please take a look? |
| Comment by Amy Anuszewski [ 2016-03-24 ] |
|
Enclosed is my my.cnf my.cnf (There are no files in my.cnf.d) |
| Comment by Jan Lindström (Inactive) [ 2017-12-13 ] |
|
This is not a bug. You have background key rotation enabled i.e. InnoDB background threads (4 in you case) are doing periodically check does one of the tablespaces need a key rotation. You can disable background key rotation either by setting innodb-encryption-rotate-key-age=0, note that this will also disable system tablespace key rotation and here key rotation means also unencrypted to encrypted state change. |