Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
CREATE TABLE IF NOT EXISTS `music_batch_song` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `music_batch_id` bigint(20) DEFAULT NULL,
  `song_id` bigint(20) DEFAULT NULL,
  `comment` varchar(10) DEFAULT NULL,
  `position` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `music_batch_song_idx` (`music_batch_id`,`song_id`),
  KEY `song_fk` (`song_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=142506 ;

I have this table that counts about 90k records on a mysql db on amazon aws. Yesterday after a couple of hours of very slow simple inserts (hundreds of them) the db stopped responding to inserts via PHP PDO. After a mysql server restart it was working again. Do you have any idea how this can happen? The server was almost inactive when the problem came up. And a single one-row PDO insert query couldn't reach the end. The insert was something like: "INSERT INTO music_batch_song (music_batch_id, song_id) VALUES (188, 32866)". After server reboot the query took a fraction of second as usual...

share|improve this question
    
From your description, looks like either due to bad configuration or hardware limits, you are at the end of what MySQL can handle. error_log in the mysql directory can perhaps provide some clues. –  Sukumar Jul 9 '11 at 12:25
add comment

1 Answer

Dig up the mysql logs. Chances are it'll show a deadlock or some other InnoDB error. Deal with it as appropriate.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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