My SourceBans module causes massive lag on some servers.

I’ve been working for a while on an implementation of SourceBans in Lua. I’ve managed to get it from messy PoC to clean working module with very few problems on my local server, where it performs beautifully.
However, as soon as I toss it onto my normal server, it starts to lag out to about 1.5 FPS and no one can join.
I’ve had a good look, and I can’t see any reason why. Any help?

~ Sourcebans Setup Example ~
~ Lexi ~
sourcebans.SetConfig(“hostname”, “localhost”);
sourcebans.SetConfig(“username”, “root”);
sourcebans.SetConfig(“password”, “”);
sourcebans.SetConfig(“database”, “sourcebans”);
sourcebans.SetConfig(“dbprefix”, “sbans”);
sourcebans.SetConfig(“portnumb”, 3306);
sourcebans.SetConfig(“serverid”, 1);

Had a quick scan through the code, nothing obvious. The sourcebans database is on the same box as the server, yeah?

Actually I think it’s off on some kind of cloud host somewhere, but I used the same database for testing locally.

I would suggest a mysql module that isn’t so complicated, but I also see that you’re calling

local status = database:status();

Every tick, which will call mysql_ping. That’s blocking.

status function on a database on MySQLOO lags very badly, dont use it

I see, thank you. I will change that to a 5 minute timer.