FAForever / java-ice-adapter

A P2P connection proxy for Supreme Commander: Forged Alliance using ICE
MIT License
5 stars 12 forks source link

High Cpu Usage #54

Closed mankinskin closed 8 months ago

mankinskin commented 8 months ago

Occasionally the ICE adapter takes extreme CPU resources. Last game with 12 players first I lost connection to a few players, then reconnected but my whole system was blocked by the ICE adapter. It was just during a regular game.

Sheikah45 commented 8 months ago

This should be fixed with 3.3.7

mankinskin commented 8 months ago

This should be fixed with 3.3.7

What was the problem?

Sheikah45 commented 8 months ago

There was a log statement that could get triggered and consume all the CPU cycles writing to the log

Brutus5000 commented 8 months ago

This log statement was there for 6 years and now it suddenly causes problems. I think it's and indicator to a bigger problem (packets length changed somehow), but it's impossible to see.

mankinskin commented 8 months ago

Maybe the log writes should be limited in general? The ICE adapter is crucial for performance, so maybe limiting the resources assigned to non-functional tasks should be kept below a threshold to keep it functional. The logs could just mention that there were too many messages to actually log them, which should already indicate a problem, but at least the adapter may still be able to run normally.

Something like a log buffer only writing to the file every few millis max?

mankinskin commented 8 months ago

This should be fixed with 3.3.7

To install this, can I just replace the old version in FAFClient/natives with the new jar file?

Sheikah45 commented 8 months ago

Yes but the new alpha client also uses it