Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many bans and gags - on player connected join lag #897

Open
armanossiloko opened this issue May 30, 2023 · 1 comment
Open

Too many bans and gags - on player connected join lag #897

armanossiloko opened this issue May 30, 2023 · 1 comment

Comments

@armanossiloko
Copy link
Contributor

A friend of mine runs a Left 4 Dead 2 10v10 versus server and the SourceBans database is filled with way too many bans and gags.

What happens?

With the number of bans being really huge, once a player joins the game, when SourceBans performs the check "how many bans and gags the player has", it lags the server out for about a second or two, most likely due to the query that is being executed not utilizing any indexes, because it uses regex to filter bans and gags.

SELECT COUNT(bid) FROM %s_bans WHERE ((type = 0 AND authid REGEXP '^STEAM_[0-9]:%s$') OR (type = 1 AND ip = '%s'))
UNION
SELECT COUNT(bid) FROM %s_comms WHERE authid REGEXP '^STEAM_[0-9]:%s$'

Any other comments?

One thing that seems to have fixed it for the server I mentioned above was to rewrite the sbpp_checker query that retrieves the number of gags and bans once a player joins the game.

@armanossiloko
Copy link
Contributor Author

I have made a PR based on what seems to have helped in this case. Another potential thing I can think of is creating an index on the type and ip column(s) in the sb_bans table. I haven't done that in the case of the #896 pull request

Hackmastr added a commit that referenced this issue Jul 10, 2023
…ization

Lessened server lag on player connect due to huge number of bans and gags #897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant