mojira.dev
BDS-2574

1.14+ Linux Performance Degradation

Description update by [~IonicEcko]

I'm going to use this one as a master for the performance degradation experienced in BDS on a Linux install post 1.14. I've done my best to summarise the info provided in this ticket and others but please feel free to comment below if you have further info.

What is happening?
It appears that post 1.14, CPU usage on linux is far higher than the 1.13 releases. Testing against identical kit using Windows vs Linux yields far better performance on Windows than on Linux

How to reproduce

  1. Build Linux box on Ubuntu 18.04 LTS (per last published Sys Reqs).

  2. Create new server using default properties file.

  3. Load into the world and note significantly higher CPU utilization than a Windows equivalent. Even with only 1 active player.

Notes from community members

  • World (chunk) generation appears to contribute to the slowness. Logging into a new box the CPU pinning seems to occur while chunks are generating and falls off over time.

  • Chunk generation appears slow to the player. (the view distance expands slowly)

  • While under load, server time is obviously affected causing numerous issues for players,

  • Was not present in the 1.13 releases.

  • Does not appear to have improved with the subsequent 1.14 releases.



Issue with CPU maxing out to 100% usage when having a single client connected to dedicated bedrock server on Linux/Windows server. Testing environment including Ubuntu 18.04 LTS with 1 physical box (Celeron CPU 1007U @ 1.50 GHz 2 core ) and Azure Standard D2s v3 hosted VM.).

When server is idle with no connections, CPU is perfectly fine.

Java server has no adverse affect on connections and performance is much better. Is this typical?

Linked issues

Attachments

Comments 61

migrated

I'm having the same issue - one user brings the cpu up to 60%, two makes it run at 100%, on a single core
I'm running an Intel Nuc 815, which has a i5 8259U
Testing on my much older desktop with an i5 3470, one user barely brings it up to 40%, and that's with running it on the same machine as my client - I'll test with other clients shortly.

migrated

Actually, it's even lower than that - 40% is only when loading and creating new chunks with one player. If it's loading existing chunks, it really doesn't get above 25%, and doing nothing but standing around it's at like 3%.
That's on my desktop, yet on the much more powerful server, just standing around runs at 60%.

The desktop with the 3470 is running Windows, the server is running Ubuntu Server 18.04.3
I think there may be an issue with the Linux version of the server.

migrated

Have you tried 1.14.20.1 or 1.14.21.0?

I only ask because the version you listed in the title is 2 versions old now. I haven't noticed the same on mine, although have noticed some pretty heft load on player login.

migrated

I've done some more testing on this, and it seems that at least on my hardware, the Linux version is just not very good.

With the Nuc 815, with Ubuntu Server18.04, just standing around doing nothing has one core running at 50-95%, depending on the area. Our world does have a lot of entities, so I tested in a new empty world, and in that one it's still a 40% single core load doing nothing.

Switched to Windows 10 to test, and on that, the CPU load on a single core is at <20% when doing nothing, and only goes to like 40% when I go near one of the areas with lots of entities.
On top of that, the loading that happens when a player logs in or is flying to a new area is much quicker, and only uses a few cores at 70-90% instead of all 8 at 100%.

migrated

I met the same problem.When the server run with no user ,CPU usage is about 4-5%.Only one user bring the usage up to 98%.

Environment: 1Core 1G RAM  

Ubuntu 18.04.01

Minecarft Version: bedrock-server-1.14.21.0

51 more comments
migrated

Ok so finally had some free time to mess around with the linux VM again and got it updated to 1.18.

I have noticed a few hiccups where the game kinda stutters for a second (game saving?)
Either way these stutters while a bit detracting are not ruining the experience.

That being said at the moment the performance is much better than it was back in 1.14-16

Ill continue monitoring my VM and see how it continues to preform as we explore more of the world and start doing redstone etc... As well as dig in and see if anything stands out during the stuttering issues.

 

VM Config

  • 8 vCPU

  • 32 GB Ram

  • 100 GB SSD

Minecraft Config:

  • ticking distance of 12

  • Render Distance of 32

  • 2 Players via XBOX split screen

  • Threads set to 0

  • Defaults for everything else

Let me know if any other settings are useful for debugging this.

migrated

There is definitely a stark performance difference between the Windows and Linux version though I am still trying to work out an apples-to-apples test that I actually have time to demonstrate.

Trevor Keniski: It is nice to see that someone else is working on this as well.  What I have found is that the problem really shows itself if you turn up the tick speed then add a second player to the game.  The first player to join a game seems to get priority treatment.

On Windows, even with the tick speed cranked you will be hard pressed to notice any side effects.

On Linux, if you turn the tick speed up much then every player after the first one is likely to have a terrible experience.  One of the CPU cores will be pegged all the time, mobs will move in small increments and everything will stutter in general.  On my Linux server with a Ryzen 9 3950X, setting the tick speed to 50 will easily cap one CPU core and present issues for the second player.

I caught on to this when I moved a game that my wife was hosting on her Core i5-8400.  Her and my two kids were playing at a tick speed of 150 with no issues.  After moving the game to the Linux server (the Ryzen 9 3950X) we had to turn the tick speed down to 10 to make it playable again.  I suppose I should also note that all of our games have a 10 chunk simulation distance.

I am surprised that Mojang isn't all over this issue already as I strongly suspect it is hindering the performance and scalability of realms.

Moderator: If you think this belongs in a new ticket then I will be happy to create one.  Thanks!

GoldenHelmet

Yes please create a new ticket. I will link it as related to this one.

migrated

Has this been fixed up to the point performance on Linux is similar to Windows on 1.18 and 1.19?

migrated

For me, the issue disappeared just over a month ago.

The OP mentioned chunk generation being a primary cause for degradation in performance. When I had this issue my server CPU would hit 100% with a single player flying around, now its ~5% :3

migrated

(Unassigned)

Confirmed

confirmed

Retrieved