Update3: The problem never stayed away, and got worse. I tried upgrading to Drupal 6.x, but our hosting has such an old version of MySQL that we can’t run Drupal 6.x. I then tried a fresh installation of Drupal 5.x, fetching the current version of every module we need, and enabling things gradually. So far, things are pointing at the search module again, but I only stopped the problems by deleting the search module and emptying all the search tables. Disabling the module didn’t stop lots of locked processes updating the search_index table. We’ll see how things go from here, then.
Update2: Running without the Image module didn’t fix it – it happened again. We now have the Image module enabled again, and a few other modules disabled. PathAuto is included in this lot, as I’ve heard it can have performance issues with a lot of paths (we have over 1,000). If things stay stable this way, I’ll probably try updating PathAuto to the latest version and enabling it again.
Update: This turned out not to be the case at all. The next batch of images I uploaded were ok, but the next after that caused the same locking problems without the search module running. I’m just going to abandon the image module for now, and maybe have another go when we upgrade to Drupal 6.x.
A GoogleFood post – there’s probably nothing of interest here, unless Google has brought you to this page when you’re trying to work out why Drupal keeps making your server crash, run very slowly, etc, after you’ve added a batch of images.