I tried to run a data migration query on a live database server, and after a minute, I could not connect to MySQL via the command line due to "Too many connections." I had to kill the query and restart MySQL. I won't try to run such a query on a live system during the day, again :)

This same query took less than two minutes on very low-traffic copy of the production server, finishing fine.

Is it likely that the traffic to the server would have made this query stall?


I have a hunch that the problem you ran into was related either to FLUSH TABLES or LOCK TABLES, presuming you are using mysqldump or something similar to do your migration. mysqldump without throwing --single-transaction presumes a MyISAM table type and locks the table to prevent any new writes while dumping so that you get a consistent snapshot. If you are using InnoDB tables and turn on --single-transaction then one of the first queries that is executed is flush tables which closes and reopens all the tables in the database so that you get a consistent snapshot across tables. Either can cause incoming queries to pile up waiting for locks to free but probably wouldn't be noticeable on your lightly loaded replicant.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.