Skip to content
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

Maxed CPU out on servers 1.10.2 #8

Closed
jprocket45 opened this issue Oct 30, 2016 · 25 comments
Closed

Maxed CPU out on servers 1.10.2 #8

jprocket45 opened this issue Oct 30, 2016 · 25 comments

Comments

@jprocket45
Copy link

jprocket45 commented Oct 30, 2016

my server starts then as im generating chunks the processor goes up then nobody can be on and it just keep the processor maxed out it never recovers. I am sure its this mod I installed 2 mods on my server Corosutil 1.1.9 and Zombie Awareness 1.20 this mod really doesn't like servers heh if I install Coros and weather mod server runs fine.

1.10.2
forge 2099

@jprocket45 jprocket45 changed the title Maxed CPU out on servers Maxed CPU out on servers 1.10.2 Oct 30, 2016
@Lanaess
Copy link

Lanaess commented Nov 19, 2016

I did a lot of testing and I made some progress that I hope will help point in to the problem with the CPU 100% usage with ZA on a MC server.

I initially tried wiping my server and installing from scratch using only MC, Forge and ZA. This still caused my server CPU to run at 100%. But what I did not notice right away was that the CPU would run at less than 3% if I did not connect to the server with a MC client. Once I connected, it would run at 100% and would not back down. I wiped MC from the server again to confirm my results.

The next step I took was to try and see what changed on the server after I connected. I tried removing cfg files and dat files, numerous restarts and reinstalls, but no change. But what did work was if I deleted the “world” folder, and restarted, the server would run at less than 3% again. After much testing on changed files in the world folder, I found that if I saved the mca files in the “region” folder from an install that was never connected to by a MC client, I could connect to the server with a client, shut it down, replace the mca files on the server and it would run normally as long as a client did not connect.

To summarize my findings, I believe that the mod is making changes to the world map (mca files)during a client (player) connection that is somehow causing the CPU usage.

To better confirm my findings, I did a complete wipe of MC on the server, reinstalled MC, Forge, ZA and connected to it with a MC client. As expected the server CPU ran at 100%. I then shut down MC and removed all traces of ZA, but kept Forge and the mca files. When I restarted MC, the CPU ran at 100%. I then shutdown MC again, replaced only the mca files, restarted MC. When I connected with a client this time, the CPU ran at less then 3%.

I hope this helps, please let me know if I can test or try anything else?

@LakMoore
Copy link

That last paragraph is very interesting. Not a test I would have thought to do myself.

@Lanaess
Copy link

Lanaess commented Nov 21, 2016

There is a additional piece I observed and need to share...
Right before the CPU pins itself, when I connect with a client, this line it printed on the console:

[Date/Time][Server thread/INFO] [STDOUT/]: [CoroUtil.pathfinding.PFQueue::139]: Initializing PFQueue

Now I want it to be clear that I have nothing to confirm that this is a problem except for that it initializes a second or two before the CPU maxes out. I just wanted to make sure that all information that I found was shared.

@jprocket45
Copy link
Author

jprocket45 commented Nov 21, 2016

I new of the issue but was not a big tester thanks for hopefully helping with this issue! hopefully its being looked into poor Processors are getting beatin down heh I feel better now that ever though since others are reporting this before I filed this and was wondering if it was just me.

@darkshadow1809
Copy link

Yeah I can't add this mod. even though its a very good mod. My CPU just maxes out so darn quick.. I am sorry to say I have to let this one go..

@jprocket45
Copy link
Author

well after the new update there is no fix it may of gotten worse actually I didn't even half to load in the server and its sky high on CPU usage just when starting it. :( Thanks again for all the hard work being put into this!

@Lanaess
Copy link

Lanaess commented Dec 31, 2016

I could be wrong but I don't believe v1.11.1 with the CPU fix was released yet. The code release notes state:

Attempting to fix #11 due to some weird case where endless chunkloading occurs between targets

So it is possible that we may have to wait for a future release to address this issue?

@jprocket45
Copy link
Author

oh i thought this kind of meant that Bugfix for reloading world causing high server cpu / crash well sorry if thats not what it meant just figured to update since there was a update....on that note I don't know if this is damaging to a CPU running as high as it is but till this is fixed will be removed unless clarified otherwise I feel this should be a top fix priority ( in my opinion ) I will leave it be at this. I just want to let it be known im not blaming anyone I love the mods made by Coro hopefully this can be addressed soon running almost max CPU is not good. Thanks again for you hard work!!

@darkshadow1809
Copy link

100% cpu 24/7 doesnt matter its more about if you can keep it under 70 degrees. If its above 95 its definitely hurtful to your CPU

@Lanaess
Copy link

Lanaess commented Dec 31, 2016

@jprocket45 I also did a full server wipe and installed the latest mod from http://coros.us and compiled the code from here, both gave me the same results, 100% CPU usage. Sorry I was busy and just got some free time to play a bit.

@jprocket45
Copy link
Author

its fine this is kind of serious and should be top priority people are using the mod and I understand the degree of CPU @darkshadow1809 I am not trying to be a jerk at all I am here to help and test but feel this should be number 1 issue taken care of nobody can really find any other bugs till this is fixed if they r im unsure how they are without risking damage....

@Lanaess
Copy link

Lanaess commented Dec 31, 2016

I run my server from a hosting service. I know most if not all monitor things like CPU usage, and if a server is running 100% all the time they will warn you, then throttle your VM's % access to the host processors to prevent it from taking away from the power on other clients. Since I don't want this issue, I am forced to remove Zombie Awareness from my server until a fix is found. Like I said in the past, I understand that this is not a easy issue to fix and I am more than happy to wait for a solution.

@Corosauce
Copy link
Owner

Currently uncertain if this is a lingering issue due to how events trigger for my new sound feature, or if this is a new cross mod conflict for large modpacks due to pathfinding no longer being threaded for my code.

I have added some configs to disable the sound features so I need you guys with the issue to test something for me.

  1. Wipe your configs in the config/ZombieAwareness folder
  2. Download and install this new build http://coros.us/mods/modsystem/dl/zombieawareness-1.10.2-1.11.2.jar
  3. Run mc to generate configs
  4. Close mc
  5. Open up config/ZombieAwareness/Features.cfg
  6. set soundAlerts to false, and soundInvestigates to false
  7. Run mc and see if the high cpu issue persists.

If the issue persists, let me know of all the mods you are currently using, and if the world isnt too crazy huge, link me a download to the world as well so I can test the exact same scenario you have, since I am unable to reproduce this issue myself.

@Lanaess
Copy link

Lanaess commented Jan 2, 2017

I followed the steps you provided above, no change in CPU usage. My next step was a wipe/reinstall of Minecraft, only mod is ZA, and still no change in CPU usage. The world is a fresh gen from install so I don't think it will help, but if you want a copy let me know?

@jprocket45
Copy link
Author

same as @Lanaess this was with no mods installed but Zombie Awareness I did the exact steps with fresh gen... just out of questioning is this effecting certain brand CPUs or something since not everyone is having this issue? just a thought highly doubt and i could be way off course... though also what ver of forge did you try it on lanaess? I see there was a new forge ver as of yesterday on 1.10.2 that I have yet to try, once again highly doubt it would be this just covering everything.

@Lanaess
Copy link

Lanaess commented Jan 2, 2017

Forge V. 2092

@Lanaess
Copy link

Lanaess commented Jan 2, 2017

Just updated to forge-1.10.2-12.18.3.2202 on a fresh install, no change.....

@jprocket45
Copy link
Author

I was running 2185 which is recommended so guess its not that hmmm im lost for words at the moment....

@tgstyle
Copy link

tgstyle commented Jan 3, 2017

I just noticed this issue myself, In my case the server runs fine, however even after all clients disconnect the server keeps using high CPU. It seems to be a runaway thread somewhere. Removing ZA resolved the utilization issue.

@Lanaess
Copy link

Lanaess commented Jan 3, 2017

Had some free time today so I decided to play around with ZA a bit to see if I could find out more info.

If I set the following parameter in general.cfg from 5 to 500 or higher:

how frequently the mod iterates all entities
I:tickRateAILoop=5

It delays the time it takes the CPU to run at 100% after a server restart. I found out from the console/logs that it is delaying the Initializing of PFQueue (And possibly other things I cannot see.). Once PFQueue is initialized, the CPU jumps to 100%.

I am not sure if PFQueue is the issue, but I tested this half a dozen times and the CPU hits 100% the moment PFQueue starts initializing.

If I set it to some huge number (100,000), I can play in the game for a bit before PFQueue is initialized, but ZA does not function.

@Corosauce
Copy link
Owner

Corosauce commented Jan 3, 2017

Hmm, interesting observation, PFQueue is still there but is supposed to be in a sort of stasis as it is not used anymore since my switch from threaded pathfinding, going to check over some things relating to it.

Edit: quick looks suggests it is to blame, time to super duper disable it some more

Edit2: yeah, by trimming out the code from 1.7.10 to 1.10.2 I accidentally removed the code that is supposed to sleep the thread, so it is going full tilt as soon as anything initializes PFQueue, good job me.

@Corosauce
Copy link
Owner

Corosauce commented Jan 3, 2017

Fixed, I'll close this once I get the confirmation from you guys, coroutil had the problem, zombie awareness just triggered it, no need to update zombie awareness, here is a build of coroutil with the fix: http://coros.us/mods/modsystem/dl/coroutil-1.10.2-1.1.11.jar

Updated on curse as well once they approve the file.

Thanks so much for digging into this guys, would not have realized without you. 👍

Reference to fix: Corosauce/CoroUtil@3cd3b95

@jprocket45
Copy link
Author

jprocket45 commented Jan 3, 2017

testing this now :)

After test im proud to say this was indeed the fix GG @Corosauce and gg on helping find the issue @Lanaess started server up went down to barely any CPU loading in world loaded chunks CPU went up a bit then went back down. Lets see what the other testers say :) looks very promising!!!

After waiting a little bit I have noticed before posting that once loading chunks has happened the processor does take a bit to go down longer than it would without Zombie Awareness but it did go down just too longer than expected.

@Lanaess
Copy link

Lanaess commented Jan 4, 2017

Just finished testing and I am VERY happy. ZA seems to be working well and the CPU is running about where it should. @jprocket45 is right about the CPU taking a bit to calm down, but I think this is because ZA is setting it's self up and needs time to level off.

This test was done on a fresh install new world. The big test for me will be on my production world with some other mods loaded. I'm a bit busy at the moment so I will be able to complete this part tomorrow and give my results on the CPU usage and the crashing issue referenced in another thread.

THANK YOU COROSAUCE !

@Corosauce
Copy link
Owner

Excellent! Happy to hear! Considering this concluded then. Will keep other issues open until I get confirmations on their fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants