Mysli0210 Posted November 22, 2012 Posted November 22, 2012 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 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 :) Quote
Kommunističeskiĭ Posted November 22, 2012 Posted November 22, 2012 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. Quote
Mysli0210 Posted November 22, 2012 Author Posted November 22, 2012 Ahh, i stand corrected and thank you for adding the commandline :D Quote
Silent Posted November 22, 2012 Posted November 22, 2012 I kinda want to try this but I don't really want to add anything in without knowing what it does heh Quote
Kommunističeskiĭ Posted November 22, 2012 Posted November 22, 2012 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. :) Quote
Mysli0210 Posted November 22, 2012 Author Posted November 22, 2012 @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 :) Quote
Kommunističeskiĭ Posted November 22, 2012 Posted November 22, 2012 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. Quote
Silent Posted November 23, 2012 Posted November 23, 2012 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 Quote
Kommunističeskiĭ Posted November 23, 2012 Posted November 23, 2012 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. Quote
Mysli0210 Posted November 23, 2012 Author Posted November 23, 2012 @Commie, do you have a server log cause maybe we can find the cause 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 :) Quote
xtremetom Posted December 6, 2012 Posted December 6, 2012 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. Quote
Silent Posted December 6, 2012 Posted December 6, 2012 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. Quote
Mysli0210 Posted December 14, 2012 Author Posted December 14, 2012 @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 ;) Quote
Silent Posted December 15, 2012 Posted December 15, 2012 My local computer is VERY solid and wouldn't lagout with no amount of plugins :p Quote
Growster Posted December 15, 2012 Posted December 15, 2012 "... 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! Quote
Mysli0210 Posted December 15, 2012 Author Posted December 15, 2012 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 Quote
Djinnii Posted December 16, 2012 Posted December 16, 2012 Mysli0210, I appricate your efforts, but are we sure this is still valid and working? After it it was last edited by Therawroy Aug 23, 2011. Quote
Growster Posted December 16, 2012 Posted December 16, 2012 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! Quote
Mysli0210 Posted December 16, 2012 Author Posted December 16, 2012 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... Quote
Djinnii Posted December 16, 2012 Posted December 16, 2012 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. Quote
Growster Posted December 16, 2012 Posted December 16, 2012 You spread what they call a hoax, disinformation. Have you not read the opinion of the Bukkit developer? http://forums.bukkit.org/threads/optimize-java-for-minecraft-in-a-extreme-way-p-need-feedback-thx-i-am-back.25994/page-4#post-609422 Quote
Mysli0210 Posted December 16, 2012 Author Posted December 16, 2012 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 ;) Quote
Growster Posted December 16, 2012 Posted December 16, 2012 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. Quote
xtremetom Posted December 24, 2012 Posted December 24, 2012 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.