Jump to content

Recommended Posts

Posted

Hi Tekkit (and other) folks,

I dont know if this have been around these forums, but i have a way that you can take a lot of load off your servers without a single problem. ie. You'll probably go from around 70% to 20% cpu usage (depending on the system)

So here we go

1. You have to get the bukkit plugin called minecraft remote toolkit, found here

http://forums.bukkit.org/threads/admn-remotetoolkit-r10-a13-restarts-crash-detection-auto-saves-remote-console-1-3-2.674/

(its not necessary, but i cannot for the life of me remember the other link)

2. Set it up, as per readme from the plugin.

3. Then go to the toolkit folder in the minecraft root folder and edit wrapper.properties with notepad or whatever.

4. A couple of lines in this document have some interest,

minecraft-server-jar= should say minecraft-server-jar=tekkit.jar

maximum-heap-size= This is your maximum allowed ram usage, mine is

maximum-heap-size=2048M

initial-heap-size= This is your initial allocated ram, mine is

initial-heap-size=1024M

And here comes the interesting line that does all the work :D

server-arguments= This is the line for all extra server arguments, some of these will force your server to use things such as SSE, which i really cant explain what actually does but is an intergrated part of newer cpu's

you should set this value to whatever you set in your maximum ram line SoftRefLRUPolicyMSPerMB\=2048

server-arguments=nogui,Xincgc,server,XX\:NewRatio\=2,XX\:CMSFullGCsBeforeCompaction\=1,XX\:SoftRefLRUPolicyMSPerMB\=2048,XX\:+CMSParallelRemarkEnabled,XX\:+UseParNewGC,XX\:+UseAdaptiveSizePolicy,XX\:+DisableExplicitGC,Xnoclassgc,oss4M,ss4M,XX\:+UseFastAccessorMethods,XX\:CMSInitiatingOccupancyFraction\=60,XX\:+UseConcMarkSweepGC,XX\:UseSSE\=3,XX\:+UseCMSCompactAtFullCollection,XX\:parallelGCThreads\=4,XX\:+AggressiveOpts

I actually saved a minecraft pvp tournament with this once where the admins praised this tune up to high heavens.

I hope you understand this, if not PM me :)

Posted

SSE is 1999 technology, hehe. Your command line adds SSE3 (2004).

Here's the command line you posted for matted for use on an actual script. I'm not sure I want to mess with my public server atm but someone else might want to:

-Xincgc -server -XX:NewRatio=2 -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:UseSSE=3 -XX:+UseCMSCompactAtFullCollection -XX:ParallelGCThreads=4 -XX:+AggressiveOpts

EDIT: I've read somewhere before that you should set ParallelGCThreads to twice the amount of cores you have, but like you, I'm not a pro at this so I can't explain why.

Posted

I kinda want to try this but I don't really want to add anything in without knowing what it does heh

Well, seeing how my server keeps crashing because of low memory (BOTH of them), I decided to give this a shot. I'm running this script on both a vanilla server and a Tekkit server. I'll report if/when they both burn to the ground. Or at the end of the day if they don't. :)

Posted

@Silent i promise you, you wont regret it ;) and if you're not impressed by the performance increase you can always just uninstall it :)

EDIT: Oh, commie i actually think i know why ParallelGCThreads should be twice the number of cpu cores.

Its cause most newer cpu's have a thing called hyperthreading which doubles the amount of threads available, so if you have a quad core with HT then you'd have 8 threads.

But most of Core2 cpu's does not have this, so i'll keep on running with it at 4 :)

Posted

Vanilla server crashed 3 times due to low memory, Tekkit server crashed twice. Hmm. I was actually excited, heh. It could have something to do with me running two servers on a tiny 4GB of RAM, but my vanilla server usually lasts 4 to 5 days without a restart. :(

Thanks anyways, sir, a man still needs hope every now and then.

Posted

Vanilla server crashed 3 times due to low memory, Tekkit server crashed twice. Hmm. I was actually excited, heh. It could have something to do with me running two servers on a tiny 4GB of RAM, but my vanilla server usually lasts 4 to 5 days without a restart. :(

Thanks anyways, sir, a man still needs hope every now and then.

I have my server automaticly restart every 24 hours, it really helps with Javas memory leaks

Posted

I have my server automaticly restart every 24 hours, it really helps with Javas memory leaks

I never got any sort of automatic restart to work. The plugin 'SmartRestart' only shuts down the server, and a cron job to shutdown and then restart fails at the restarting part. I think it's something related to Linux permissions but... meh.

Posted

@Commie, do you have a server log cause maybe we can find the cause :D

EDIT: Also just run the following commands on the mc folder if its a secure private server

cd /home/minecraft/

(might be another path, but you should use /home/user/subfolder/ cause the user will have full permissions for that path)

sudo chmod -r 777 serverfolder/

this will change to completely open file perms in the /home/minecraft/serverfolder/ dir and sub-dirs

BTW the remote toolkit do in fact have automatic restart schedule :)

  • 2 weeks later...
Posted

Guys c'mon if you are serious about your server and stable uptime then dont just copy and paste someone elses command line. It is tuned up to their requirements and will probably negatively impact your server if you dont have say 4 threads:

-XX:ParallelGCThreads=4

Also this is littered with bizarre settings. One prime example:

SoftRefLRUPolicyMSPerMB => is defined in ms not mb so why set to 2048????

Anyways not here to flame your efforts, just to point out to server admin that copy and paste is a bad idea.

If you really want to get to grips with your server then add visualvm via jmx. This will show you actual gc related cpu usage and how your heap is behaving. It wont write the command lines for you, but it will help you to learn how fragile a command really is.

Posted

Guys c'mon if you are serious about your server and stable uptime then dont just copy and paste someone elses command line. It is tuned up to their requirements and will probably negatively impact your server if you dont have say 4 threads:

-XX:ParallelGCThreads=4

Also this is littered with bizarre settings. One prime example:

SoftRefLRUPolicyMSPerMB => is defined in ms not mb so why set to 2048????

Anyways not here to flame your efforts, just to point out to server admin that copy and paste is a bad idea.

If you really want to get to grips with your server then add visualvm via jmx. This will show you actual gc related cpu usage and how your heap is behaving. It wont write the command lines for you, but it will help you to learn how fragile a command really is.

That's exactly what I think, that's why although I really want to put some of these to use, I'm not going to unless I understand what they do.

  • 2 weeks later...
Posted

@xtremetom, you are absolutely right. But i did actually copy+paste and then edit things such as memory allowance.

But i actually forgot one very important thing, You need to have JDK 1.7.0 and not just JRE 1.7.0

AAAAND... i actually found a very useful link here (not the one i used originally but it should suffice) http://www.mcschematics.com/index.php?topic=5994.0

@Silent if you're that worried, why not just try it on a local server with a crapload of plugins that use a lot of cpu ;)

Posted

"... You'll probably go from around 70% to 20% cpu usage ..."

And when you use this shit twice it will run a 100.000 slot Tekkit Server with 0,0000% CPU usage on a electronic calculator - for sure!

This is my command line:

-Xmx{MAX_MEMORY}M

That's all you need. When your server lags, get better hardware!

Posted

Growster, thats just plain dumb... Please keep shitty comments out of this thread, as im actually just trying to help other server owners ;)

also about the SoftRefLRUPolicyMSPerMB=2048 This is from what i understand the time needed for soft references to get flushed per MB in Milliseconds and that this value per default is 1000 MS so changing this to 2048 would more than double the time needed, therefor reducing the cpu power needed to do this.

And yeah, it might aswell be 2000 MS or 2500 MS, But what if he who originally made these tuneups found that 2048 is a sweet spot ;)

Also more info on this in the link below.

http://www.oracle.com/technetwork/java/hotspotfaq-138619.html

And as a little bonus, i found this

http://forums.bukkit.org/threads/optimize-java-for-minecraft-in-a-extreme-way-p-need-feedback-thx-i-am-back.25994/

Its the original thread i first copied this from :D

Posted

Plain dump?

You are referencing documents for Java 1.4: "Unless otherwise noted, all information on this page applies to both the HotSpot Client VM and the HotSpot Server VM as of Java SE version 1.4."

Java 1.4 is about 10 years old, you should use Java 1.7, with this version all these switches are obsolete. Welcome to 2012!

Posted

Growster, yeah it may be 10 years old, but that does not mean that they still dont work. If you dont think they will help you, i wont force the fact that it lowered at least my cpu usage from 300% (3 cores in linux) to about 0 - 10%

Djinnii, again if something is old, does that mean its not right?

Also, im outta here as most of you either wont believe what i say or just denies that it could work in any way...

Posted

Mysli, That's not what im saying at all... I would like make use of this. I just want to be sure it still works as advertised given how many changes minecraft has gone through since it was last updated.

Posted

Yeah, i read that but at least it worked for me and also saved a PVP-tournament on Netparty Fyn (the largest danish lan) with this.

So growster think what you want, but just because a Bukkit developer calls it a hoax, does not neccesarily mean it is.

And Djinnii i wasn't arguing with you, just asking a rethorical question :)

Also why would you need any more documentation on "if it still works" its not a very time consuming thing to test. it took me about 10 minutes to set up at that lan ;)

Posted

Ok, ok - these switches saved a pvp tournament on a netparty ^^

I'm running 8 Minecraft Server, Tekkit, Craftbukkit and Vanilla. My experience with such experiments are bad, for a stable server you only need the switch -Xmx (regardless if your at a netparty). Java 7 (1.7.x) optimize all for you, in the days of 1.4 this was different.

Posted

Hi Growster, I certainly agree with what your saying, especially from the perspective of a new server admin. However, java gc commands in the hands of an experienced "tinkerer" (even experienced users will need to tweak the settings a few times) are invaluable.

I suspect the developers suggest the aforementioned settings to keep things simple and help steer people from possibly corrupting game files and info.

To look at this issue in perspective, companies such as Blizzard employ people purely for for java gc management.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...