Score:0

MySQL CPU usage difference between my local server and Linode server

cn flag

I have 2 similar servers, one on my local computer, the other on Linode. OS is Ubuntu 20.04 LTS on both.

When I import a large database into MySQL, my local computer uses less than 10% of CPU while the Linode server uses 100% of CPU. So Linode server completes the import much faster than my local computer.

What configuration makes the difference?

ua flag
Which "import" mechanism are you using? What versions of MySQL? How big is the 'large' database?
Michael Hampton avatar
cz flag
And what are the CPUs?
cn flag
@RickJames: I created a backup file using mysqldump and import it using mysql command. The large database is about 1GB.
cn flag
I guess the problem was that the local computer uses an external HDD and the database backup file is on that. So reading the drive slows down. I need to verify my theory, though.
Score:1
ua flag

SSDs are on the order of 10 times as fast as HDDs. That does not directly explain "100% cpu". Instead, if the CPU @10% too 10 times as long (elapsed time), then that matches a CPU @100%.

cn flag
I confirm that the problem was slow drive. So I changed mysql data dir to SSD and now CPU is almost 100%. The HDD was the bottle neck.
ua flag
@SamKong - Now we can look at the query to see if a better index or better formulation would decrease the CPU. (I find that nearly all 100%-CPU queries can be sped up.)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.