Delete many users

Is there an efficient way of deleting thousands of users?

I have an open server which allows anonymous users and thus need to delete a lot of accounts regularly since all old anonymous accounts stack up.

Deleting users seem to freeze the server completely as soon as more than just a handful of users are deleted. I use quite a large server and RC normally consumes around 10% CPU and 20% memory. But as soon as I start deleting users the CPU spike above 100% and the chat becomes unusable. I estimate that the chat freezes after deleting around 50 users, and I need to delete at least 50000 users right now and the number just keeps growing.

This is obviously unsustainable for anyone with a fairly large user base and I will most likely have to switch away from RC sooner or later. Is there anyone who’s found a way to do this?

Just wanted to dump this and see if anyone has found a solution for this?