[MDEV-17757] MariaDB 10.1 encryption threads consume CPU 100% Created: 2018-11-17 Updated: 2018-12-29 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Encryption, Storage Engine - InnoDB |
| Affects Version/s: | 10.1.34 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Stefan | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 6.10 |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi, We activated the encryption and the replication on our servers. For some reasons during the restart the MariaDB encryption threads consumes 100% CPU without terminating when traffic is present. For example if no traffic happens on Master, during the mysql restart (service mysql restart) the CPU will be consumed for some minutes (20 minutes or so) and then will go back to normal. What we observed is that the encryption threads might get stuck if the server is restarted on a loading coming. So is not that the threads would consume some resources but might get the server stuck in a infinite loop. I tried to run a compiled version with debug but I'm not sure what should I do in order to see what happens on that threads ? top -H Cpu(s): 37.3%us, 0.4%sy, 0.0%ni, 62.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND gdb -p 3840 /usr/sbin/mysqld This is an output from the thread: Thread 1 (process 3840): Configuration is: innodb-file-format = Antelope interactive_timeout = 3700 server-id = 1 back_log = 3000 performance_schema = 0 binlog_format=STATEMENT max-allowed-packet = 4M query_cache_type = 0 key_buffer_size = 16M innodb-flush-method = O_DIRECT innodb-log-files-in-group = 3 tmpdir = /mysql_database/mysql/ innodb_io_capacity = 200 [mysqlhotcopy] [mysqld_safe] [mariadb] plugin-load-add=file_key_management.so |
| Comments |
| Comment by Marko Mäkelä [ 2018-11-20 ] |
|
stefan2017, do you see this on an otherwise idle server? Could you try to create and upload a reproducible test case? |
| Comment by Stefan [ 2018-11-21 ] |
|
No, if I restart the server while is idle (NO traffic done on it and no app is connected), the threads runs a while and stops, usually 5 to 10 minutes. If for example I start the loading on Master node and after a while I restart the Slave node once still traffic on Master, the threads continue to run forever, even after some minutes after the Slave restart, the loading tests ends on Master. I can reproduce this behavior. All I need is what commands to run and what to provide to you. A separate question, I tried to recompile MariaDB with more debug options. How can I add symbols to this process ? wget .... sources |
| Comment by Thirunarayanan Balathandayuthapani [ 2018-11-21 ] |
|
innodb_encryption_key_rotate_age is 1 could lead to re-encryption of tablespace frequently. May be, Increasing the variable will avoid re-encryption. |
| Comment by Stefan [ 2018-11-21 ] |
|
Can you please let me know how I should change this values to repeat the test? innodb_default_encryption_key_id=1 - what value should I set here According to the documentation: innodb-encryption-rotate-key-age = Re-encrypt in background any page having a key older than this number of key versions. innodb_default_encryption_key_id=10 and keep innodb-encryption-rotate-key-age=1 ? |