Georg Jähnig
Georg Jähnig

Reputation: 799

MySQL: Same my.cnf, 3x slower

I am moving a PHP/Drupal/MySQL website from a virtual to a dedicated server. Weirdly, the site is much slower on the dedicated server. I could narrow down that the difference is likely caused mostly by MySQL with the following test.

A file test.sql contains 50.000 lines of:

 SELECT id FROM foobar WHERE bar = 'baz';

(The query returns 0 lines.)

Now, $ time cat test.sql | mysql shows me

        virtual     dedicated
real    0m2.193s    0m7.322s
user    0m0.574s    0m2.600s
sys     0m0.440s    0m2.558s

So on the dedicated server, the query takes more than 3x longer. I also compared my.cnf from both servers, they are identical.

Is there anything else that could cause the difference?

BTW: The dedicated server comes with this hardware. Both servers run on Ubuntu 14.04.

$ mysql --version returns

Upvotes: 0

Views: 67

Answers (1)

Caleb Pitman
Caleb Pitman

Reputation: 1165

Since foobar is an empty table, it's not a memory problem.

The dedicated CPU is incredibly wimpy. If you're coming from a decent cloud like AWS, I would bet it's CPU speed.

EDIT: http://www.cpubenchmark.net/cpu.php?cpu=Intel+Atom+S1260+%40+2.00GHz

Upvotes: 1

Related Questions