MEGA lags with few plugins and 30 players, will pay for fix

Discussion in 'Bukkit Discussion' started by lauris3722, Oct 15, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    lauris3722

    Hello..
    I'm trying to decrease a lags on my server, server runs on 3x slowmo, zombies are almost not moving at all and console is being spammed with overloaded messages (every second).. I will pay 10$ (nothing much, but i think someone will want it :D) to those, who will find why server is lagging..

    My skype: hellbender113

    Server specs are really good, it have two 4x processors (intel) and more than 10GB ram..
     
  2. Offline

    sukosevato

    Lmao two 4x processors? :p

    And at what speed do they run? Seeing as you only use 1 core lolz
     
  3. Offline

    Acrobot

    @sukosevato
    1.8 doesn't use only 1 core. However, if @lauris3722 hasn't got for example 64-bit java, his server will be lagging.
     
  4. Offline

    Switch0r

    Can you explain why 64bit java would give lag ?
     
  5. Offline

    wassilij

    start.bat?
     
  6. Offline

    lauris3722

    Not sure.. as far as i know, 2.4GHz.
    Both processors are at 10-20% usage.

    Well, yes, im on 64-bit java.

    java -d64 -server -Xmx4G -Xmn1G -XX:+DisableExplicitGC -Xnoclassgc -XX:SurvivorRatio=16 -XX:+UseAdaptiveGCBoundary -jar craftbukkit-0.0.1-SNAPSHOT.jar
     
  7. Offline

    Acrobot

    @lauris3722
    Change it to just be
    java -d64 -server -Xmx6G -jar craftbukkit-0.0.1-SNAPSHOT.jar

    @Switch0r
    Mistyped - I meant, if he hasn't got.
     
  8. Offline

    lauris3722

    It was like that before, lags were by 40% bigger.
     
  9. Offline

    Acrobot

  10. Offline

    lauris3722

  11. Offline

    wassilij

    any other errors in the server.log?

    //edit:
    try to remove all plugins, lag?
    if yes, new map, lag?
     
  12. Offline

    lauris3722

    I will try to remove plugins tomorrow.. And yes, server lags also with small/new map. No errors in server.log (only sometimes socket close error..).
     
  13. Offline

    Switch0r

    Acrobot what does -d64 do?
    Because i am not using it, could you explain it a bit more
    This my start line: java -Xmx10G -XX:parallelGCThreads=4 -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui
    I am using windows 2008R2 and java 1.7 64bit
     
  14. Offline

    nala3

    Code:
    java -jar -server -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParrallelGCThread=4 -XX:+DisableExplicitGC -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=19 -XX:TargetSurvivorRatio=90 -Xmx6G -Xincgc nogui craftbukkit-0.0.1-SNAPSHOT.jar
    
    derp.
    @lauris3722
     
  15. Offline

    Acrobot

    @Switch0r
    I have no idea - it probably forces to use x64 java.

    So you don't have to use it if you have -server already.
     
  16. Offline

    Switch0r

    i have only java 64bit installed so do i need -d64 ?
     
  17. Offline

    lauris3722

    I don't get it... why derp?
     
  18. Offline

    nala3

    idk because I felt I should post something besides just a code box XD
     
  19. Offline

    Pr4w

    You should read EvilSeph's post about Java flags. Basically the final -Xincgc is cancelling out "XX:+UseConcMarkSweepGC -XX:+UseParNewGC" ;)
     
  20. Offline

    TDT-Alpha

    So it needs to be -Xms#G? (Mine is -Xms1G 'cause I try to use the computer, too XD)
    BTW: I'm no expert and I wont be in the following time so don't treat me as one :) But I do want to make my MC Server (And the game itself) work better...


    (Sorry if bumping, found the article from Google and I must do that...)
     
  21. Offline

    nala3

    orllynow? I may have to check that out, well anyway I found that those GC flags really help :)
     
  22. Offline

    Pr4w

  23. Offline

    TDT-Alpha

    Aha.. so Xms holds the memory space for the app while Xmx specifies the maximum memory usable by the app (which didn't seem to be true the last time I run the server - it used 3GB but had -Xmx1G ~weird~)
    Anyway, "-XX:parrallelGCThread=4" didn't work for me it said that it isn't supported command or something like that, is there any other way to set the threads for the app?
    And another thing, what does -server command do? I know it runs it as a server but what does it run as a server?
     
  24. Offline

    Pr4w


    Maybe you had the command written wrong or something, or potentially a memory leak ? But -Xmx1G is supposed to limit the amount of Ram the JVM can take.
    Don't set the amount of ParallelGCThreads, let the JVM decide, it's better !

    And -server, basically it means a slower start time, but better performances once it's warmed up. :)
     
  25. Offline

    TDT-Alpha

    Do you mean that Java can make the app start slower and let it work better? I didn't know that it's possible that Java will change the performance of the apps... So I should use it for all of my apps if I want better performance?

    (I'm going soon into learning Java to make an application which can launch other executable with different arguments, and it should start VERY fast so it'll be more useful than other ways.. The current VisualBasic.net version of it is slow and has many many bugs..)
     
  26. Offline

    xianthax

    Java code isn't optimized at compile time. Well, not much anyway, this is why its so easy to decompile. Compiling java only creates bytecode, not machine instructions.

    The JVM is responsible for converting the bytecode into machine instructions for whatever platform its running on, that is compiling the bytecode. Part of this process includes use of a JIT (Just in Time Compiler) and various forms of optimization. The Sun JVM is called "HotSpot" because it constantly monitors the execution of the code and when it finds sections of code that are run very often or are taking along time (Hot Spots) it applies additional optimization to those sections of code.

    So yes, when a java program first runs, it will be slower than after its been running for a period of time because the JVM will have detected the "HotSpots" and applied additional optimization to them.

    The -server flag basically tells the JVM to be more aggressive in optimizing the code as the assumption is that start up time doesn't matter on a server and that the program will be running for a long time doing the same things over and over again.

    Without the -server flag the JVM runs in client mode and does less optimization, favoring fast start up time and assuming that not as many actions will be constantly repeated in the future.

    No one should be using -Xincgc at all yet i see it in 90% of the start lines on the forum ;)

    The only reason its mentioned in so many places on the web is that in java 5 it was equivalent to -XX:+UseConcMarkSweepGC, A useful setting.

    However its meaning is different in Java6, Specifically it imposes:

    -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode

    -XX:+CMSIncrementalMode forces the GC to run very small GC passes more often.

    It was designed for 1-2 CPU systems to eliminate GC pauses at the expense of additional continuous overhead. It specifically recommended by Sun(Oracle) that this setting is not used on 2+ CPU systems or with large heap sizes, which of course is exactly what most of the performant minecraft servers out there are :D

    If your GCing in separate threads already and or have a large heap then all CMSIncrementalMode and therfore -Xincgc, is doing is costing you CPU usage, more the large your heap is.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  27. Offline

    Pr4w


    So what do you reccomend ? Been looking for something good for a while. :)
     
  28. Offline

    lauris3722

    Today we tested the server, we launched the server with no plugins or libs at all - same mega lags, mobs were moving really slow. After that, we launched server without plugins and with new map (newly generated) ( old map had fixed borders to 2000x2000). And there it is... no lagging at all, everything works perfect! Can someone tell me, how is that possible? I don't want to start a new map.. Maybe server needs some configuration to run big maps?
     
  29. Offline

    TDT-Alpha

    Maybe the map is full of drops and it caused that as said before (or in another thread I saw)
    You can check that up, try to overload the server with drops (or) redstone (or) physics (sand, gravel, etc.) (or) slow player computers\internet connection.

    By the way - (IDK about others but) I DO recommand to use the Hamachi program so users who didn't port forward wont slow down your server with their high latency.

    PS. I tested out something with my poor server (Pentium 4 Dual Core 3GHz, 1GB Ram) - 2 Players with a distance of 10K blocks from each other on a pre-generated map will slow down the server more than having 4 players in the same area with redstone working.. IDK, may be in my case it's a RAM issue.

    Hope that logistics have helped you here! :)
     
  30. Offline

    Acrobot

    @lauris3722
    Bugged chunk / loads of vehicles (boats and minecarts) / drops / redstone clocks.

    You could try using Chunkster, BACKUP YOUR MAP FIRST.
     
Thread Status:
Not open for further replies.

Share This Page