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

Hibernation mode #826

Open
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@ensiform

This comment has been minimized.

Show comment
Hide comment
@ensiform

ensiform Apr 6, 2016

Member

Please don't store the cvar old value in a std::string

Plus you didn't include !

Cvar_SetValue does exist so you can save values. Might be better to not make extra globals and put them in a server structure. It's still very hackish to actually change the sv_fps value though. It may trigger issues with the client snaps limiting to server fps.

I would hold off on merging this right now because there's a patch for com_dedicated_sleep that may also be useful.

Member

ensiform commented Apr 6, 2016

Please don't store the cvar old value in a std::string

Plus you didn't include !

Cvar_SetValue does exist so you can save values. Might be better to not make extra globals and put them in a server structure. It's still very hackish to actually change the sv_fps value though. It may trigger issues with the client snaps limiting to server fps.

I would hold off on merging this right now because there's a patch for com_dedicated_sleep that may also be useful.

@ensiform

This comment has been minimized.

Show comment
Hide comment
@ensiform

ensiform Apr 6, 2016

Member

Just add a float of the old value instead of the string???

Member

ensiform commented Apr 6, 2016

Just add a float of the old value instead of the string???

@Caelish

This comment has been minimized.

Show comment
Hide comment
@Caelish

Caelish Apr 7, 2016

I can't comment on code quality, but since I asked @EpicLoyd to code this, I figured I'd give a little bit of background.

What this does is reduce sv_fps to 1 when a server doesn't have any humans online for sv_hibernatetime seconds, then revert it to the previous value when a human connects. It saves a lot of CPU for servers which run a lot of bots, or when a lot of different servers are hosted on a single machine, as is the case with my hosting. I've been running it in production without any issues for several days on 30ish instances of openjkded.i386.

Here is the impact it had on one of my servers:
eu
(disregard the CPU spikes - those are a daily backup cron job)

Afaik, client snaps will not be limited unless sv_snapsmax is set, and as said, I haven't received any reports of issues about this whatsoever. By default, sv_hibernatetime is 0, so the server does not hibernate at all unless the server owner sets it to.

Caelish commented Apr 7, 2016

I can't comment on code quality, but since I asked @EpicLoyd to code this, I figured I'd give a little bit of background.

What this does is reduce sv_fps to 1 when a server doesn't have any humans online for sv_hibernatetime seconds, then revert it to the previous value when a human connects. It saves a lot of CPU for servers which run a lot of bots, or when a lot of different servers are hosted on a single machine, as is the case with my hosting. I've been running it in production without any issues for several days on 30ish instances of openjkded.i386.

Here is the impact it had on one of my servers:
eu
(disregard the CPU spikes - those are a daily backup cron job)

Afaik, client snaps will not be limited unless sv_snapsmax is set, and as said, I haven't received any reports of issues about this whatsoever. By default, sv_hibernatetime is 0, so the server does not hibernate at all unless the server owner sets it to.

@ensiform

This comment has been minimized.

Show comment
Hide comment
@ensiform

ensiform Apr 7, 2016

Member

I also think the chrono lib can be avoided since there is already timer functions using milliseconds in the engine.

@Caelish the code quality is important for here though too so we should make sure it's up to par before merging.

Member

ensiform commented Apr 7, 2016

I also think the chrono lib can be avoided since there is already timer functions using milliseconds in the engine.

@Caelish the code quality is important for here though too so we should make sure it's up to par before merging.

@Caelish

This comment has been minimized.

Show comment
Hide comment
@Caelish

Caelish Apr 7, 2016

@ensiform I completely agree. Wasn't trying to imply otherwise, sorry if it came across like that. I do realise the importance of good code, I just don't know any C (or C-ish languages) and thus can't say anything sensible about code quality here. =P

Caelish commented Apr 7, 2016

@ensiform I completely agree. Wasn't trying to imply otherwise, sorry if it came across like that. I do realise the importance of good code, I just don't know any C (or C-ish languages) and thus can't say anything sensible about code quality here. =P

@AlexCSilva

This comment has been minimized.

Show comment
Hide comment
@AlexCSilva

AlexCSilva Mar 7, 2017

Is this still wip?

AlexCSilva commented Mar 7, 2017

Is this still wip?

@ensiform

This comment has been minimized.

Show comment
Hide comment
@ensiform

ensiform Mar 7, 2017

Member

Caelum might use it but we don't. Too WIP and not very code style friendly.

Member

ensiform commented Mar 7, 2017

Caelum might use it but we don't. Too WIP and not very code style friendly.

@AlexCSilva

This comment has been minimized.

Show comment
Hide comment
@AlexCSilva

AlexCSilva commented Mar 8, 2017

Ah

@ensiform

This comment has been minimized.

Show comment
Hide comment
@ensiform

ensiform May 5, 2017

Member

I'd like to close this and have hibernation mode just be a long shot request issue instead.

Member

ensiform commented May 5, 2017

I'd like to close this and have hibernation mode just be a long shot request issue instead.

Bucky21659 added a commit to eternalcodes/EternalJK that referenced this pull request Oct 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment