How To Improve Minecraft Server Performance

Discussion in 'Bukkit Help' started by TnT, Jan 15, 2011.

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

    QQCucumber

    @TnT I have a question about sudo swapoff -a, is this a command that only ever needs to be run once or should I put it in my startup script? And what's the command to turn it back to normal should I ever see fit?
     
  2. Offline

    TnT

    You need to run it after every reboot. To be honest, you can likely skip turning it off - I forget most of the time, as I don't have it in my startup script.

    If you want to turn it back on, you can use
    Code:
    sudo swapon -a
    If you use the free command, you'll see what your current usage is at. (free -m shows output in MB).
    Code:
    tnt@Dozer:~$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          5984       4147       1837          0        277       2464
    -/+ buffers/cache:       1405       4578
    Swap:         1715          0       1715
    tnt@Dozer:~$ sudo swapoff -a
    [sudo] password for tnt:
    tnt@Dozer:~$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          5984       4149       1834          0        277       2467
    -/+ buffers/cache:       1404       4579
    Swap:            0          0          0
    tnt@Dozer:~$ sudo swapon -a
    tnt@Dozer:~$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          5984       4151       1832          0        277       2467
    -/+ buffers/cache:       1405       4578
    Swap:         1715          0       1715
    
     
  3. Offline

    PacketCollision

    I actually don't recommend turning off swap. Sure, it's probably not actually needed if you have lots of ram, but if you do run out of physical memory, it's better to swap than to crash. The Linux virtual memory system does not tend to swap out unless it is needed.
     
  4. Offline

    Spikey

    Hi TnT,

    I am trying to use your backup script on my CentOS system as I am using a ram disk, however I keep getting the following error while running it.

    Code:
    chown: cannot access `/home/minecraft/minecraft/world\r': No such file or directory
    Do you know why I would be getting this error ?
     
  5. Offline

    Livewire

    Cause the directory doesn't exist; I would bet it's because you did \r instead of /r.
     
  6. Offline

    Spikey

    Hi Livewire,

    I know that the directory at \r wont exist the problem is, it for some reason gave me that error message when pointing it to the world directory.
     
  7. Offline

    Livewire

    Hmm...Not a linux guy so this'll be a tricky one for me, but I do know \r is a linux code for Carriage Return - is it possible there's a rogue newline in there, perhaps \r\n when its looking for \n ?

    I'd recommend Notepad++ or some other editor capable of showing the newlines at the end of the line; if it does try removing the first character of the two.
     
  8. Offline

    Spikey

    Hi Livewire,

    Thanks for your help, you jogged my memory into creating the start.sh file directly from nano not from my ftp software. Problem Solved!
     
  9. Offline

    ioScream

    Oddest thing.. I had a sudden burst of speed today.. I was loading in .2 seconds, which is good for me.. using ramdisk and all.. now it's back to around .7.. with or without ramdisk.. how can I ASSURE that this being loaded into ram.. i've looked, and it's not going into swap.. is it possible to just mount free space on a drive that could fool you into thinking it's going into a ramdisk? Also, do you think it's possible that I got lucky and the ramdisk mounted into a piece of significantly faster ram? It's not my computer, I just control it.. so I'm not sure on the specifics of the ram type..
     
  10. Offline

    turtlelink2

    Is their a guide somewhere for windows equivalent of the RAMdisk part?
     
  11. Offline

    PacketCollision

    You could try using ImDisk, but I can't really give you more specific directions than that. You should be able to convert the shell scripts into batch scripts to help with the copying to/from the ramdisk.
     
  12. Offline

    woodzy

    ur lucky :/ on my host it will cost me $64 Per 1GB of ram added to my server...... but hay! i got 6 cores, fiberoptic, 4GBram, and 50GB HD, and all for $20. cheap but the upgrades cost more.
    anyway i dont get how the err ramdisk works. it is SWAP? in ubunto10_10 X64
     
  13. Offline

    tremor

    I just found this thread and am not weaping and devastated. Back on pages 2 & 3 I saw the info about RAM and 32 bit OS. The VPS I've rented out 4gb ram, centos... is on i686.

    All this time I've had 2560 MB ram set to my minecraft server - and what we are saying is that it will only use 1.5GB? My vps host doesn't allow swap or ramdisk.... i am literally shouting much profanities here, because I'm freaking out of cash with a shit box vps that wont handle the load I've been wanting to put into it. FML.
     
  14. Offline

    TnT

    @tremor
    Can you give me the output of your java -version command, and the contents of your start file?
     
  15. Offline

    Phaedrus

    Check out Dataram ramdisk. It has a good setup guide. it's free for disks up to 4gigs. I use it and have it configured to sync the ramdisk back to disk every 5 minutes, and to automatically save and reload the disk on reboot. works flawlessly so far, though i do recommend having regular backups regardless.
     
  16. Offline

    The PC Tech Guy

    Since I'm a Windows user as well, how can I configure ramdisk to start in a directory, as shown in the OP? Unless there is a way to map the world on another drive via server.properties? Or do I have to add all the server files in the RAM disk (which I don't want to do)?
     
  17. Offline

    Phaedrus

    @The PC Tech Guy
    I put my entire server on the ram drive. I figure instant access to config files and databases can only help performance.

    However, if you only want your world files in the ram drive you'll have to create a symlinked folder in your server directory that points to you ram disk.

    Here's a quick run down of how to do that. I haven't tested it word for word, but I've used the technique in the past. I'm also assuming you're using windows 7.

    First create the ramdisk and copy your world files there, and then

    open the command prompt and navigate to your server directory like so
    Code:
    cd C:/bukkitserver
    
    Then type the following
    Code:
    mklink /D WORLDFOLDERNAME "R:/yourramdrive/worldfoldername"
    
    Replace WORLDFOLDERNAME with your world folders name, and replace the R:/ path with your actual path to the world folder on your ram drive.

    That will create a symbolic link in your server directory that points to the world files on your ram drive.

    Personally I think it's just a lot easier to have the entire server on the ram drive and to backup the entire ram drive on a scehdule.
     
    The PC Tech Guy likes this.
  18. Offline

    The PC Tech Guy

    @jasonznack
    I wonder why I never got an alert for a tag... anyways, I was thinking of doing that, but I'd like to use a program like Goodsync or something to back it up to the harddrive, as the backup program I use backs up to the directory (it's a feature in the server wrapper). I thought that I could do that, but I don't really want to configure a backup program to copy all of those files, especially when some are being used and locked in the process (I know they can be shadow copied, but it can cause problems...). I've got around... oh 46+ plugins...

    In other words, thanks for the help! I use Windows Vista ATM, so if it doesn't work... well I guess I'll try running my server in a Ramdisk. I only have 2GB of RAM on this laptop, but I have borderguard...

    Update: Nice, it works! Just needed to run command prompt in UAC mode, and I think the forward slashes are supposed to be backslashes (for the path)? It could work either way, I think, but I used backslashes.

    Another update: I guess this also means I can run certain plugins (such as BigBrother) in a RamDisk as well! XD
     
  19. Offline

    Phaedrus

    The sym link should be transparent to any program that access the directory, so your server wrapper or whatever won't know the difference.

    You can make the ram disk as small as you need, and limit it with borderguard, a ram disk will perform much better than a laptop hard drive.
     
  20. Offline

    pomo4ka

    Hi, I would like to know what to change if we make the generation of the world is not in memory, as well as here described, on the HD? Thank you.
     
  21. Offline

    TnT

    If I understand what you're asking for, you'd just skip setting up the ramdisk. It will, by default, run on the HD.
     
  22. Offline

    pomo4ka

    Tell me how to make a virtual disk Dataram Ramdisk for Windows 7.
     
  23. Offline

    Phaedrus

    Follow the step by step instructions provided by data ram. it even has pictures. RTFM
     
  24. Offline

    pomo4ka

    I mean how to configure craftbukkit by Dataram.
     
  25. Offline

    Phaedrus

    Make the ram disk and put the server files in the resulting drive.
     
  26. Offline

    pomo4ka

  27. Offline

    TBK

  28. Offline

    pomo4ka

    I created a virtual disk, put there the folder with the server, run. In the end, nothing helped, so the same memory loads.
     
  29. Offline

    TBK

    You won't save memory, but the files are faster accessed by minecraft and java.
     
  30. Offline

    pomo4ka

    When the server about 20 hours, he eats 3GB of RAM. How to get rid of the scourge?
     
Thread Status:
Not open for further replies.

Share This Page