Custom plugin can use too many resources
-
I have created a plugin that works a lot like the search and replace plugins – it updates a bunch of posts at once. For a variety of reasons, I want to actually update the post via the wp_update_post function rather than do a direct update to the database. I’m using an ajax user interface to control the update flow – 10 posts are updated per ajax request until all posts are changed. Sometimes thousands.
The problem I’m running into is that on certain hosts the resource usage it too much to handle and after a certain number of updates something (the web server or the database) falls over. On many hosts, I don’t run into any issues. I’ve attempted to mitigate the problem (looking at the server load when it’s available and pausing until it lowers, pausing after a certain number of updates) but nothing has been fool proof thus far.
I’d love some opinions on if it would be possible to do these kind of updates in a resource efficient way or if the idea is doomed from the start? Thanks!
- The topic ‘Custom plugin can use too many resources’ is closed to new replies.