csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

[CS2 Dedicated Server] UNEXPECTED LONG FRAME DETECTED

Open drakin003 opened this issue 1 year ago • 68 comments

Hi,

My Counter-Strike 2 server is experiencing "UNEXPECTED LONG FRAME DETECTED" errors, causing the server to lag.

VPS specs: CPU: Intel Xeon W-2195 (4 cores assigned to the server) RAM: 32GB (8GB assigned to the server) OS: Ubuntu 22.04 LTS Third-party plugins: Metamod (version 2.0.0-dev+1289) & CounterStrikeSharp (v217)

Error in console: 620.974098 UNEXPECTED LONG FRAME DETECTED: 20.85ms elapsed, 0.20ms sim time, 1 tick, 39829..39829. 637.097664 UNEXPECTED LONG FRAME DETECTED: 19.39ms elapsed, 0.15ms sim time, 1 tick, 40861..40861. 641.053174 UNEXPECTED LONG FRAME DETECTED: 21.79ms elapsed, 0.25ms sim time, 1 tick, 41114..41114. 650.144947 UNEXPECTED LONG FRAME DETECTED: 19.78ms elapsed, 0.15ms sim time, 1 tick, 41696..41696. 653.088026 UNEXPECTED LONG FRAME DETECTED: 25.40ms elapsed, 0.12ms sim time, 1 tick, 41884..41884.

drakin003 avatar Feb 21 '24 01:02 drakin003

Do you have same problem on "Vanilla" server without any modifications like MetaMod & CounterStrikeSharp?

t0ssox avatar Feb 21 '24 18:02 t0ssox

@t0ssox I have the same problem . I have tested both scenarios . With or without plugins and the issue exists . This also happens on Valve servers and they don't have any plugins . It's an issue with the game . After the call to arms update , I started noticing this . That update has ruined my fps . from 300 to 180 and it's decreases to 100 in or near smokes .

RAM : 16 GB ddr4 3200 CPU : 8 Cores @3.20 Ghz Drive : SSD NVMe

OS : Ubuntu 22 Server using Generic Kernel latest version .

lostsoul6 avatar Feb 21 '24 21:02 lostsoul6

Could you read README.md from this repo and post your system information and runtime information to gist? This could help developers better understand your problem.

t0ssox avatar Feb 21 '24 22:02 t0ssox

Do you have same problem on "Vanilla" server without any modifications like MetaMod & CounterStrikeSharp?

only happens when there are 10 to 12 players in server even on new net graph it says Slow server frame

its working fine on a end cpu(i7 10700) but i have xeon server machine i think this is optimization problem, W-2195 is not really a low end cpu, it should be able to handle it even with 4cores assigned to it

Could you read README.md from this repo and post your system information and runtime information to gist? This could help developers better understand your problem.

i don't think windows info will be any help here, since its about linux server

drakin003 avatar Feb 22 '24 02:02 drakin003

Same question and still not getting solved in Windows

Ahahahaaaa1 avatar Mar 10 '24 09:03 Ahahahaaaa1

Yep, i got same error too.

abdulbakiaydogan avatar Mar 10 '24 09:03 abdulbakiaydogan

Same error, any updates?

GreathostRo avatar Mar 11 '24 23:03 GreathostRo

Same error here, Debian 12, console is spammed with messages. Vanilla server (no plugins) and empty (no bots). Can we somehow debug or provide some useful information from what is causing this thing?

axl303 avatar Mar 18 '24 17:03 axl303

Got same errors while running CS2 server on Debian OS cloud server. It seems that the CPU frequency is too low for current version, optimization is urgently needed.

ImmortalSaga avatar Mar 19 '24 06:03 ImmortalSaga

I'm getting "UNEXPECTED LONG FRAME DETECTED" quite often on my private server. It's a server I maintain for my colleagues to play on once a week, so it doesn't really see much load. Even after I increased server's resources from 2cpu+4gbRam to 4cpu+8gbRam I still see the errors, and it even felt like error frequency increased (just a theory, but it could be a race that is triggered more frequently on a faster machines?). I can see these messages even when I play with 9 bots on the very same server(regular 5v5).

Server does not have any mods installed. The only modified files are gamemode_casual.cfg and gamemodes_server.txt where I tuned minor things like start money, kill rewards, bot difficulty, etc. All I'm trying to say is that server is pretty much vanilla.

I've been writing server's output to log files. In case you think they can be of use I would be more than happy to upload them for you. Got plenty of occurrences:

# grep -caR "LONG FRAME DETECTED" | grep -v "\:0$"
serverlog-24_03_07-15_00:301
serverlog-24_03_19-15_00:450
serverlog-24_03_06-15_00:469
serverlog-24_02_23-12_21:5370
serverlog-24_03_15-15_00:430
serverlog-24_03_24-15_00:468
serverlog-24_03_20-15_00:399
serverlog-24_03_17-15_00:485
serverlog-24_03_11-15_00:384
serverlog-24_03_23-15_00:1252
serverlog-24_03_18-15_00:582
serverlog-24_03_24-18_00:13
serverlog-24_03_09-15_00:2370
serverlog-24_03_04-15_00:471
serverlog-24_03_21-15_00:338
serverlog-24_03_08-15_00:422
serverlog-24_03_10-15_00:421
serverlog-24_03_13-15_00:473
serverlog-24_02_16-13_07:5144
serverlog-24_03_24-20_00:134
serverlog-24_03_22-15_00:293
serverlog-24_03_02-15_00:53
serverlog-24_03_24-17_45:121
serverlog-24_03_03-15_00:535
serverlog-24_02_09-19_41:143
serverlog-24_03_12-15_00:546
serverlog-24_02_09-19_46:23
serverlog-24_03_05-15_00:497
serverlog-24_03_01-20_45:9778
serverlog-24_03_14-15_00:574
serverlog-24_03_16-15_00:1752
serverlog-24_03_02-12_18:2257

pvokhmyanin avatar Mar 25 '24 11:03 pvokhmyanin

I have the same issue on amd system.

AMD EPYC 7282 64GB RAM NVME Ubuntu 20.04 with default kernel.

Problem seams to be thread starvation, i tried to give full priority to any process i run from cs2server user but its all the same. Also every few hours there are huge memory leaks, because one instance of the CS2 server eats up to 40GB of RAM.... Probably something wrong with system scheduler or something. Idk what else could cause this behaviour.

zarkostrelec avatar Mar 27 '24 06:03 zarkostrelec

Same issue:

Start script: ./cs2 -dedicated +map de_dust2

Server specs: AMD EPYC 7282 4 vCPU VM 8GB RAM NVME Debian 12

Problem occurs even without players connected, still CPU and RAM usage stays low (CPU below 50%, RAM below 4G) even with all 10 players connected

Fedot-Compot avatar Apr 01 '24 16:04 Fedot-Compot

Same issue as above, I changed "setting.fullscreen_min_on_focus_loss" "0" as a workaround fix

DesmondOK avatar Apr 02 '24 21:04 DesmondOK

Same issue as above, I changed "setting.fullscreen_min_on_focus_loss" "0" as a workaround fix

i dont think so, since this is a client command and have nothing to do with a dedicated server. or does it?! there is no cs2.video.txt config for a server side...

zarkostrelec avatar Apr 04 '24 05:04 zarkostrelec

Having the same issue with server running on Docker in Debian 11 that running in Hyper V on Windows 11 Pro, server may act properly if I restart it, after around 10 min of playing around it would start showing.. CPU for the server is I7 8750U, old but still should run a proper server.. tried without any plugins and with plugins everything the same... ;/

yeheskel2016 avatar Apr 10 '24 05:04 yeheskel2016

Having the same issue with vanilla server hosting workshop maps running in Debian. The server will report the error immediately upon the start:

0.102357 UNEXPECTED LONG FRAME DETECTED: 24.07ms elapsed, 0.18ms sim time, 1 ticks, 100..100. 4.170711 UNEXPECTED LONG FRAME DETECTED: 29.92ms elapsed, 0.25ms sim time, 1 ticks, 360..360. 16.327092 UNEXPECTED LONG FRAME DETECTED: 31.24ms elapsed, 0.18ms sim time, 1 ticks, 1137..1137.

jeffzhkw avatar Apr 10 '24 13:04 jeffzhkw

In my case, this long frame spamming will print to server log per 30 seconds. Even this server its nobody in game and no bots, empty server. image

CeLicat avatar Apr 13 '24 03:04 CeLicat

In my case, this long frame spamming will print to server log per 30 seconds. Even this server its nobody in game and no bots, empty server. image

the game is so unoptimized that mid range cpu's can't handle server load, get a 5.0ghz cpu to run a cs2 server lol

drakin003 avatar Apr 17 '24 12:04 drakin003

There must be some optimizations that can be done, the problem is that no one says anything and there is no official documentation on the internet.

I managed to get rid of these warnings in the console but I think that since I made the changes I woke up with another problem, once every 1-2 days the server goes really bad, I go on it and the player moves in the replay, it has to be restarted the server, after the restart works fine again for 1-2 days.

GreathostRo avatar Apr 17 '24 14:04 GreathostRo

There must be some optimizations that can be done, the problem is that no one says anything and there is no official documentation on the internet.

I managed to get rid of these warnings in the console but I think that since I made the changes I woke up with another problem, once every 1-2 days the server goes really bad, I go on it and the player moves in the replay, it has to be restarted the server, after the restart works fine again for 1-2 days.

Exactly same thing I experience, I set the CPU to work in performance mode (high frequency) and it reduced a bit that message outputting, but what you saying about the server going really bad (like if you will try to move it would shutter/glitch) after a day two of staying active is exactly what I have, my only workaround is setting a cron job to reset the server every day in 3 am, and that's "getting rid" of this issue, however still making zero sense why it's happening, hopefully any valve devs here aware of it.

yeheskel2016 avatar Apr 17 '24 17:04 yeheskel2016

There must be some optimizations that can be done, the problem is that no one says anything and there is no official documentation on the internet.

I managed to get rid of these warnings in the console but I think that since I made the changes I woke up with another problem, once every 1-2 days the server goes really bad, I go on it and the player moves in the replay, it has to be restarted the server, after the restart works fine again for 1-2 days.

you can also change map to fix this problem, no need to restart server

drakin003 avatar Apr 18 '24 09:04 drakin003

Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/3681#issuecomment-2063478663

Thanks for the answer, do you know the cause and possibly a solution?

GreathostRo avatar Apr 18 '24 18:04 GreathostRo

There must be some optimizations that can be done, the problem is that no one says anything and there is no official documentation on the internet.

I managed to get rid of these warnings in the console but I think that since I made the changes I woke up with another problem, once every 1-2 days the server goes really bad, I go on it and the player moves in the replay, it has to be restarted the server, after the restart works fine again for 1-2 days.

what did you changed to get rid of these warnings?

DollC avatar Apr 19 '24 16:04 DollC

If you believe me, I'm not even sure anymore that I made a bunch of changes but I'm still not satisfied.

It might be from sv_clockcorrection_msecs, I set it to 15, default is 30.

GreathostRo avatar Apr 19 '24 17:04 GreathostRo

Same issue here, on Debian 12.

Mecha-Weasel avatar Apr 27 '24 23:04 Mecha-Weasel

I managed to get rid of these warnings in the console

Care to share how?

Mecha-Weasel avatar Apr 27 '24 23:04 Mecha-Weasel

As I mentioned above, I set sv_clockcorrection_msecs to 15 (default is 30) but I'm not sure if that's the only change that helped remove those console messages because I made several changes.

GreathostRo avatar Apr 28 '24 18:04 GreathostRo

I can't say if it's related to the topic of discussion, but the same error is spamming in the console, and some players complain that their teammates are lagging, specifically teammates, not enemies or themselves. Also, there are stutters when observing other players. The hardware is more than sufficient; there are barely any loads on it.

characharm avatar Apr 28 '24 21:04 characharm

I had the same issue on my Windows server I switched the CS server to Linux and now I don’t get the warning. I used the same configuration.

ParadoxLeon avatar Apr 29 '24 09:04 ParadoxLeon

I can't say if it's related to the topic of discussion, but the same error is spamming in the console, and some players complain that their teammates are lagging, specifically teammates, not enemies or themselves. Also, there are stutters when observing other players. The hardware is more than sufficient; there are barely any loads on it.

yea same cpu is not even close to full load and it lags like server is running on core 2 duo or something

drakin003 avatar Apr 29 '24 09:04 drakin003