Why does spring 103 dedicated use so much cpu?

Why does spring 103 dedicated use so much cpu?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

It's sole job is to pass along network traffic. Why, during a game, does it reach 100% usage of a core? Why is it using any cpu at all. I would understand network traffic, but it supposedly isn't even running sim, so why is it using any notable amount of CPU to begin with?
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Why does spring 103 dedicated use so much cpu?

Post by Silentwings »

If this issue was happening for everyone in 103, I imagine autohost owners would have noticed it some time ago -> its probably just you.

If you are compiling for yourself, perhaps it is related to the boost bug mentioned in https://springrts.com/mantis/view.php?id=5151. It it's not that -> bug report.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

It has been an issue on Windows ever since I can remember.

My ass servers were constantly pegged at 100%, I just didn't care because that's all they were there for. Now that it's no longer on AWS I care again because the server that hosts them does more than just that.

Again, why is it using 100%. That should NEVER happen. So, I ask again, why?

Is it Windows specific? I don't have any ability to test with a nix host, so I don't know the answer to that.

Even more irritating is people telling you it isn't an issue who don't run any servers of their own so therefore don't see the process pegging max CPU when a game gets a lot going on in it.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: Why does spring 103 dedicated use so much cpu?

Post by Super Mario »

The why part is simple, it's doing meaningless work. The why and how part is a whole different matter.
You need to profile it, to see where the cpu is spending the most time on.
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: Why does spring 103 dedicated use so much cpu?

Post by ThinkSome »

I run autohosts on GNU/Linux and have not noticed them going past maybe 1-2% CPU use.

Server-side spring can run in two modes: dedicated and headless. The first is a simple relay and the second runs full sim (used for server-side bots and such). It might be that yours is compiled/runs in headless mode.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

No, it is very much spring-dedicated. I'm starting to think that dedicated for windows just sucks ass.
sprunk
Posts: 101
Joined: 29 Jun 2015, 07:36

Re: Why does spring 103 dedicated use so much cpu?

Post by sprunk »

ZK uses dedicated for Windows and it doesn't seem to suck ass. Perhaps ask someone with ZK server access to compare the setup.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: Why does spring 103 dedicated use so much cpu?

Post by Super Mario »

*Ahem*
You need to profile it, to see where the cpu is spending the most time on.
You can't fix something if you don't know what exactly the problem is.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Why does spring 103 dedicated use so much cpu?

Post by dansan »

Super Mario wrote:*Ahem*
You need to profile it, to see where the cpu is spending the most time on.
You can't fix something if you don't know what exactly the problem is.
He doesn't need to fix it - just find out the routine that is consuming most of the CPU time.
With that a decent mantis entry can be made.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Why does spring 103 dedicated use so much cpu?

Post by Kloot »

That routine would be sleep().

103.0's game server can (under specific conditions, due to an oversight) execute sleep by way of a yielding loop, which is great for most engine threads but not so great for the DS. Use the spring-dedicated binary from a development build if it really matters, CPU's have cores to spare these days.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: Why does spring 103 dedicated use so much cpu?

Post by Super Mario »

dansan wrote:
Super Mario wrote:*Ahem*
You need to profile it, to see where the cpu is spending the most time on.
You can't fix something if you don't know what exactly the problem is.
He doesn't need to fix it - just find out the routine that is consuming most of the CPU time.
With that a decent mantis entry can be made.
https://en.wikipedia.org/wiki/Generic_you
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

Kloot wrote:That routine would be sleep().

103.0's game server can (under specific conditions, due to an oversight) execute sleep by way of a yielding loop, which is great for most engine threads but not so great for the DS. Use the spring-dedicated binary from a development build if it really matters, CPU's have cores to spare these days.
Thanks :-)

DS from dev builds can be used with 103? 103 DS will happily chew through multiple cores at 100% usage at times, that's the biggest part of the problem. Ingame, it translates into feeling extremely laggy.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Spring Dedicated CPU usage... WTF?

Post by Forboding Angel »

Why?
Image

Clipboard01.png
(32.8 KiB) Not downloaded yet
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

Using a newer dev build failed miserably.

What should I do?
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: Why does spring 103 dedicated use so much cpu?

Post by ThinkSome »

How did it fail? Perhaps backport the fix to 103.0?

I believe those Zero-K people are also running servers on Windows, perhaps ask them?

Alternatively, there is always the option of switching to GNU+Linux, or maybe make a GNU+Linux VM....
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Why does spring 103 dedicated use so much cpu?

Post by Kloot »



these probably won't be very effective prior to e209249082 (and might not work at all if the issue here is tied to the specifics of your system), but you can try setting different values for ServerSleepTime and see how they correlate with CPU usage.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Why does spring 103 dedicated use so much cpu?

Post by Forboding Angel »

Does Spads even have the capability to utilize the commandline params?
Post Reply

Return to “Help & Bugs”