Showing posts with label machines. Show all posts
Showing posts with label machines. Show all posts

Friday, November 28, 2014

Running a craftbukkit minecraft server for less than 512MB of RAM

Note: This post is not for those looking to run a server on a Raspberry Pi. There's a lot of guides for that, and you don't need any additional help

If you play minecraft, you probably know how memory demanding this game can be. This is the same with minecraft servers as well, and if you're running craftbukkit with a good amount of plugins involved, you might as well just have sold your RAM sticks to Satan himself.

The problem is, a lot of people like me might not have enough RAM on our systems, but we still want to run one of those fancy community minecraft servers anyway. So what do we do to solve the impossible?

Well in my case, the machine I wanted to run a bukkit server on was a Digital Ocean VPS that I rented primarily to host my website. Unfortunately, my droplet featured only a 512MB memory module and my LAMP package took up a good percentage of that. So that left me with something close to 350MB of memory for anything else.
Having had experience at running heavy bukkit servers on my home desktop before, I knew that if I ever wanted to run a minecraft server off this system, I'd have to come up with a good solution.

If you've done a bit of research prior to reading this post, you'll know that Spigot is an optimized version of craftbukkit for this very purpose. So the first thing I did was simply drop the spigot jar file on my VPS and run this command :

java -Xms192M -Xmx512M -XX:MaxPermSize=128M -jar spigot.jar

Everything loaded up fine, but whenever I connected to it via my Minecraft client, the Java process got killed by the OS. I tweaked around with the Xms and Xmx flags in the command but no matter what, the server process never survived after a player connecting. All I could see was "Killed" before the process exited and I was sent back to the command line.


After lots of searching on Google and posting on forums, I got the same answer everywhere:

I simply did not have enough RAM on my machine. 

Almost ready to give up, I found this post on my VPS company's support forum.
All Digital Ocean droplets came along with SSD drives for hard storage. In that context, the answer made a lot of sense. Even if the java process did use some of my SSD for memory, the fact that they were Solid State Disks, and not regular Hard Disks should reduce the lag issue that arises from this solution by a huge factor.
Turns out, my VPS did not have swap enabled by default, so I followed the guide provided for my version of Ubuntu to set it up.

Once done, I launched the minecraft server, and voila! It's been running ever since, even with a couple of bukkit plugins attached.
So in summary. if you have less memory to run a minecraft server, the most likely solution is to use a swap file/drive along with your system.

Hopefully, this guide has helped you learn some concepts at least if not for directly helping you out with your issue. If you have the time, feel free to drop by my minecraft server. Point your clients to "enkrypt.in" and you should be set.

Wednesday, April 25, 2012

Artificial Intelligence

This post is part of the "First Few Old Blog Posts" archive.
You could expect a certain lack of coherency/maturity from these posts.

Note from author: 
None of this text is guaranteed to be true or considered a fact as the field of study has a considerable margin for error. This is just an approach at calculated assumptions to better understand the beginning of AI and how it functions and propogates behind the scenes. There is a high chance that some lines here can be proven WRONG as per standards

Allright then , Artificial Intelligence -
What it means in the simplest level:
The ability to make a decision by oneself based on a combination of circumstances , advantage , consequences and personal favours

Aim:
To simulate the human thinking process whose characteristic features are to be parallel and seemingly random

And thus we arrive to-
The root of Artificial Intelligence:
Random. Just being randomly random. The key to AI is to implement this randomness which is similar to the random thoughts of the human mind

Level 1 - Random choice between 2 options :
Technical - 0 , 1
Application - Yes , No


Level 2 - Random choice between finite options :
Technical - A , B , C , D , E , F
Application - Red , Blue , Black


Level 3 - Make an independent decision
Technical - Corrupt Memory. Decision to proceed
Application - Someone unknown to you , throws a punch at your face all of a sudden. Response to that action



Artificial Intelligence at its maximum will be capable of distinguishable characteristics of a human. Keeping secrets , having dreams , emotion etc. Although it is technically impossible for a machine to feel emotion , an imitation is what could be achieved.

The ultimate evolution will take place when the AI will be powerful enough to develop AI by itself. The potential of development then will be massive. But with every shred of success , comes a significant amount of danger. Machines , if out of control , could end up wiping out the whole of the human race with the mental capabilities of a human. Alas , with the opportunity of a gigantic scientific evolution comes the potential of the  Armageddon.

Levels of AI simulation:


Level 1 - 100% random
No relation of output with input and output generated would probably have been the same if another input was given


Level 2 - Imitation at reality
Not what we call REAL AI. But behaves into making you believe that it is. Just an imitation of intelligent talk.
Dis-functions when you try smart conversation


Level 3 - REAL AI
Behaves in every way that matters , as another human would with Level 3 of the random levels.


Level 4 - FULL AI
Processing and non redundant capabilities of a machine combined with the mental superiority of humans would be able to create AI by itself and will be a master at perfection.