Server lag when player is banned

So when we ban a player there is massive lag that will stop everyone for about 1 - 1.5 seconds. Obviously because we have a lot of bans. So my question is, Is the lag caused because the file writing & saving takes a long time since it has to read + write + save ~350kb?
Also would it help to put all the bans on a MySQL Database?

If it’s related to the file size you could move banned_users.cfg and use a few lines of Lua to automatically parse it when the server starts and add the old bans that way.

Then any new ones shouldn’t have to be added to the end of a gigantic file.

No guarantees your problem has anything to do with appending to the file though.

Well the thing about that is i have a custom ban message thing so when someones banned it will say when, by who, and why they were banned. And that would all disappear since the data on that stuff wouldn’t be saved.

It’s just ULX. It has to process the steamid and ban it from entering.

I completely believe you… I tested spam-appending 1kb to a 5mb file and didnt feel the slightest nudge.