-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
The server gets berserk on CPU and RAM out of nowhere #70
Comments
Actually, I noticed the same thing, "connection lost" all the time. But I can't imagine what would've possibly broke things on my side. Apparently the last update to KF2 was on Feb 2nd: https://steamdb.info/app/232090/patchnotes/ So it shouldn't be that either I guess? I tried skipping the UKFP mutator, but that didn't solve it for me. Will keep you updated if I find out the cause, please do the same. |
Well the error diasppeared after a longer time. It took longer than expected. It is downloaded. False alarm.
|
OK, I found what causes the behavior. |
Huh, so maybe that's why I saw lot of discussions about DDoS protection on the TWI forums... So maybe we're being flooded with bullcrap? It'd be explained by the fact that my new server was usable the other day. Whatever the case, implementing rate limits on the exposed port would be a good idea, so I'll see what I can do about it. |
And also thanks a lot for your reports! |
Yes, it can be some kind of DDoS. Firewall solution (if even possible) is just a workaround. Thank you for the info, I'll try it later, I am going to bed now :) |
Unfortunately in this day and age DDoS protection is not optional :) I already have something in my mind - rate limit for connections on KF2 ports, then log with firewalld the ones that got rejected, and then fail2ban those IPs for a day or so. |
There is a solution. Updated today. I still think TWI should resolve it on KF2 server side, but probably plain hope since the problem started in 2021. |
OK, so I installed needed packages:
after that run these commands (I use default port 7777):
and finally allow desired ports, for me they are:
Restart the firewall and done: tl;dr, it works. There is still overhead, but the server is usable and my friends can connect. According to the author, the banlist is persistant, so maybe there will be less overhead in the future, when the banlist is more complete. |
Permanently banning IPs is not a good idea in general, since public IPs often change hands. I'm trying to implement some kind of rate limiting. Will get back to you soon. |
This is an initial stab at it, for now it seems to be working but will find out in the coming days. As for you, you already made several manual changes, so I'm afraid there's no easy way to test this, since your changes will probably interfere. |
Things kinda settled down I think, so if you get the chance to test it out from scratch sometime, please report back :) |
For the record, these are valid issues as well, please see #72 and #75. But they're unrelated to the CPU/RAM problem. |
Hi, I tried your workaround long term and I hate to write that, but your solution does not work for me well.
For the record, I do those tests on my workstation with Ryzen 5 5600H, so there is not a lack of resources. |
Thanks for your response! Uh, yeah, maybe I was a bit foolish to take an nginx reverse proxy for granted. If webadmin is slow, then you're probably hitting the rate limits over HTTP. Would you be so kind as to reinstall and retry with the rate limit increased to dunno, maybe 50/m? Here: https://github.com/noobient/killinuxfloor/blob/master/roles/install/tasks/firewalld.yml#L45 |
Increasing to 50/m did not help much. The delay is unbearable, the chat console sometimes come to life though. |
I probably should have posted earlier in this thread. But anyway, for the last few months I've had my rate limit set at 20/m and seems like a more sensible value than default 10/m. I found with 10/m I was personally hitting the rate limit. I think this was in KF2 client I was adjusting search parameters in the server browser probably hitting refresh a few times and my server didn't show up until I left it for a minute. I've had a friend report a similar issue even with 20/m - I think he was similarly adjusting parameters and spamming refresh. Which makes me think, should the limit be even higher than my 20/m? Apart from a single person coming from a single IP, my thinking is there could be some people trying to join our servers at LAN parties on a shared IP address and would hit the limit trying to search for the same server at the same time. Could be also some people on shared IP via CGNAT - but I'd think given small KF2 population that would less likely than a LAN party environment, but still possible. So perhaps some sort of temporary IP ban might be worth considering when hitting a higher limit? Below are DDOS stats from one of my servers. There's only a relatively small number of IPs being hit compared to the number of overall requests. Today's DDoS stats:Denied packets: 2,564,918 |
Hi, yeah the 10/m is too low as my own server kicked me out a few times :P
|
@triuk - Regarding your second point with web admin, I might be able to provide some guidance. From your earlier post you mentioned port 8080, so it sounds like you're exposing web admin to the Internet over HTTP? If so, I highly recommend against this. What you need to do is set up a reverse proxy, ideally with HTTPS. I'm using NGINX as a reverse proxy with HTTPS. It's not that hard to set up and I can provide with some of my setup notes if you're interested? |
Lets continue in the discussion: #83 (comment) |
Hi, I do not know what changed, but even after a clean install, the CPU hits 100 % and RAM is consumed +30 MB/s. The game runs, but unplayable in these conditions and the server is not responsive after a while anyway.
Do you experience similar issue?
I tried to revert back to
b2e4e04b2763604b4e3cedd5241cd123f3a84fe3
with
but it is the same (can I revert previously installed version this way?).
Before I start doing some tests, I'd like to make sure everything is fine on your side.
The text was updated successfully, but these errors were encountered: