MT Background Processing Limitations

By Deane Barker on September 7, 2004

One of the cool new things in Movable Type 3.x is that it forks processes to do stuff in the background. For instance, if you save an entry, you don’t have to wait for it to rebuild. MT runs the rebuild process in the background, and the entry quietly rebuilds within 30 seconds or so of you saving the entry and returning to the menu screen.

However, this morning I was mass deleting 60+ comment spams (another great new feature: search for comments by IP). MT 3.x is automatically rebuilds the entry when you delete a comment (great improvement, BTW), so 60+ entries were rebuilding at the same time in the background.

Now, we all know that MT isn’t terribly efficient with the database calls (doesn’t have to be when it’s write-one, read-many), so the database must have been getting hammered while these entries were rebuilding.

I made a change to another entry, tried to save it, and got this:

Got an error: Bad ObjectDriver config: Connection error: User [removed]@localhost has already more than ‘max_user_connections’ active connections

A small price to pay for background processing, but they probably should have trapped the error. Now I’m left wondering how many of my entries actually rebuilt, and how many died in process due to this error. Since they were being rebuilt in the background and thus wouldn’t display an errror, I may never know.

The solution: Rebuild All Files. My hosting company must hate me.

Gadgetopia

Comments

  1. A small price, but more than you should have to pay: it’s just doing the fork() in the wrong place. 3.1 forked in rebuildentry, so if you just call that once, life’s good and you get control right back, but if you have an array of 60 entries, and you run through them calling rebuildentry, then you spawn off 60 processes, and are lucky to have the database limits to clobber most of them, before they take your whole server down. Bring on 3.12! (BTW, 3.11 doesn’t fork() on rebuild_entry, so an upgrade ought to cure that problem, even though it will also “cure” the way MT returns so quickly when you save an entry.)

Comments are closed. If you have something you really want to say, email editors@gadgetopia.com and we‘ll get it added for you.