Skip to content
February 17, 2017 / ftth

Changing mysql nice priority on Ubuntu 16.04

I wanted to prioritize mysqld, and the only sources i could find were all referring to the nice parameter to mysqld_safe in /etc/mysql/my.cnf or hacking the /etc/init/mysql.conf. None of these worked for Ubuntu 16.04.

Systemd is now the init daemon for Ubuntu, so that’s the one who is launching it now:

root@easycast-myserver:~/bench# service mysql status
● mysql.service - MySQL Community Server
 Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
 Drop-In: /etc/systemd/system/mysql.service.d
 Active: active (running) since Fri 2017-02-17 10:40:04 CET; 5min ago
 Process: 8665 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
 Process: 8655 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 8664 (mysqld)
 CGroup: /system.slice/mysql.service
 └─8664 /usr/sbin/mysqld

So dropping the following systemd Nice option on the /etc/systemd/system/mysql.service.d/override.conf file did work:



Just restart the services:

systemctl daemon-reload && service mysql restart



One Comment

Leave a Comment
  1. Morgan Wu / Jan 23 2018 6:05 am

    it doesn’t work

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: