How to configure Mysql on Ubuntu?

Hello, SW. community. Tell me, please, moved the website from shared hosting to vds(4 cores, 4 RAM) and are faced with the problem that queries to the database(server Version: 5.5.60-MariaDB - MariaDB Server) were processed several times slower than a shared host,what could be the problem?
March 19th 20 at 08:27
2 answers
March 19th 20 at 08:29
There is no single correct setting for all occasions. It all depends on the load of the database, the availability of resources, drives used, etc.

In the simplest case, you can check the settings with the help of some mysqltuner, but need to understand that it only checks a few simple rules, and its recommendations are not always reasonable.

It is also possible that in your case, the problem is not in the settings, and the bottleneck is IO, with him on many virtualtech is all quite sad, like even when it is claimed that they are on the SSD.
March 19th 20 at 08:31
Little data!
What size base?
What is the CPU load?
Which processors the host (vps)? Can a weak frequency and architecture
If the database fits in RAM?
What settings MariaDB?
That means several times more slowly? It is on the eye, or are You on the page show the number of DB queries and the time of the request.
The problem in the database? With the rest you sure you're okay? Web server, caching,.. all set? The firewall is configured? The system is optimized?
Load average does not exceed 15%, the processors 4 X QEMU Virtual CPU version 2.5+ 2099.998 MHz.
If the database fits in RAM? - I don't know if it is possible more in detail as proveriti.
What settings MariaDB? - run mysqltuner waiting for 24 hours smotet.
Now the problem is one query which the old host were performed at 1C, and on a VPS 4C., check through phpmyadmin. - fae43 commented on March 19th 20 at 08:34
The size of the database can be viewed in the phpmyadmin. - armani_Metz commented on March 19th 20 at 08:37
@armani_Metz, 194.9 MB - fae43 commented on March 19th 20 at 08:40
The CPU is way weak, 15% is the max on a single core?
Settings: /etc/mysql/my.cnf
The database must be in memory, so the hard drive is not being. Try to repeat the same query multiple times.

Still, 4 times is too much. - armani_Metz commented on March 19th 20 at 08:43

Find more questions by tags UbuntuHostingMySQL