amuck-landowner

[REQUEST] How to set up a very small VPS

D. Strout

Resident IPv6 Proponent
As the title indicates, this is not a tutorial but a request for one. I'd like to know what the best way is to set up a really small VPS (64MB or less) to use the minimum amount of memory. Reply here, and once a good tutorial is added as a reply, I'll remove the request flag and link to the appropriate post here. IMHO, this is how further requests should be done. No sense making a whole subforum for them.
 

KuJoe

Well-Known Member
Verified Provider
In reality the provider should have a minimal template for you to use. I think most have a Debian template that uses less than 8MB of RAM.
 

HalfEatenPie

The Irrational One
Retired Staff
Well, not really a tutorial but just a brain garble of my thoughts.

Debian is probably the best way to start a small-memory VPS.  This is because apt-get uses less memory than yum.  Start with the Minimal template as everyone have stated (open up a support ticket if they lack this, I was using a minimal template earlier today actually from Prometeus, Debian 7 32-bit minimal that used 2mb of ram).  

Everything depends on what you need but here are some simple rules:

Use dropbear instead of OpenSSH.  Dropbear is known to have a smaller memory footprint.  

If you're setting this up with the purpose of a IRC Bouncer (ZNC) then follow ZNC's standard installation procedures.  In the end, my installation used up 4mb of RAM from Prometeus's 50mb VPS container I have.   If you want OpenVPN, then similar process (remember SNAT instead of MASQUERADE).  I do remember MrAndroid installing Minecraft on IPXCore's 32mb VPS container.  Everything was disabled and only thing generated was a flat land filled with stone though.  That's about it.  

In reality, it's just installing the softwares you need and then modifying their configurations to reduce the memory usage.  E.g. MySQL can reduce their memory footprint by disabling certain functions.  I believe FreeVPS.us is hosted on ServerDragon's 96mb VPS.  
 

jcaleb

New Member
use old LEA articles bro, or minstall. btw, what do you want to setup? just a bare OS and as little ram as possible?
 

D. Strout

Resident IPv6 Proponent
use old LEA articles bro, or minstall. btw, what do you want to setup? just a bare OS and as little ram as possible?
For now, just the bare OS. Eventually, I'd like to get an nginx, PHP, and noSQL setup going.
 

mikho

Not to be taken seriously, ever!
If you start eith debian and then use minstall and its clean-packages, you would be down to 4-8mb usage.


Then you can start lookin on whats left, like changing to dropbear like alteady said.


LEAs posts are a good startig point, but it feels somewhat incomplete now since time has passed.
 

nunim

VPS Junkie
For now, just the bare OS. Eventually, I'd like to get an nginx, PHP, and noSQL setup going.
apt-get remove apache* bind9* samba* sasl* exim* sendmail*

>add dotdeb repo's

apt-get update

apt-get install nginx php5-fpm

Lower the nginx worker count and  php5-fpm pool to 1 worker, disable nginx caching.  Can't help you with noSQL as I run mySQL.  This is from my Secure Dragon Xen running nginx, php5-fpm, mySQL hosting my WordPress install and some monitoring software.


root@xen:~# uptime && free -m
 02:18:04 up 287 days, 19:34,  1 user,  load average: 0.21, 0.08, 0.02
             total       used       free     shared    buffers     cached
Mem:            89         85          4          0         16         42
-/+ buffers/cache:         26         63
Swap:          255          6        249

In that example I am actually running php 2 workers so my memory could be quite a bit lower, my OpenVZ's are even lower on memory usage.  I don't bother with dropbear but I do usually install rsyslog.  Don't forget to lower the PHP max memory size so applications like wordpress don't try and grab more ram then you have.

From an OpenVZ looking-glass node running nginx + php5-fpm and monitoring software:

Code:
19:41:32 up 4 days, 18:44,  1 user,  load average: 0.12, 0.03, 0.01

             total       used       free     shared    buffers     cached
Mem:           128         15        113          0          0         6
-/+ buffers/cache:          9        118
Swap:          128          0        128
 
Last edited by a moderator:

drmike

100% Tier-1 Gogent
Glad to see this topic and hopefully more folks will come on in on this thread and talk about true low end installs.

Many OpenVZ providers seem to stick the plain bloated install images in there system.  Unsure why they do this as opposed to using with Debian the minimal installs as the default.   

I've taken more and more to requesting my providers have the minimal install as an option.  Why?  Because it's simple for them to get the image in there and saves me uninstall and cleanup time.  Overall it has possibility of trimming wasted RAM consumption on their server also.

Point your provider over to here:

http://openvz.org/Download/template/precreated

These are the current images you want loaded, well 2 out of the three:

debian-7.0-amd64-minimal.tar.gz

2013-04-08 19:46:51

74 Mb

debian-7.0-amd64-minimal.tar.gz.txt

2013-04-08 19:48:10

454 b 

debian-7.0-i386-minimal.tar.gz

2013-04-08 19:47:15

75 Mb

debian-7.0-i386-minimal.tar.gz.txt

2013-04-08 19:48:33

451 b 

debian-7.0-x86_64.tar.gz

2013-05-06 15:03:15

116 Mb

debian-7.0-x86_64.tar.gz.txt
 

wlanboy

Content Contributer
Lighttpd + PHP + Thin (Ruby) + OpenVPN + SSH + Cron +xinetd + vnstat + nullmailer on a 64MB vps:


me@dotvps:~$ free -m
total used free shared buffers cached
Mem: 64 58 5 0 0 10
-/+ buffers/cache: 47 16
Swap: 64 4 59

34gn43l.jpg
 

willie

Active Member
I just use standard Debian distro and purge apache2, samba, sasl, and a couple other things. The remaining stuff takes maybe 5mb on a small vps. If you want to go -really- small, try Angstrom (angstrom-distribution.org) which was originally made for PDA's and is also used in stuff like routers and other embedded systems. In that world, 64MB is a big machine.


Dropbear makes more difference if you frequently have multiple ssh connections. OpenSSH connections have a larger footprint.
 
Last edited by a moderator:

mikho

Not to be taken seriously, ever!
Anthony made a great job on his template that is used on lowendspirit.


Since it is low on RAM it needs to be optimized.
 

D. Strout

Resident IPv6 Proponent
Lots of useful stuff here. What I'm looking for is a post that puts it all together, keeping in mind overlap (as in, I'm sure minstall is similar to what you get with a minimal template). That can be the final tutorial post I link in my first post.
 

mikho

Not to be taken seriously, ever!
Lots of useful stuff here. What I'm looking for is a post that puts it all together, keeping in mind overlap (as in, I'm sure minstall is similar to what you get with a minimal template). That can be the final tutorial post I link in my first post.
Using the minstall "remove-packages" usually purged more then the average minimal template.
On every debian vps I have, even the ones installed as "minimal" i run minstall and saves a few more MB before installing the services that I need.


The only negative thing I found is that since you remove alot of packages, some things are harder to install since its missing some dependencies.
 

willie

Active Member
I think the small Debian packages are small enough in terms of memory and can't be shrunk much further. Removing more stuff can save a little disk space, but the LES template is already in the 100MB range which is pretty small (even tiny VPS's come with 2GB of disk these days). So the disk savings are already well into dimishing returns.
 
Last edited by a moderator:

365Networks

New Member
I prefer to use a minimal install of Debian 32bit, I find minstall actually installs some stuff that isn't needed, and https://github.com/TigersWay/VPS works way better. Note that you need to manually turn dropbear on and SSHd off, or you will be locked out of the box. I find this gives me about 4-5MB RSS and I guarantee it ain't getting much lower then that!
 
Top
amuck-landowner