O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Set the CAP_SYS_NICE capability to mysqld:
shell> ps aux | grep mysqld | grep -v grepmysql     5238  0.0 28.1 1253368 488472 ?      Sl   Nov19   4:04 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pidshell> sudo setcap cap_sys_nice+ep /usr/sbin/mysqldshell> getcap /usr/sbin/mysqld/usr/sbin/mysqld = cap_sys_nice+ep
  1. Create a resource group using the CREATE RESOURCE GROUP statement. You have to mention the resource group name, number of VCPUS, thread priority, and type, which can be either USER or SYSTEM. If you do not specify the VCPU, all the CPUs will be used:
mysql> CREATE RESOURCE GROUP report_groupTYPE = USERVCPU = 2-3THREAD_PRIORITY = 15ENABLE;# You should have at least 4 CPUs for the above resource group to create. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required