We haven't done any updates this week, running the v7.36, modules are up to date, but yesterday afternoon our site started sporaidically slowing down. I've traced a common factor to dozens of lingering MySQL queries:

DELETE FROM d7_semaphore 
WHERE  (name = 'variable_init') AND (value = '18075795085526f749129c00.11752612') AND (expire <= '1428617034.0762')

INSERT INTO d7_semaphore (name, value, expire) VALUES ('variable_init', '11057900385526f7f7a93874.13381311', '1428617213.0672')

Obviously the values vary, but they're all INSERTs and DELETEs to the semaphore table. Some quick Googling leads to several results saying not to use InnoDB for that table, however we've been using InnoDB for the whole database for years without issue. Some results also said the issue was addressed in Drupal 7 at some point.

I'm exhausting my troubleshooting ideas here and figured I'd shout out here to see if anyone could shed some light on things.

Additionally, this has led me to create a read replica of our MySQL database with the intention of sending SELECTs to it. I added the replica to our settings.php file but haven't found a definitive way to tell Drupal to use the slave for reads... any help there is also appreciated!

Comments

nevets’s picture

Has your site traffic also increased?

cmarcera’s picture

According to Analytics, no - our traffic is consistently as it has always been. We are primarily an authenticated traffic website.

Jaypan’s picture

The first thing to do is to track down where in the code this is coming from. From there you can start to figure out why it's happening so often.