mojira.dev
MC-38160

General Server Lag (Highly CPU intensive at times)

Everyone (and I mean everyone) on my 100% 1.7.2 Vanilla server is getting general server lag.
(This includes block lag/mob lag/chat lag/movement lag etc.)

I run the server on a dedicated CAT6 line. (http://www.speedtest.net/my-result/3059882600)
Even when connecting a local client with localhost it has this general 'server lag'.

I can't quite pinpoint the cause of the lag as of yet, but we really only started noticing it since 1.7.2, I've been keeping the server updated along with the snapshots and they seemed fine right before.

I tried disabling all redstone devices.
I tried staying in some of the same loaded chunks.
I tried kicking everyone off.
I tried dedicating a whole 5Gigs of RAM to the server.
I tried dedicating a whole 8Gigs of RAM to the client on another computer with similar specs.
I tried giving the Java Runtime High priority.

Nothing shows in the server log as going wrong however it does constantly show that it can't keep up.
(http://pastebin.com/PtehcSde)

Related issues

Comments

galaxy_2alex

How many entities are shown in the F3 screen? (I guess you checked that already, but just to be sure)
The zombie lag, as you might know, is fixed with 1.7, so that's not the cause. Honestly, I have currently no idea what this is caused by, the only thing that might be the case is that a mob spawner/similar got out of control (especially automated chicken and villager farms!)

migrated

Yeah highest current count of entities is 73 and it is indeed lagging now as I write.
Also it isn't at all frame lag. No one is having FPS lag, just server lag.

galaxy_2alex

Are people generating new chunks? Because that can cause server lag as well, especially if many people are genrating new lands at the same time.

migrated

That is what I thought initially.
But I kicked everyone off to try yesterday, and just me on the server still had some lag.
I am the only one on currently as well and have lag right now. (and I am playing in one spot )

galaxy_2alex

...and you're server is 100% Vanilla? That is very very strange... The problem is not the server itself, but the game...
Mods will mark this as a "technical problem" (at least they did it here: MC-25720), I'll still try to solve the problem.
Are there any special things on the server (like many spawners or similar)?
Did the server use Bukkit or similar in earlier versions (1.6)?
Maybe someone else can think of anything else...

migrated

Yep 100% Vanilla.
Nope never a bukkit server, the world started on 13w39b and then continued from there.
The server isn't too popular so, nothing special like mob farms or anything.
If you want I can invite you on so you can get a feel for what I am talking about?

galaxy_2alex

...sure, I guess that's an idea, maybe contact me via Skype (E-Mail: [email protected], if you don't have Skype an E-Mail is okay as well).

migrated

As of now I think I fixed my situation,
I used a world trimmer, and got rid of unused chunks.
I then loaded the world back up, and it still had lag.
I then shut it down - Deleted my Data folder within the world folder.
Loaded the server back up, and it's fixed.

Maybe maps were causing lag?

migrated

I have experienced this issue as well. Severe CPU usage on a LAN server. Mobs will also lag and then "jump" towards the player.

migrated

Similar experience here with a brand new 1.7.2 world created 4 days ago. CPU usage is maxing out with only a handful of players on, and the server is getting about 4-5 ticks per second.

migrated

I have been having same issue as well and after i del all the map*.dat files from the Data folder an restarted the server, CPU usage dropped significantly

migrated

I have also been experiencing this. I made a comment on MC-39037, but that ticket is closed, so I'm repeating here.

Quad-core Xeon processor, with 16GB of RAM. Every once in a while, the 1.7.2 vanilla MC Server process spikes a CPU to 100%, introduces major lag, and sometimes won't even let new players log in. At this point, I usually just restart the server process, and it usually clears it up for a little while. (Though, one time, it immediately got laggy again).

I've seen this happen with 15 players online. I never had this problem with 1.6.4 Bukkit, even loaded to the teeth with plugins on the same server.

There is something amiss. Unfortunately, since all the code is obfuscated, I don't have the inclination to try to reverse-engineer it to figure out what's wrong.

migrated

Thanx for letting me know about this bug report Sage905, let's get to work!

Here is a snippet of my console output during a debug: http://pastebin.com/FT9pUAPy

There isn't a single issue that it's reporting, it's waiting on connections, newAI, entites, ticks etc

Here is the bug report of about 10+ minutes after a fresh server restart: http://pastebin.com/M91mYZjE

TPS is currently at 16 but it's starting to dip more.

Tried different memory allocations from 2GB to 10GB, the server is dedicated with a i5 2500, 16GB RAM. 2x2TB RAID-0, 200Mbit connection up and down.

Ubuntu 13.04
Oracle Java 7 (most recent update and also tried OpenJDK)
Multicraft game panel

I haven't deleted the map dat files as others are suggesting, are there any issues with doing this?

migrated

Posting for another user from reddit, here is his post: http://www.reddit.com/r/admincraft/comments/1q2x5j/help_looking_for_technical_help_with_my_server/

Console snippet: http://pastebin.com/nvbmrDcF
Debug profile: http://pastebin.com/dSvXyEJQ

Specs: AMD Opteron 6272 Interlagos 2.1GHz Socket G34 115W 16-Core Server Processor (2 of these bad boys installed) (this is the host box, the VM that MC runs on has 4 of these cores dedicated to it)

migrated

Here's my debug profile... Looks very similar. Lots of time spent in levels->world->tick->regular->tick->unspecified.

http://pastebin.com/0YhsYNcA

Only 12 players on my server at this point in time.

migrated

Just to clarify, deleting the *.dat files from the world 'data' directory didn't help.

migrated

Been 35 minutes since my last server restart and there is only 2 people online, keep getting this in the console without debug enabled:

13.11 10:34:47 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2865ms behind, skipping 57 tick(s)
13.11 10:34:01 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2864ms behind, skipping 57 tick(s)
13.11 10:33:15 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2772ms behind, skipping 55 tick(s)
13.11 10:32:29 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2783ms behind, skipping 55 tick(s)
13.11 10:31:43 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2744ms behind, skipping 54 tick(s)
13.11 10:30:58 [Server] Server thread/WARN Can't keep up! Did the system time change, or is the server overloaded? Running 2718ms behind, skipping 54 tick(s)

galaxy_2alex

Is anyone home hosting and having this problem?

migrated

Yes, I am experiencing the same issue with a home hosted server on an i5 processor with 2GB RAM.

migrated

I sent a message on reddit to jeb about this issue, pointed him to this bug report, no idea if he'll ever pick it up.

migrated

are you running the server with our without the server GUI?

I've got a vanilla 1.7.2 server on Windows 8.1 x64. Core i5 machine w/ 16GB of ram and MC sitting on a fast SSD. The java process would consume 25-50% CPU (it was lower when the world was first created) when idle and more when a few clients were connected.

The higher the CPU load, the more "can't keep up" messages. Sometimes it would spike to 80-100% CPU, but it'd typically drop again after a few minutes.

Last night I added the NOGUI option to my startup command... wow... night/day. When I looked at it this morning, the machine was idling at 1-2% CPU. As users played last night, I still saw some of these warnings in the log, but I think it was only when they were exploring new areas.

Given that the GUI for the windows EXE doesn't even work, this isn't too surprising. Could be related to it trying to draw the activity/load graph... which off-hand, I can't remember if that was visible w/ 1.7.2?

It's possible this started with 1.6.x and was complicating the other "zombie pathfinding lag" issue.

migrated

So far I have only had the issue occur when I was using the GUI. I haven't used my server with nogui in the startup as much. For the next few days I will see if the issue can occur when using the option of nogui.

migrated

My server is running on a VPS without the option of a GUI, and I have experienced extremely this extremely high CPU usage.

migrated

Just to be sure.. everyone here has tried deleting the data folder within their world folder? It worked magic for me, and a few others.
This could either be due to the mine shafts or the maps causing the lag.

migrated

@Joshua

Yes, deleted all the *.dat files, didn't work for me.

@Flex

We don't have a GUI because I'm running from command line, still the same issue.

migrated

Same thing has been happening here too. with only me logged in, one core is pegged at 100%, lots of skipping ### ticks(s) messages. Stays that way for a bit after I log out, then drops down to negligible 4%. 1.5GB allocated, it's definitely not RAM, as it's using only 350MB right now.

This was a new world created for 1.7.2 where the world has grown to a decent size with about 20 unique players.

I created another server just to see what was happening, brand new, I only see this issue when someone logs in.

Perhaps once the world hits a certain size it is falling way behind process events/data.

I was travelling by boat on my main server and kept getting thrown back 100 blocks by the tsunami of server lag, but the boat was left where it should be. It was fun to suddenly be swimming in the deep ocean... but kind of annoying to have to swim back to my boat. πŸ™‚ And very annoying to watch blocks re-appear after being dug/mined/chopped, etc.

"Help me obi-jeb-kenobi, you're my only hope"

galaxy_2alex

"once the world hits a certain size"
As long as you're not at > 1000000, there shouldn't be any major problems.

migrated

@Galaxy

Agreed

@Jim

Can you provide a debug log please as it might be useful to the developers.

migrated

@Galaxy

Yes, I agree, there shouldn't be any major problems, I'm at the original spawn on both servers and getting the issue on the larger one. Just a scenario I am seeing, might just be coincidence.

@Tony

Goes, server is fine, no one logged in, someone logs in, e.g. me, and server cries for help. Notice the "jgaracci moved wrongly!" at 01:32:46, that was me in a boat, the scenario I described in my previous comment.

server log

[01:25:01] [Server thread/INFO]: There are 0/20 players online:
[01:25:01] [Server thread/INFO]:
[01:26:01] [Server thread/INFO]: There are 0/20 players online:
[01:26:01] [Server thread/INFO]:
[01:27:01] [Server thread/INFO]: There are 0/20 players online:
[01:27:01] [Server thread/INFO]:
[01:28:01] [Server thread/INFO]: There are 0/20 players online:
[01:28:01] [Server thread/INFO]:
[01:28:41] [User Authenticator #220/INFO]: UUID of player jgaracci is EDITED OUT
[01:28:41] [Server thread/INFO]: jgaracci[/192.168.0.102:49618] logged in with entity id 1188752 at (-186.69999998807904, 74.0, 273.7186626432543)
[01:28:41] [Server thread/INFO]: jgaracci joined the game
[01:28:48] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2140ms behind, skipping 42 tick(s)
[01:29:02] [Server thread/INFO]: There are 1/20 players online:
[01:29:02] [Server thread/INFO]: jgaracci
[01:29:07] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5073ms behind, skipping 101 tick(s)
[01:29:24] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4684ms behind, skipping 93 tick(s)
[01:29:42] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5312ms behind, skipping 106 tick(s)
[01:30:00] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5357ms behind, skipping 107 tick(s)
[01:30:01] [Server thread/INFO]: There are 1/20 players online:
[01:30:01] [Server thread/INFO]: jgaracci
[01:30:20] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5907ms behind, skipping 118 tick(s)
[01:30:38] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5082ms behind, skipping 101 tick(s)
[01:30:56] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5530ms behind, skipping 110 tick(s)
[01:31:01] [Server thread/INFO]: There are 1/20 players online:
[01:31:01] [Server thread/INFO]: jgaracci
[01:31:11] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5165ms behind, skipping 103 tick(s)
[01:31:30] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5420ms behind, skipping 108 tick(s)
[01:31:48] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4649ms behind, skipping 92 tick(s)
[01:32:01] [Server thread/INFO]: There are 1/20 players online:
[01:32:01] [Server thread/INFO]: jgaracci
[01:32:06] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4831ms behind, skipping 96 tick(s)
[01:32:24] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5270ms behind, skipping 105 tick(s)
[01:32:45] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6433ms behind, skipping 128 tick(s)
[01:32:46] [Server thread/WARN]: jgaracci moved wrongly!
[01:32:59] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4599ms behind, skipping 91 tick(s)
[01:33:01] [Server thread/INFO]: There are 1/20 players online:
[01:33:01] [Server thread/INFO]: jgaracci
[01:33:19] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5565ms behind, skipping 111 tick(s)
[01:33:38] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5543ms behind, skipping 110 tick(s)
[01:33:54] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6074ms behind, skipping 121 tick(s)
[01:34:01] [Server thread/INFO]: There are 1/20 players online:
[01:34:01] [Server thread/INFO]: jgaracci
[01:34:12] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6933ms behind, skipping 138 tick(s)
[01:34:30] [Server thread/WARN]: jgaracci moved wrongly!
[01:34:37] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 10532ms behind, skipping 210 tick(s)
[01:34:53] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 8546ms behind, skipping 170 tick(s)
[01:35:01] [Server thread/INFO]: There are 1/20 players online:
[01:35:01] [Server thread/INFO]: jgaracci
migrated

I've been having this same issue.

Ubuntu server, fast dedicated server, large ram drive, properly configured. Shutting down server + rebooting machine does not help to alleviate the issue. Amount of users is not causing it. Getting very high CPU usage all the time which is not normal. No idea what could be causing it πŸ™‚

migrated

About deleting the data folder fixing the problem:
https://mojang.atlassian.net/browse/MC-33086
Saving structure data seems to take way too long on bigger maps for whatever reason, causing lag spikes.

migrated

I run a small server, and when no one is on the server is eating about 70% of my processor. this was not the issue before 1.7.2, when I was running 1.6.4 it idled under 10%

migrated

Getting same issue with a 1.7.2 vanilla server. Ubuntu 10.04 LTS, dual quad core 2.6, 64 gb ram, 15k sas raid 5 on a 200/200mbps fiber. 2 players connect and I'm getting the "can't keep up" message coming across the console. 1 in 5 times it crashes the server instance and I have to restart it. So it's definitely not ram, disk i/o or connection speed.

migrated

I am getting the same issue with 1.7.2 vanilla server. Windows 7 64bit, Black phenom II 6 core (OC to 3.9ghz). 16gb ram 1866 (OC to 1932) (4gb dedicated to server). System is stable through furmark and memtest. Server is dedicated to only 2 people, myself and another. Cpu idle in 1.6.4 was about 10%. Cpu idle in 1.7.2 is 45% and rising usually maxing out at 90%. Nothing else in the background. Task manager shows Java using a lot more resources than usual. Map is brand new, created in 1.7.2. Ran fine for the first week, afterwards cpu usage spiked and ram usage stayed the same. After restarts the server is fine for the first 5min then starts again. Using the Server with gui.

kumasasa

@all: See MC-33134

migrated

@Hunter Parkhurst - yeah, add the NOGUI option and see what happens.

I think it's related to how it draws the "activity graph", which stopped working w/ this version also. Even though it's obfuscated, we could run VisualVM and see if it's the same object/method calls eating up CPU. Granted, in my case, it was all the GUI...

migrated

NOGUI option worked for me. Running the GUI: 20-40% CPU with no users. Now purring along at 0-2%, much better.

Win7 x64 9GB RAM Intel Core i7

migrated

Kumasara's tip worked as temporary solution. Not using Windows server so nogui doesn't do anything for me. Propably just placebo effect anyway/hiding the real problem behind this.

Check Kumasaras's link, deleting the mineshafts.dat works as a temp solution but you have to do it evere day/every other day and keep doing it until we have a fix.

migrated

Deleting Mineshafts.dat works first but I found that updating Java from V.7 Update 7 (x64) to V.7 Update 45 (x64) really fixed problem. I have not deleted Minshafts.dat file today and I no longer get "Can't keep up" spam and no CPU peaks at all. Try this solution...

migrated

Using the latest java update already. I've also denied read/write access to minecraft.dat so the server cannot create another and the problem persists.

Also, I've moved to a completely new host from a Core i5 2500 to a Core i7 4770, same issue.

migrated

Yea Tony. Sadly you are right. I see lower peaks but after running server about 24 hours it starts building up again. Going from 3% processor use to steady 35% with peaks causing lag. I never had this problem with CraftBukkit 1.6.4 having about 25-35 players in game and 30 plugins. I use Windows Server 2008 R2 running in Solid State drive without any applications or background programs, Dedicated server 16GB RAM and A-6 3620 processor. Vanilla 1.7.2 and *.jar configuration -Xmx5120M nogui.

migrated

Hey everyone, I've been using Jvisualvm to try and see what's going on, the best I've been able to do and understand is this image: http://s29.postimg.org/dv3o0dbaf/Screenshot_from_2013_12_01_18_13_42.png

So it's quite possibly Netty is responsible for our issues.

migrated

Just an update.

I tried Spigot 1.7.2 and I didn't have any CPU/lag issues, I went back to normal Vanilla because there are bugs with Spigot/Bukkit, but as soon as they are fixed I'll be returning to Spigot.

With the last comment I made about Netty and Spigots experience with Netty I'm pretty certain that Netty is to blame for the issues I'm having and quite possibly yours as well.

migrated

So if this a Netty issue, I wonder what the common thread is.... network hardware? If so, swapping in a new NIC could be an easily solution... if that's what it turns out to be.

My issue was resolved by the NOGUI switch and I don't remember ever seeing any netty IO methods eating enough CPU time to show up on the VisualVM radar.

Vanilla 1.72
Java V.7 update 45
Windows 8.1 x64

My network card is either an Intel or an integrated Marvel chip, I'll check when I get home. If this issue affects both Linux and Windows, that makes me think it's Netty + network hardware related.

migrated

Its for absolutely nothing to do with the NIC, mojangs implementation of netty is. Spigot has had netty since January, mojang added Betty late into the 1.7 dev cycle.

migrated

Ubuntu 10.04 or 12.04 LTS servers. Tested on both. Problem existed on both but Java 6 installs by default. Shut minecraft servers down.

Ran the following to update to Java 7:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Started minecraft servers back up - now running v 1.7.4 mc vanilla. Console has yet to report the error again - been running both servers for approximately 12 hours.

migrated

Here are my home server specs:
AMD A8 3850 2.9ghz
16GB RAM
8GB Map generated to +/- 10k,
Server on RAMDISK
2GB RAM allocated to server
100MBPS up/down data
Server and client view distance set to 8

I cannot explore without severe lag. I only host between a maximum of 4 players online at a time.
I uninstalled all Java, and reinstalled only the 64 bit version Java 7u45, moved server to RAMDISK.
it's not possible for any of the players to explore without messing up the server.
When exploring, especially in the jungle, I'll get spammed with extremely high lag. Running 11124ms behind, skipping 222 tick(s)
Sitting in the jungle (just one user, me, no other users logged on) it will "idle" around 30% CPU usage. Entity count is something like 4/70-120. Once moving, the CPU usage will spike up, causing the "Can't keep up" messages.
Sitting in a large village in the plains drops the usage down to below 10%. Entity count 68/187.
Also sitting in the plains where cows and sheep are spammed in high quantities (233/388) the usage still sets on the server at around 10%.
The second highest usage comes from dense forests/mega taiga biomes which will idle around 20% usage.

The only thing I can really equate the server lag to is the amount of foliage (vines/leaves/grasses) maybe that uses some type of transparency? Since entities really don't play a part on this particular issue it doesn't seem. that puts a higher client load, but not as high of a server load in my particular situation.

I have been running a home server since minecraft beta, and have never experienced this issue.

migrated

I found and read in the comments that turning of the server gui interface did make the server perform as in earlier versions in minecraft, also there is something at fault with the gui because it doesn’t show the server performance graph and the "threds 1+1" is also missing. In other words it seem that the gui is what makes the server resource demanding, causing server lag

migrated

It's possible that the GUI is bugged for all I know but issues with GUI are not related to this as also Linux servers are experiencing these same issues with performance (Linux version doesn't have a GUI). This seems to be related to mineshafts and saving structures like like a mod pointed out earlier and hopefully it will get fixed next year...

migrated

Hey, just wanted to bump this thread, because I'm also experiencing this issue and would love for this to be fixed.

Background: Linux (Ubuntu 12.04) home server with a C2D E6300, 2GB ram, running only Minecraft and 6 players max. New map with vanilla 1.7.4. Our last map was on vanilla 1.5.2 and did not have any problems. The server even ran two maps at the same time no problem πŸ™‚

Using Oracle's Java (1.7.0 u45) and the lag is crazy. CPU usage spikes. The lag is most prominent when the players are scattered/exploring - even two players 500 blocks away from eachother will cause lag. "Running x ms behind, skipping y tick(s)" etc. With three players far apart, it's barely playable... If all six of us are just hanging at the spawn, the lag is non-existant. I read Kris Cloutier's description and it sounds similar to what we're experiencing.

I'm happy to provide any extra info that you might need! We would very much like to get this fixed, because - despite the crashing & lag - we've made a pretty awesome world. Would be very sad to leave it behind.

PS. I was previously running OpenJDK, since it was working beautifully from beta to 1.5.2, but with 1.7.4 it led to constant OutOfMemory crashes; at some point, the server process would hog all the available memory for no apparent reason. Even with 1 player just sorting the item boxes. At this point, I couldn't even SSH to the server. After hogging all the memory, the process would slowly fill the swap, too - and after that, some other process usually ordered the kernel to kill the server process and thus the server crashed. This happened over ten times a day.

migrated

Antti-Jussi Kovalainen, I was able to resolve the issue by removing the mineshaft.dat file previously stated in an above comment. My file was bloated to 1.6MB.
It would saturate whatever memory I had allocated to the server. If it was 2gb, it would saturate to the max 2gb allocated. 3 or 4gb made no difference.
I would recommend attempting this fix and seeing if it resolves your issue.
To prevent this, I pre-generated the map to +/- 10k using minecraft land generator, which is farther than we care to go at this point, then removed the mineshaft.dat file and let the server recreate it. now the file sets at 114KB size for a couple weeks now.
I believe if we begin exploring, the newly generated terrain may cause the mineshaft file to freak out, but at that point, I will just pregenerate the terrain to +/-20k, then remove the mineshaft.dat file again. I am hoping that will lessen the dependency on me babysitting the server.
I believe the mods haven't closed this issue, because they haven't identified the root cause of the mineshaft.dat bloating in the first place.
Hope this helps,
Kris

migrated

After watching the server for a while, with players logging in and out, I did notice the server is not freeing up chunks/regions like it used to. That is, even with no one logged in, the server was still updating all of the chunks that had been loaded for any of the previously logged in players. The mineshaft.dat file seems to grow in size relative to the loaded regions/chunks, and only gets regenerated as players revisit regions.

Anyone else seeing this. In the past, once players were out of regions, the server stopped writing to them; it would "unload" them. That doesn't seem to be happening anymore, it just keeps it all loaded and constantly updates all of those files.

migrated

I can confirm this in 1.7.4
On my dual core I usually have 45-60% total cpu usage while being inside spawn chunks. I noticed that when I'm exploring away from spawn chunks there is a great chance that total cpu usage will go up to 95-100% and stick there irreversibly. Staying still, waiting for all chunks to load (and chunk updates to drop to 0) does not make any difference. Nor does game restart. When this behavior is triggered I also experience severe server-client desync and I'm playing vanilla SSP on SSD. The only way to make this behavior go away is to go back to spawn chunks. Today I've even seen for the first time the "Out of memory" error message while experiencing this bug. Allocating more RAM does not solve the lag/desync issue either (I've even tried 4GB).
With this bug I'm forced to stay near spawn chunks. Otherwise with such long lag spikes and desync the game is unplayable.

I was very surprised to see that this even happens on core i7's. I hope this might help catch developers' attention.

migrated

We should probably also be following MC-42088, it is the same thing as this and it has another 15 related issues marked as duplicate.

migrated

I am glad it wasn't just me. However when I first created this report I was running on an older world file - I created a new one and since then only get this same issue maybe once every 72 hours or so? I just then simply restart the server and all is well.

It seemed to help by making that new world, however I did change at the same time the -nogui option.
I feel like it wasn't due to the nogui though, because I know I once tried that on the old world. Maybe this will help some of you?

migrated

We updated our Java version, and haven't seen this issue since. Honestly, I didn't take an empirical approach to this, so I don't know if this is what resolved it, but we haven't seen the issue in weeks.

migrated

I am running 1.7.4 on an AMD Phenom II x3, with about 4 gigs of ram with no real lag issues until 1.7 came out.

I was getting high cpu usage even when no one was on (40 to 70% usage) after turning off the GUI interface it now sits at 4-8% when no one is on. This was the only thing I changed.

so the GUI is messed up somehow.

PS I was not getting high RAM issues so that might be a separate issue/issues

migrated

Im also having this issue. I run a small vanilla server with 2-7 people on it on 2x2Ghz, 2,5GB RAM (2G allocated) on Ubuntu x64 12.04.3. nogui of course. CPU usage is usually really high. I only running a server for couple of weeks now, so I was not aware this kinds of loads were not normal

Java:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Lag occures mostly when someone is exploring or running fast across the map, server goes to 100% CPU use and skips lots of ticks.
Also had my first Out of Memory crash yesterday.

Also I find it strange that the CPU load can be super-high with just 1-2 people on, who are doing very little on the server, CPU usage can be 30-60%!! After a restart load is 1-5%, but when a few people join rises quickly to 60% or more and stays there.

Map is created on 1.7.2, then upgraded to 1.7.4.

migrated

The gui probably wasn't helping but this issue goes far beyond that. I run my vanilla server with {{ -Xmx2560M -Xmx2560M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=3 -XX:+AggressiveOpts -XX:MaxPermSize=256m -XX:PermSize=256m }}. After an indeterminate amount of time (but usually within a day of server start) we start get "Can't keep up!" message all over place.

2014-01-10 22:58:10,863 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5684ms behind, skipping 113 tick(s)
2014-01-10 22:58:29,980 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5430ms behind, skipping 108 tick(s)
2014-01-10 22:58:49,630 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5682ms behind, skipping 113 tick(s)
2014-01-10 22:59:09,006 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5657ms behind, skipping 113 tick(s)
2014-01-10 22:59:23,896 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5056ms behind, skipping 101 tick(s)
2014-01-10 22:59:42,505 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5273ms behind, skipping 105 tick(s)
2014-01-10 23:00:01,130 WARN  [server0]: Can't keep up! Did the system time change, or is the server overloaded? Running 5426ms behind, skipping 108 tick(s)

Given enough time this even happens with just one person logged into the server and gets drastically worse the more people on. As I mentioned, kicking off a new JVM temporarily resolves the issue.

The issue is much more prevalent in 1.7.4 than it was in 1.7.2. I'm attributing this to the view-distance bug that was fixed. I hate to lower the server view-distance all the way to 8 though. We used to run the server at a view-distance of 15 on 1.6.x with no issues.

migrated

@unknown: You have come the closest to the same arguments I have used to make the server run smoother, out of everyone who has posted on various issues. Here are the arguments I have come up with that seem to provide the smoothest running server. I have been able to keep an uptime of about 7 days before the RAM begins bloating. Keep in mind these arguments are intended to take the load off the server's CPU, which causes more issues in the RAM department. But I no longer get my RAM bloating to 50-75% after a day or two of uptime, and it usually hangs around 300-1GB. I would rather not turn off GC but it seems to have a huge impact in 1.7. 1.8 may resolve some of these issues.

It is recommended you understand each argument before using any of the following.
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

java -server -Xms3G -Xmx3G -Xincgc -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -XX:CompileThreshold=1500 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:+UseGCOverheadLimit -XX:+UseBiasedLocking -XX:UseSSE=3 -XX:+UseStringCache -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -jar "%CD%\minecraft_server.1.7.4.jar"

migrated

I have the same issue, server is 1.7.4 (world generated with 1.7.2 a few weeks ago.) It was fine with 2 active players until two days ago, when the other player started exploring great distances in search of horses. The server quickly became unplayable just from this surface exploring. It was fine for weeks with 1G allocated to the java machine, I've doubled that and reduced the server render distance to 8. Otherwise the server is running defaults.

Ubuntu 13.10, Java 1.7.0_51 launched with -d64 -Xmx2048 -Xms1024 and nogui, on a 64-bit Intel i7 with 4 dual-cores and 6G of total ram.

The host does nothing else, and 'top' shows the java process is over 1.2Gig when the lag begins. I can restart the server and it's fine for a while, until we start exploring again. The conjecture that the issue is chunks failing to unload when unoccupied strikes me as the most likely issue on my server.

If there is any instrumentation or debug logging I can enable that may help diagnose this, please feel free to contact me. I am a developer myself but java is not my current focus and I'm my last professional work with it was back in the Java 1.2 days.

migrated

I run a 1.8 Snapshot server which started as a 4GB server with avg of 20 users an found it wasnt enough, so went to 8GB for the server an found it was also using the entire 8GB of memory .. So ive now gone to a 16GB server dedicated box and its consuming all the 16GB .. which i find is complete and utter BS! .... SO i feel there is some sort of a leak somewhere as a basic Vanilla server esp snapshot which is due to be a pre-release in a few days should not be consuming this much RAM ever, its crazy .... its using more then any mod pack ive ever played an more then What ive made ... so there has to be something wrong somewhere.

migrated

@Warren:
a) You haven't provided any data about your situation (startup parameters, java version, snapshot version, etc.)
b) You're post is not related to the original issue, which is High CPU with 1.7.x versions.

May I suggest that instead of venting your frustrations in this ticket, that you make a post to a community site, ( eg: minecraftforum.net), or one of the IRC help channels: http://minecraft.gamepedia.com/Minecraft_Wiki:IRC. These people can help you troubleshoot, and give you help to gather data that would be useful in creating a ticket of your own.

I understand the cathartic benefit of venting publicly, but it won't help you solve your problem. Which is the goal you want most to achieve?

galaxy_2alex

Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

migrated

This ticket is incomplete without the requested information, no response has been received within a reasonable time and we are assuming the issue has been resolved. If you are still experiencing this issue, we can reopen it at your request.
Please review the guidelines before reporting issues.

migrated

(Unassigned)

Community Consensus

lag, server

Minecraft 1.7.2, Minecraft 1.7.4

Retrieved