mysql 5.7 is working slow on ubuntu 18.04 LTS

I am currently using ubuntu 18.04 server ( with 8GB RAM , 100 GB HDD & Intel I3 processor ) for project deployment, & am using mysql 5.7 database server , but whenever I tries to insert data in database it has been inserting too slow as compare to Ubuntu 16.04 with same configuration .

  • Ubuntu 16.04 -> Mysql 5.7.24 -> insert data rate ( 250k-350k / Min )
  • Ubuntu 18.04 -> Mysql 5.7.24 -> insert data rate ( 10k-15k / Min )

AS I check performance of the system while inserting the data into mysql then I found

  • Ubuntu 16.04 -> CPU utilization 60-70 %
  • Ubuntu 18.04 -> CPU utilization 7-8 %

Ubuntu 18.04 restrict mysql application from utilizing maximum CPU , Please let me know the solution for above.


Solution 1:

The Linux Disk I/O elevator algorithm was the culprit.

$ cat /sys/block/{device-name}/queue/scheduler
noop deadline [cfq]

change the io mode to deadline, if use the ssd,should use noop

echo deadline > /sys/block/{device-name}/queue/scheduler

Append the choice of elevator algorithm to this kernel boot command entry. The changed linux kernel boot command will look like:

linux /vmlinuz-4.4.0-31-generic root=/dev/mapper/ashish--devbox--vg-root ro elevator=deadline