FTB Clean install 100% to 300% cpu usage

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Xyclade

New Member
Jul 29, 2019
10
0
0
As I'm trying to host a FTB server I've come up to the problem that even with a clean install of the OS + java + FTB (direwolf aswell as ultimate) my server uses about 90% cpu (Showing in top) when there is noone online, and goes wild with warnings that the system cant keep up and 300 upto 600% cpu usage when there is about 2 to 4 people online.

Now you might be thinking, are you running this server on a pentium 1 with 32 MB memory, because thats what the performance behavoir feels like. Well I've checked the hardware once more, and the server specs are:
AMD 8350 4GHZ 8 Core CPU
32 GB DDR3 1800 G.skill memory
64 GB SSD Crucial M4

OS: Ubuntu Server LTE 12.04
FTB version: 5.2.1 Direwolf pack
The command java -version gives me:
Java version "1.7.0_21"
Java(TM) SE Runtime environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

To explain a bit more, the basic idea of this machine is that it will be dedicaded to hosting 2 servers: FTB direwolf20 and our craftbukkit server which has been running on our old hardware for 7 months now.

The Craftbukkit server uses about 3~5 % cpu (from top command) with noone online, which I find normal. Now ofcourse FTB would use a bit more CPU, but the fact that its using 90~100% with noone online cannot be good in my eyes. We tested this for a bit, and indeed, this isnt good: There had been 2 players online on the server for testing, not even building advanced machinery, and after 1 night the cpu load had gotten up to 800% and players couldnt even login anymore. The strangest part about this is that the memory usage is extremely low. With extremely low I mean about 160 MB memory usage (~0.4% in top).

The startup scripts I've tried are:
The default script: java -Xms512M -Xmx1G -jar ftbserver.jar
More memory allocated script: java -Xms2G -Xmx8G -jar ftbserver.jar

I've tested with the Direwolf mods and the MCPC Plus Jar and this gives a cpu usage of 15% ish when noone is online, upto 40% when there are 9 people online.

Now the question is: why wouldnt you just host the server with MCPC plus instead.

Well thats what we are doing right now, but as MCPC plus has quite some annoying bugs (which I won't explain in detail as you are not the makers of this jar), I would love to just use the FTB Direwolf20 server (without extra mods or plugins)

I really hope you can help me out on this, and am more than willing to provide any neccesary information, java traces and such to get this problem solved.
 

Naolas

New Member
Jul 29, 2019
190
0
0
You could try doing some profiling to see what is causing the load.
TickThreading has some excellent profiling options.
http://forum.feed-the-beast.com/thr...le-entity-ticks-and-other-optimisations.6498/
  1. Make copy of your server
  2. Install TickThreading (grab the latest)
  3. Do a /profile e 60 and see if there are any culprits
  4. /ticks is also great to see if there are certain regions

More than 100% for the default server is also suspicious. There is no multithreading in it. Is there some swapping going on? Or some quick movement with constant chunk loading and unloading? Try "save-off" and see if that reduces the load? What does /chunkloaders show you?
 

Dingham

New Member
Jul 29, 2019
294
0
0
java -server -XX:parallelGCThreads=4 -Xms2G -Xmx8G -jar ftbserver.jar

try this to make sure your using all your cores. If you want more cores allocated change the '4'
 

Xyclade

New Member
Jul 29, 2019
10
0
0
java -server -XX:parallelGCThreads=4 -Xms2G -Xmx8G -jar ftbserver.jar

try this to make sure your using all your cores. If you want more cores allocated change the '4'


I've changed the startup script but this has not changed the cpu load a single bit for some reason. I'm 100% sure that its executing that script because I manually start the server via the file for testing


You could try doing some profiling to see what is causing the load.


More than 100% for the default server is also suspicious. There is no multithreading in it. Is there some swapping going on? Or some quick movement with constant chunk loading and unloading? Try "save-off" and see if that reduces the load? What does /chunkloaders show you?

I'm not 100% sure about the swapping, I'll look into how to check if that's going on right now, aswell as the tickthreading, for the meanwhile:

I've made a screenshot of the cpu load and what chunkloaders shows me at the same time, added it here:
highload.png


Please note that this is a server that is completely clean, I've logged in once, rebooted it once, and then logged in again. After 3 minutes standing idle at the point where I spawned, the hereabove situation was the case. This is with the startup script:

Code:
java -server -XX:ParallelGCThreads=4 - Xms2G -Xmx8G -jar -ftbserver.jar

On a sidenote, the CPU supports SSE4 So I've also tried adding that parameter without succes.
 

Xyclade

New Member
Jul 29, 2019
10
0
0
I'm not 100% sure about the swapping, I'll look into how to check if that's going on right now,


I've checked the swapping with iotop via this tutorial and this shows me almost no disk activity from the ftb server jar, aswell as 0.00% SWAPIN on any process active on the server.


I've also added in the TickThreading mod, and this gave me the following result:

tickprofilercpuload.png


Which shows me on one side that the tick times are perfectly fine, yet on the other hand, somehow its doing a lot of work for nothing. The 111% cpu time needed for the proces while not loading or unloading or saving anything is really strange IMHO.

The problem here is visible to me, but not to players, yet as soon as some players (give or take 4 players) join the cpu time goes over 200% and then starts to lag the whole server.
 

Naolas

New Member
Jul 29, 2019
190
0
0
Code:
java -server -XX:ParallelGCThreads=4 - Xms2G -Xmx8G -jar -ftbserver.jar

There is a blank before Xms2G. Typo?

What does /ticks show you? The Effective tick time is much too high and is in line with what top shows. It is normal that load is high right after the server starts ... it should go down somewhat quickly though. People exploring and generating new chunks causes quite a bit of load.

What happens to cpu load when you go "save-off"? (save-on will get you back to regular mode)

The FTB server is small enough that you can put it into a ramfs.
 

Xyclade

New Member
Jul 29, 2019
10
0
0
That is indeed a typo, my bad, its correct in the startup script though. I have turned off world save and this didnt make a difference. The losds you see on my screenshots are when the server has been up for about 5 minutes. I have it still running atm and will post another screenshot when it is online for about 3 hours. The world stats (bottom part of the second screenshot is what /tick shows me.

I'll look into ramfs when I get back to the machine.
 

Naolas

New Member
Jul 29, 2019
190
0
0
That looks like the output from /tps? The /ticks command should show you tick regions with their timings. Something is still missing somewhere, cause based on that profiling it is a little strange that effective tick time is so high.

Possibly do a /profile longer than 7 seconds.
 

Dingham

New Member
Jul 29, 2019
294
0
0
Silly questions, sure its just not just new chunks generating, four people loading chunks in four directions is going to cause most servers to pause for thought, a lot.
 

Xyclade

New Member
Jul 29, 2019
10
0
0
The server has been up for 6 hours now, noone has been online in that time and the cpu load is still about 104%


That looks like the output from /tps? The /ticks command should show you tick regions with their timings. Something is still missing somewhere, cause based on that profiling it is a little strange that effective tick time is so high.
Possibly do a /profile longer than 7 seconds.

Here below is the screenshot with the /profile for 60 seconds (both profile e and a). This was with 1 player online (me) standing on the spawn point not moving at all.


profile60secs.png


If you want to run the profiler to see for your self tell me your IGN and ill pm you the server IP + port and OP you on the server.

Silly questions, sure its just not just new chunks generating, four people loading chunks in four directions is going to cause most servers to pause for thought, a lot.

I'm not sure wheter I understood your post correctly, but if you are implying the issue is due to 4 people flying into different directions and generating chunks, I can tell you thats not the reason. There is only 1 person online, and he is standing still on a loaded chunk, with this as result aswell as the 104 ~111% cpu usage (even after 6 hours of being online)

The world save on and world save off hasn't made a difference.
 

Xyclade

New Member
Jul 29, 2019
10
0
0
I still havent found the problem, tried a clean install with Fedora and a clean install with Ubuntu now.

Also updated the BIOS of the machine, and set that up properly, but no changes...

The strangest thing is that the MCPCPlus nor the craftbukkit jar areconsuming that insane amount of CPU... Thus it can't be my java installation...