For detailed context, see the parent task, T246539.
This is a maintenance script that will update lots of rows in the abuse_filter_log and text tables -- roughly all rows in the abuse_filter_log table are updated, and ~75% of that number of text rows. The script (source) runs in batches of 500 rows, and waits for replication to catch up.
However, it takes quite a long time to run: on mediawikiwiki, it took 20 minutes to update 140k text rows and 186k abuse_filter_log rows. On wikis like enwiki, where the abuse_filter_log has over 20M rows, this script would take over a day to complete. This doesn't look great, so I'm looking for ways to reduce the pressure on servers & LBs.
Some ideas include changing the batch size, or making it sleep between batches, or spawning & killing it periodically. What do DBAs recommend here?