Alright, I'm completely new to this Java stuff. I've been having terrible lag trying to support 4 people on my server. Well, it's not terrible, but there are quite a few lag spikes. Anyway, how do I implement this, like what exactly do I do?
Also, how do I run 64 bit Java? I've got a 64 bit version of Winows 7.
What we are doing is adding start parameters to the minecraft_server.jar file to change Java's default settings.
The .bat file you use to start your server, depending on what wrapper/mod you have is where you add this code.
Lets say your using hMod. You would edit the server_nogui.bat file from this:
@echo off
java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
pause
So when Java starts up the .jar file it uses the options you provide. I suggest reading the last few pages to know what all of those parameters mean.
Well I'm not running any mod for a server. I also don't see a minecraft_server.jar. I've just got the vanilla server. How about instructions to do it with the regular server?
Actually, I found the file and everything, etc etc, made the .bat file and when I run the .bat file it says it can't find my minecraft_server.jar. How should I go about fixing this?
Well I'm not running any mod for a server. I also don't see a minecraft_server.jar. I've just got the vanilla server. How about instructions to do it with the regular server?
Actually, I found the file and everything, etc etc, made the .bat file and when I run the .bat file it says it can't find my minecraft_server.jar. How should I go about fixing this?
Just copy what I have above into your .bat file (change Minecraft_Mod.jar to minecraft_server.jar), and make sure it's in the same folder as minecraft_server.jar
As for running 64-bit Java, install it first of all from here https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter
Go to the start menu, right click on "Computer" and hit "Properties". Hit "Advanced system settings", on the Advanced tab, click "Environment Variables" at the bottom. Under System variables, scroll down until you find "Path". Click on it, and then hit "Edit...", near the end you should see something like "C:\Program Files (x86)\Java\jdk1.6.0\bin" -erase the "x86" so it will look like "C:\Program Files\Java\jdk1.6.0\bin".
@GuardMoony,
Yeah its still in beta. I really don't know much else about it other than its supposed to work faster.
You have to add the -XX:+UnlockExperimentalVMOptions tag to use it
Is there a way to request this topic to be stickied? I figure it's on the "required reading for advanced server administrators" list.
Definitely seconding the sticky idea.
Have been trying to get a server to work on a POS that runs the game at the same time. So that me and my brother can play together. This thread has driven it from impossible to a possibility.
My specs:
2G Ram
2Ghz Processor
ATI radean HD 2400 video card (525mhz , 256mb Ram)
Still fiddling with the code from different posts. The best result I have gotten so far is:
Just copy what I have above into your .bat file (change Minecraft_Mod.jar to minecraft_server.jar), and make sure it's in the same folder as minecraft_server.jar
As for running 64-bit Java, install it first of all from here https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter
Go to the start menu, right click on "Computer" and hit "Properties". Hit "Advanced system settings", on the Advanced tab, click "Environment Variables" at the bottom. Under System variables, scroll down until you find "Path". Click on it, and then hit "Edit...", near the end you should see something like "C:\Program Files (x86)\Java\jdk1.6.0\bin" -erase the "x86" so it will look like "C:\Program Files\Java\jdk1.6.0\bin".
@GuardMoony,
Yeah its still in beta. I really don't know much else about it other than its supposed to work faster.
You have to add the -XX:+UnlockExperimentalVMOptions tag to use it
First of all, thanks for the help. I think I've got one last problem. It now says it doesn't recognize Java as a command, program or file. How do I fix this? Also, I didn't keep 64 bit Java because it didn't work and the link you included in your post was broken. So I've got 32 bit Java.
Alright, I got it to regonize Java, find the Minecraft server.jar, etc, etc, but now... when I try to open it or well, run the .bat, it says "Error: no 'server' JVM at 'C:\program files (x86)\Java\jre6\bin\server\jvm.dll'
I'm going to try to keep working on this and see what I can come up with.
I found the jvm.dll in a folder named client, not server.
Final Edit: It looks like through problem solving and stuff like that I fixed it. It also runs,etc, etc. Said it didn't have enough ram so I ran it with -Xmx1024M -Xms1024M -jar also. I haven't logged on to check and see how well it runs, but it's working now.
Another Edit: Alright, it works like a charm when I run the .bat file, no lag, nothing wrong, it's great as all could be. But now, no one can connect. I've no clue why they can't. My friend keeps "Failing to Connect to Server" whenever I run it from the .bat file. Otherwise if I run the minecraft_server.jar or minecraft_server.exe it works, just fine. I use Hamachi for people to connect to my server, is that the problem?
Any tips on streamlining for a simple dual core AMD processor and 4GB? Memory isn't a problem at all...I'm looking to reduce CPU use. I'm thinking I should turn OFF parallel garbage collection. Setting UseSSE to 2 really helped. Someone suggest a better GC method that would better suit a dual-core (2.4GHz) setup.
Right now server runs great with 10 ppl or less, gets very slightly laggy around 12 players...once past that things get interesting. I'd like to up the cap from 16 to 32 but I'm not doing that until I can get the CPU use to calm down.
First of all, thanks for the help. I think I've got one last problem. It now says it doesn't recognize Java as a command, program or file. How do I fix this? Also, I didn't keep 64 bit Java because it didn't work and the link you included in your post was broken. So I've got 32 bit Java.
Alright, I got it to regonize Java, find the Minecraft server.jar, etc, etc, but now... when I try to open it or well, run the .bat, it says "Error: no 'server' JVM at 'C:\program files (x86)\Java\jre6\bin\server\jvm.dll'
I'm going to try to keep working on this and see what I can come up with.
I found the jvm.dll in a folder named client, not server.
Final Edit: It looks like through problem solving and stuff like that I fixed it. It also runs,etc, etc. Said it didn't have enough ram so I ran it with -Xmx1024M -Xms1024M -jar also. I haven't logged on to check and see how well it runs, but it's working now.
Another Edit: Alright, it works like a charm when I run the .bat file, no lag, nothing wrong, it's great as all could be. But now, no one can connect. I've no clue why they can't. My friend keeps "Failing to Connect to Server" whenever I run it from the .bat file. Otherwise if I run the minecraft_server.jar or minecraft_server.exe it works, just fine. I use Hamachi for people to connect to my server, is that the problem?
No problem. It's saying it can't find the server, because you probably don't have JDK. JDK comes with Java, and the development tools for it. Get that from here http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html
As for the connection issues..I don't really know. Make sure your firewall or anti-virus isn't blocking java.exe from accesing the internet.
Hamachi definitely isn't the problem, but you could try going to cmyip.com and giving your friends that IP address. You'll have to forward some ports, so take a look at this -http://portforward.com/, just browse to your router.
No problem. It's saying it can't find the server, because you probably don't have JDK. JDK comes with Java, and the development tools for it. Get that from here http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html
As for the connection issues..I don't really know. Make sure your firewall or anti-virus isn't blocking java.exe from accesing the internet.
Hamachi definitely isn't the problem, but you could try going to cmyip.com and giving your friends that IP address. You'll have to forward some ports, so take a look at this -http://portforward.com/, just browse to your router.
I love you. It works now. You are a true bro. Topic needs to be stickied.
@kaisersouse
remove -XX:+UseParNewGC
You can also try -Xmn100M this will increase eden space and survivor space.
-XX:SurvivorRatio=16 -XX:NewRatio=6 Also changes the ratio eden/survivor/old.
Been testing survivorratio and newratio Xmn
I think the best setup i can get. ( tested on small server cant test on big ones ) is:
Xmx=Xms= ( your ram for server 1024m stock )
Xmn= 10% of Xmx ( so for stock +-102M)
SurvivorRatio=16
Newratio=6
If some1 with a bigger server could test this. And also add -Xloggc:memory.log -verbosegc -XX:+PrintGCDetails.
And send me the memory.log after uptime ( 24h if possible or until a next server reboot ( ps its gets overwritten on server reboot) Then i can check your server usage and maybe scale the ratio's better
Thanks! Should I remove -XXParallelGCThreads=2 or is that used by more than ParNewGC?
Main specs:
AMD Phenom II x4 OC 3.8Ghz
4gigs 1600 DDR3 (will be 8 gigs in about 2 weeks after i get my dead RAM replaced through rma)
HD Radeon 5870
30gig SSD (boot) & 1T
Windows 7 ultimate 64bit
Server was incredably laggy and so far this thread has been the most helpful thing iv seen. Went from being able to host for only 3 players without lagging (because of cpu being maxed out when using 2 of 4 cores for server and making sure that no other demanding processes were running on the same cores) to 7 without any lag. Although i do have a few questions.
Any revisions ud make?
If i was going to bump -Xmn & Xms to 3000M each after i return to 8gigs of ram. When i do so, what sort of changes should i do to -XX:SurvivorRatio, -XX:NewRatio or -Xmn if any? I read that -Xmn should be 10% of ur -Xmx
Ima hardware guy and not so much into coding so sorry if im a pain :tongue.gif:
Optimizing java - or anything for that matter - isn't an exact science, it's more like an art. There are general things you can usually do, except.. Java's server VM does quite a few of them automagically. Guessing at these things can be very dangerous...and you won't notice until it's too late.
The reason why there are no actual guides on this - as well as why I haven't written one myself - is simply because it doesn't make sense to. Every environment is different and every one needs special, unique loving. This is why there are so many GSPs out there, for example. Each one has developed a working "secret" formula for their servers over time. This formula earns them money, so they won't share it. But even if they did, it wouldn't be too helpful as it is highly likely anyone elses' environment differs greatly.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2010
Posts:
51
Member Details
Ok, I read the entire post, but cant figure myself what command I can use.
My server has 2,2 ghz of processor, 2 gb ram, which command I should use to optmize it?
Thanks!
@EvilSeph LOLS every heard of google. And do you even bother to read...
And yes GSP do keep some stuff private. I do help one. But this stuff is available over the webs.
Your absolutely correct that java does stuff auto. But things i suggest it doesn't get selected automatic.
*sigh*, just because you can read doesn't make what you're recommending correct. Sure you can pretend to know how to optimize a Java and server environment, but if you don't understand what you're doing, you're doing more damage than good. Reading and comprehending != the same thing. And even comprehending doesn't help you that much, in this case. What you need is experience and an understanding of how Minecraft <-> JVM <-> System environment relate to each other.
You can laugh all you want, but I don't like it when people give out, potentially, dangerous advice. All I can say is, make the modifications GuardMoony suggests at your own discretion as they may result in server instability, world corruption etc.
@EvilSeph LOLS every heard of google. And do you even bother to read...
And yes GSP do keep some stuff private. I do help one. But this stuff is available over the webs.
Your absolutely correct that java does stuff auto. But things i suggest it doesn't get selected automatic.
*sigh*, just because you can read doesn't make what you're recommending correct. Sure you can pretend to know how to optimize a Java and server environment, but if you don't understand what you're doing, you're doing more damage than good. Reading and comprehending != the same thing. And even comprehending doesn't help you that much, in this case. What you need is experience and an understanding of how Minecraft <-> JVM <-> System environment relate to each other.
You can laugh all you want, but I don't like it when people give out, potentially, dangerous advice. All I can say is, make the modifications GuardMoony suggests at your own discretion as they may result in server instability, world corruption etc.
The only problem with this is I don't see one post where someone says they noticed a decrease in performance, instability, or corruption. Not to mention you haven't provided any alternative advice.
Well I'm not running any mod for a server. I also don't see a minecraft_server.jar. I've just got the vanilla server. How about instructions to do it with the regular server?
Actually, I found the file and everything, etc etc, made the .bat file and when I run the .bat file it says it can't find my minecraft_server.jar. How should I go about fixing this?
Just copy what I have above into your .bat file (change Minecraft_Mod.jar to minecraft_server.jar), and make sure it's in the same folder as minecraft_server.jar
As for running 64-bit Java, install it first of all from here https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter
Go to the start menu, right click on "Computer" and hit "Properties". Hit "Advanced system settings", on the Advanced tab, click "Environment Variables" at the bottom. Under System variables, scroll down until you find "Path". Click on it, and then hit "Edit...", near the end you should see something like "C:\Program Files (x86)\Java\jdk1.6.0\bin" -erase the "x86" so it will look like "C:\Program Files\Java\jdk1.6.0\bin".
@GuardMoony,
Yeah its still in beta. I really don't know much else about it other than its supposed to work faster.
You have to add the -XX:+UnlockExperimentalVMOptions tag to use it
Definitely seconding the sticky idea.
Have been trying to get a server to work on a POS that runs the game at the same time. So that me and my brother can play together. This thread has driven it from impossible to a possibility.
My specs:
2G Ram
2Ghz Processor
ATI radean HD 2400 video card (525mhz , 256mb Ram)
Still fiddling with the code from different posts. The best result I have gotten so far is:
Love this Thread a lot.
"Shall we play a game?" - Joshua
First of all, thanks for the help. I think I've got one last problem. It now says it doesn't recognize Java as a command, program or file. How do I fix this? Also, I didn't keep 64 bit Java because it didn't work and the link you included in your post was broken. So I've got 32 bit Java.
Alright, I got it to regonize Java, find the Minecraft server.jar, etc, etc, but now... when I try to open it or well, run the .bat, it says "Error: no 'server' JVM at 'C:\program files (x86)\Java\jre6\bin\server\jvm.dll'
I'm going to try to keep working on this and see what I can come up with.
I found the jvm.dll in a folder named client, not server.
Final Edit: It looks like through problem solving and stuff like that I fixed it. It also runs,etc, etc. Said it didn't have enough ram so I ran it with -Xmx1024M -Xms1024M -jar also. I haven't logged on to check and see how well it runs, but it's working now.
Another Edit: Alright, it works like a charm when I run the .bat file, no lag, nothing wrong, it's great as all could be. But now, no one can connect. I've no clue why they can't. My friend keeps "Failing to Connect to Server" whenever I run it from the .bat file. Otherwise if I run the minecraft_server.jar or minecraft_server.exe it works, just fine. I use Hamachi for people to connect to my server, is that the problem?
Right now server runs great with 10 ppl or less, gets very slightly laggy around 12 players...once past that things get interesting. I'd like to up the cap from 16 to 32 but I'm not doing that until I can get the CPU use to calm down.
Currently:
No problem. It's saying it can't find the server, because you probably don't have JDK. JDK comes with Java, and the development tools for it. Get that from here http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html
As for the connection issues..I don't really know. Make sure your firewall or anti-virus isn't blocking java.exe from accesing the internet.
Hamachi definitely isn't the problem, but you could try going to cmyip.com and giving your friends that IP address. You'll have to forward some ports, so take a look at this -http://portforward.com/, just browse to your router.
I love you. It works now. You are a true bro. Topic needs to be stickied.
Thanks! Should I remove -XXParallelGCThreads=2 or is that used by more than ParNewGC?
AMD Phenom II x4 OC 3.8Ghz
4gigs 1600 DDR3 (will be 8 gigs in about 2 weeks after i get my dead RAM replaced through rma)
HD Radeon 5870
30gig SSD (boot) & 1T
Windows 7 ultimate 64bit
Server was incredably laggy and so far this thread has been the most helpful thing iv seen. Went from being able to host for only 3 players without lagging (because of cpu being maxed out when using 2 of 4 cores for server and making sure that no other demanding processes were running on the same cores) to 7 without any lag. Although i do have a few questions.
Im using
@echo off
java -server -XX:+UseFastAccessorMethods -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelGCThreads=2 -XX:+CMSIncrementalPacing -XX:+UseAdaptiveGCBoundary -XX:SurvivorRatio=16 -XX:NewRatio=6 -XX:UseSSE=2 -Xmn102M -Xmx1024M -Xms1024M -jar Minecraft_Mod.jar nogui
pause
Any revisions ud make?
If i was going to bump -Xmn & Xms to 3000M each after i return to 8gigs of ram. When i do so, what sort of changes should i do to -XX:SurvivorRatio, -XX:NewRatio or -Xmn if any? I read that -Xmn should be 10% of ur -Xmx
Ima hardware guy and not so much into coding so sorry if im a pain :tongue.gif:
The reason why there are no actual guides on this - as well as why I haven't written one myself - is simply because it doesn't make sense to. Every environment is different and every one needs special, unique loving. This is why there are so many GSPs out there, for example. Each one has developed a working "secret" formula for their servers over time. This formula earns them money, so they won't share it. But even if they did, it wouldn't be too helpful as it is highly likely anyone elses' environment differs greatly.
BEEN TRYING TO POST THIS ALL DAY ._.
My server has 2,2 ghz of processor, 2 gb ram, which command I should use to optmize it?
Thanks!
*sigh*, just because you can read doesn't make what you're recommending correct. Sure you can pretend to know how to optimize a Java and server environment, but if you don't understand what you're doing, you're doing more damage than good. Reading and comprehending != the same thing. And even comprehending doesn't help you that much, in this case. What you need is experience and an understanding of how Minecraft <-> JVM <-> System environment relate to each other.
You can laugh all you want, but I don't like it when people give out, potentially, dangerous advice. All I can say is, make the modifications GuardMoony suggests at your own discretion as they may result in server instability, world corruption etc.
The only problem with this is I don't see one post where someone says they noticed a decrease in performance, instability, or corruption. Not to mention you haven't provided any alternative advice.