Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Any tips and tricks for working with low RAM VPS instances?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Any tips and tricks for working with low RAM VPS instances?

I'm talking shared Linux instances having 64/128/256 MB of RAM. I know this much that we should prefer Debian over Ubuntu (server) for these configurations. From my tests, Debian itself takes about 40-50 MB.

I've also noticed that usually these offers are using OpenVZ as opposed to KVM. Some OpenVZ configurations don't allow swap to disk.

So...How LET community handles such scenarios?

Comments

  • cybertechcybertech Member
    edited January 2023

    by upgrading to a proper 2GB ram VPS as minimum. RAM no longer costs a premium.

  • HalfEatenPieHalfEatenPie Veteran
    edited January 2023

    @harrison said:
    I'm talking shared Linux instances having 64/128/256 MB of RAM. I know this much that we should prefer Debian over Ubuntu (server) for these configurations. From my tests, Debian itself takes about 40-50 MB.

    I've also noticed that usually these offers are using OpenVZ as opposed to KVM. Some OpenVZ configurations don't allow swap to disk.

    So...How LET community handles such scenarios?

    This was a problem back in the day.

    The reason for Debian was because it was (in general) the lighter install. I know some places offered puppy linux to go even a bit further (or apline) but yeah.

    The reason why it's OpenVZ is because KVM will need RAM for the actual linux kernel, which means you'll need more than 32 MB/64 MB of RAM. OpenVZ is basically paravirtualization, so your RAM usage is based on running your own container and the RAM required for the kernel isn't required (this is generalizing it but it's good enough of an explanation).

    This really depends on what "minimal" template you were using for OpenVZ. There were a few scripts running around like maxexcloo's minimal server template https://lowendtalk.com/discussion/780/scripts-minimal-server (or https://lowendtalk.com/discussion/856/wip-minstall-a-framework-for-server-management ). But these scripts no longer work as well.

    Basically, similar to what @cybertech said, that much RAM is no longer really used because RAM is cheap and some programs just need RAM. 32-64 MB RAM servers were primarily used for VPNs, ZNC, a very basic web server, and (I think?) TOR relay node.

    I think at one point someone was able to strip down a minecraft server to the bare minimal and got it running on 128 MB.

    But if you want to do something else, it's probably better to stick with a 512MB RAM server at a minimum.

    The 32-64-128 MB RAM VPS server was the real low-end boxes. That challenge was pretty interesting to see, how people optimize their servers for the best in security and operations. But nowadays it doesn't matter anymore.

    Thanked by 2harrison let_rocks
  • davidedavide Member
    edited January 2023

    My router runs linux kernel 3.10 on a TP-Link with 32 MB RAM, with 10 MB left free, and offers a dynamic website:
    It's Busybox with its own libc. Using regular debian, bash and libc, a similar environment can surely be reached within 128 MB without effort. 64 MB should be possible with kernel tuning and 32bit userspace.

    Thanked by 2harrison let_rocks
  • I still have a handful of 256MB or 384MB boxes from past sales. Most of them run very lightweight workloads so they are good for now. For larger projects I'd rather get a dedi and cancel all the small boxes to save both time and money.

  • ArkasArkas Moderator

    You can use it as a NAT

  • IMHO, it really depends on your demand. Let us talk about tiny boxes with 128MB RAM.

    For websites with few visitors, it works smoothly with Nginx & PHP & SQLite on an 128MB toy box;
    For websites with considerable QPS, say >=5, I suggest go with Golang and SQLite. Thanks to GOMEMLIMIT introduced by Go 1.9, GC could be more aggressive and the program tends to fit tiny box way better.
    For standalone services w/o a database, e.g., a small KV store or a service finding the nearest vector, you' d better stick with C/C++.
    For network services, such as a VPN, don't bother, they should be just fine even with default settings.

    I personally wrote C/C++ modules for critical parts and connected them to PHP on extremely small VMs in the good old days.

    P.s., I used to run a Web service, ~5 QPS, on top of Nginx, PHP 5, Redis and MySQL on an OpenVZ container with 128MB RAM from RamNode without any issue. While a vSwap sized 128MB might contributed a lot, I presume.

    Thanked by 2maverick harrison
  • vsys_hostvsys_host Member, Patron Provider

    Most do not use such a small amount of memory for VPS anymore.
    Almost all VPS hosters have a minimum amount of RAM - 1 GB. It's not that expensive. Less than 1 GB is used only for OS routers (Mikrotik).
    Therefore, the easiest option would be to consider 1 GB.

    Thanked by 1harrison
  • Wireguard runs just fine on 64MB Debian servers.

    Thanked by 1harrison
  • Check out Alpine Linux + ZRAM

    Thanked by 1harrison
  • You can install Alpine Linux with this script

    Thanked by 1harrison
  • @stoned said:
    Check out Alpine Linux + ZRAM

    @loay said:
    You can install Alpine Linux with this script

    Yeah, it takes less disk space but does Alpine use less RAM than Debian?

  • stonedstoned Member
    edited January 2023

    @harrison said:

    @stoned said:
    Check out Alpine Linux + ZRAM

    @loay said:
    You can install Alpine Linux with this script

    Yeah, it takes less disk space but does Alpine use less RAM than Debian?

    Yes, due to fundamental c library alternative musl and other optimizations on package compilation.

    Alpine Linux can be installed as a run-from-RAM operating system making it perform at near direct RAM to CPU bus speeds.

    Thanked by 1harrison
  • OP's question is similar to old Raspberry Pi 1 devices with super low RAM. I've found Alpine Linux works well on it.

    Thanked by 1harrison
  • Almalinux or Rockylinux, have tested both in 64MB ram before but you are very near to the edge. 128MB and these will run fine.

    Thanked by 1harrison
  • Step one is not running a minecrap server on it. Regardless, with 256MBs of ram, one can do quite a lot, suprisingly. Just gotta tinker a bit usually.

  • edited December 2023

    Debian used to run just fine with 64MB RAM too (long time tested on actual hardware) but these days it takes some voodoo to even get it installed from what i've heard. Chances are Devuan instead of real Debian would already cut a noticeable bit of resource use since i expect systemd not only to be a turd in general but also a waste of resources. Beyond that there's only the kernel itself left that could have grown over time so compiling a custom slimmed down or even legacy version should drop RAM usage back into workable levels.

Sign In or Register to comment.