Stabalizing home-hosted server

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • 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
E

Exemption

Guest
I have allocated 8GB of RAM to the FTB Infinity Server on my computer (16 GB on my PC) with the run.bat
Code:
java -Xmx8072m -Xms8072m -jar FTBServer-1.7.10-1448.jar
PAUSE

Anyways, the server seems to not really use more than actual 1GB and it has block lag (1076~MB on Memory Usage) Anyways, any good ideas for making it run better?
 

redsector

New Member
Jul 29, 2019
9
0
0
Not sure if that's what's actually causing your problems, but in any case, try using less memory. Contrary to common sense, when dealing with Java, there is such a thing as "too much RAM". It messes up garbage collection or something (google it if you're interested in technical details).

2 (lower limit) to 3 (upper limit) GB is plenty for a small server with a handful of players. Maybe 4 GB if you're running hundreds of mods, but I'd say that's already overkill. More RAM will usually be counterproductive.
 
E

Exemption

Guest
Not sure if that's what's actually causing your problems, but in any case, try using less memory. Contrary to common sense, when dealing with Java, there is such a thing as "too much RAM". It messes up garbage collection or something (google it if you're interested in technical details).

2 (lower limit) to 3 (upper limit) GB is plenty for a small server with a handful of players. Maybe 4 GB if you're running hundreds of mods, but I'd say that's already overkill. More RAM will usually be counterproductive.
Lowered it to 4 or 5, will try 3 or 4, thanks :)
Total of 170 mods I believe.
 

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
I have allocated 8GB of RAM to the FTB Infinity Server on my computer (16 GB on my PC) with the run.bat
Code:
java -Xmx8072m -Xms8072m -jar FTBServer-1.7.10-1448.jar
PAUSE

Anyways, the server seems to not really use more than actual 1GB and it has block lag (1076~MB on Memory Usage) Anyways, any good ideas for making it run better?
It will not use more RAM than the size of those files it needs to load. Allocating more ram to the game is pointless and even counter productive in some cases.

Sounds like you are trying to run a server and client from the same PC? If that is the case, then you need to know that the real limiting factor of minecraft is the CPU and Harddrive. Depending on the number of people and how idiotic they behave on the server then you could need some pretty decent hardware to just run a server. Trying to run a server and client at the same time can therefore be quite difficult.
 

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
I have allocated 8GB of RAM to the FTB Infinity Server on my computer (16 GB on my PC) with the run.bat
Code:
java -Xmx8072m -Xms8072m -jar FTBServer-1.7.10-1448.jar
PAUSE

Anyways, the server seems to not really use more than actual 1GB and it has block lag (1076~MB on Memory Usage) Anyways, any good ideas for making it run better?

FTBServer-*.jar seems to be a rename of the Forge server .jar so it doesn't seem to do anything magical to Java.

When using the Forge server it is (it seems) vitally important to tell Java it is running as a server, and to use different garbage collection.

FTB's own parameters from the various 'startserver.cmd' files typically look like this, and in my experience, seem responsible for reducing periodic "server could not keep up" messages that accompany block lag.

Code:
    java -server -Xmx3072m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -jar forge-1.7.10-10.13.4.1448-1.7.10-universal.jar nogui

Minecraft is a game that is more an example of how to code a game poorly than anything and it breaks one of the more critical rules of writing performant games in managed languages - don't create memory pressure. This causes the Java Garbage collector to be invoked often, and the default Java garbage collector is a single threaded algorithm tuned to be memory efficient - it pauses the (all) application threads and then uses a serial (single CPU core) algorithm to pack the memory after collection.
"-XX:+UseConcMarkSweepGC" and "-XX:+UseParNewGC" enable multi threaded garbage collection algorithms that are tuned for performance - and in fact benefit from additional CPU cores - which can keep your servers TPS at 20 far more reliably.

There are many many many JVM parameters that various people will throw at you to improve Minecrafts performance - these two are actually important.
 
Last edited:
E

Exemption

Guest
FTBServer-*.jar seems to be a rename of the Forge server .jar so it doesn't seem to do anything magical to Java.

When using the Forge server it is (it seems) vitally important to tell Java it is running as a server, and to use different garbage collection.

FTB's own parameters from the various 'startserver.cmd' files typically look like this, and in my experience, seem responsible for reducing periodic "server could not keep up" messages that accompany block lag.

Code:
    java -server -Xmx3072m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -jar forge-1.7.10-10.13.4.1448-1.7.10-universal.jar nogui

Minecraft is a game that is more an example of how to code a game poorly than anything and it breaks one of the more critical rules of writing performant games in managed languages - don't create memory pressure. This causes the Java Garbage collector to be invoked often, and the default Java garbage collector is a single threaded algorithm tuned to be memory efficient - it pauses the (all) application threads and then uses a serial (single CPU core) algorithm to pack the memory after collection.
"-XX:+UseConcMarkSweepGC" and "-XX:+UseParNewGC" enable multi threaded garbage collection algorithms that are tuned for performance - and in fact benefit from additional CPU cores - which can keep your servers TPS at 20 far more reliably.

There are many many many JVM parameters that various people will throw at you to improve Minecrafts performance - these two are actually important.
Indeed client and server on the same pc. 16GB of ram, good graphics driver, and good latest generation I5 processor. That good enough?
 

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
Indeed client and server on the same pc. 16GB of ram, good graphics driver, and good latest generation I5 processor. That good enough?
Lol

I drive a red car. Is it a fast one? :p

"good latest generation I5 processor" tells us absolutely nothing lol.
 
E

Exemption

Guest
Lol

I drive a red car. Is it a fast one? :p

"good latest generation I5 processor" tells us absolutely nothing lol.
Said the ram too bud and graphics. Processor does help too just saying
 

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
Said the ram too bud and graphics. Processor does help too just saying
You don't seem to understand. Simply saying it is an I5 tells us nothing. I5's range from crappy low power dual core mobile processors to half decent quad core desktop processors.

GFX is inconsequential for minecraft/server performance(not that it would matter, but you never did mention which GFX it was. "good" is hardly useful for us as a measure for anything :p.). RAM you just have to have enough of and allocate it wisely.
 
E

Exemption

Guest
You don't seem to understand. Simply saying it is an I5 tells us nothing. I5's range from crappy low power dual core mobile processors to half decent quad core desktop processors.

GFX is inconsequential for minecraft/server performance(not that it would matter, but you never did mention which GFX it was. "good" is hardly useful for us as a measure for anything :p.). RAM you just have to have enough of and allocate it wisely.
I said latest generation I5, but IDK xD also the graphics are for relating to the client itself too :p

Nvidia 800 x letter thing :D
 

desht

Well-Known Member
Jan 30, 2013
150
81
53
UK
I said latest generation I5, but IDK xD also the graphics are for relating to the client itself too :p

Nvidia 800 x letter thing :D
I think the point @rhn was making is that your CPU is a lot more important than your GPU when it comes to Minecraft. It's a game with very simple graphics, but lot happening behind the scenes.

For instance, my laptop with an i5-2520M (that's one of those crappy mobile i5's) and Intel HD3000 GPU beats the snot out of my Atom-based net-top with Nvidia 920M GPU for Minecraft performance even though the 920M is way better than that Intel piece o' crap GPU. Not that I actually play on either box - I use an i7-4970K & Nvidia 760 for that :)
 

desht

Well-Known Member
Jan 30, 2013
150
81
53
UK
Meant to add: I'm running a private home server for two people on an i3-4130 CPU (quad core). The machine (64-bit Ubuntu 14.04) has 8GB RAM and I've allocated 2GB to the server. This is the CLI (default parameters for Horizons Daybreaker):
Code:
java -server -Xms512m -Xmx2048M -XX:PermSize=256m -d64 -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar FTBServer-1.7.10-1448.jar nogui

It runs quite happily (only seen very occasional "can't keep up" messages, and I check the logs regularly). The server tends to use between 20% and 40% of one core, depending on how busy it is (you don't say how many people you want to host, which is pretty important).

This is server only BTW, not client.
 

skruis

New Member
Jul 29, 2019
65
0
0
I run a server, actually a few servers, for some friends and myself. It's a multi-role (small websites, databases, vm's, etc.) PC w/ an i5-4690k, 3GB allocated to MC and MC is running on a RAID1 SSD set. I don't ever see the memory usage get very high on my server but I have experienced block lag and the best cure for that, in my experience, is to pre-generate the chunks so instead of generating the chunks on the fly (cpu dependent), they're simply called from the SSD, loaded into memory and transmitted to the client. I've read about some people having issues with the Admin Command Toolbox mod but it's worked well for me. You can specify a region to generate chunks for or you can specify a radius of chunks around spawn. Read the instructions for ACT and try to pre-generate a significant portion of chunks around the area you're in. Keep in mind that if you travel beyond that, the server will then generate those new chunks in real time which will contribute to your block lag. Of course, if you experience block lag while all of the players are in already explored areas, that's a different issue. The only time I've ran into lag in already explored areas is in mob-heavy areas like Roguelike Dungeons (lower levels).