WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2025 Poal.co

729

Not interested in distros. I have a cheap 1GB RAM Ubuntu vps that needs to run stuff requiring 3+GB of RAM resulting in 2+GB swap file. My gut instinct tells (incorrectly?) me it should be possible tweak Linux for such conditions. I dont expect miracles (or maybe I do?) but it has to do a thing that can take up to an hour, getting this time down a bit would be great. If it is slower under normal conditions I don't care as I can just set setting to defaults under such normal conditions.

I have experimented a bit with zswap and "think" performance got a bit better with some values. Will try zram next.

Not interested in distros. I have a cheap 1GB RAM Ubuntu vps that needs to run stuff requiring 3+GB of RAM resulting in 2+GB swap file. My gut instinct tells (incorrectly?) me it should be possible tweak Linux for such conditions. I dont expect miracles (or maybe I do?) but it has to do a thing that can take up to an hour, getting this time down a bit would be great. If it is slower under normal conditions I don't care as I can just set setting to defaults under such normal conditions. I have experimented a bit with zswap and "think" performance got a bit better with some values. Will try zram next.

(post is archived)

[–] 3 pts

I find writing myself lots of notes and sticking them to the edge of the monitor helps

[–] 3 pts

Just a few suggestions.

If you have the knowhow, build your own kernel from source. Cut out everything you do not need. If nothing else this will improve response times, and most likely memory usesge.

Use a light DE. LXQT and the DE from Puppy Linux (Can't remember the names) are two of the lightest you can find. The desktop tends to make the biggest impact on memory usesge.

Shop web browsers. There are a few that are super light weight that can significantly impact ram usesge. I can't offer insight into this except to say shop the alternative options because I've never had a reason to worry about it myself.

These steps in conjunction with a healthy swap file will assist in use ability. Sadly, even the lighter distros nowadays have shifted to a 2 gig minimum so 1 gig is stretching the limit. You would almost need to use some kernel and software stuff from over a decade ago to reach your goal, short of compiling your own shit from scratch. It's why people do suggest light distros like Tiny or Puppy. They already did the heavy lifting to get people closer to the goal

[–] 1 pt (edited )

If you have the knowhow, build your own kernel from source.

I've never built my own kernel, I guess that'd weeks to learn well if not longer. I might be able try a different distro though, but then my scripts and stuff probably has to be adapted to that distro.

[–] 1 pt

Check Gentoo docs. That masochist distro makes you compile everything from source so that would probably be a good start, if your serious. I don't know that it's worth the effort, but good on ya if your gonna try

[–] 1 pt

The nice command can priortize processes. Shutting off everything you don't need and swap is really all you have to work with.

[–] 1 pt

You can try to make the kernel smaller by making every option you need a module, and not enabling things you don't. Kernel modules can be swapped whereas kernel cannot.

I am not sure how much you have to work with starting with a stock kernel. Probably not too much.

[–] 0 pt

I've used Linux as primary OS for about 3 years but I have used it as a normal user (i.e. not power user) so I don't understand exactly what you mean. Do you mean something like the kernel can have extra "options" added to it and that these options can either be "baked-in" or put on the side (then called "modules"), when they are put on the side as modules they can be then be swapped out? Or am I misunderstanding what you mean?

I managed to solve my memory problem in this case by making the software I needed to run require less memory, but learning to make Linux itself require less memory still seems worthwhile.

[–] 1 pt

Do you mean something like the kernel can have extra "options" added to it and that these options can either be "baked-in" or put on the side (then called "modules"),

Precisely. You can put the sound driver in the kernel or select module instead. There are heaps of options in kernel configuration and many can be modules.

Give it a go, you can figure it out after a few tries. Just be sure it has a separate grub entry so you can boot the working kernel.

[–] 0 pt

Very interesting. Seems stock Ubuntu server has all kinds of probably totally unneeded "crap". Will spends some time looking at this. Thanks!

[–] 1 pt

After looking a bit more zram might be what you need. It creates ram from diskspace. I would try for a 4GB at first. But if your vps gave you poor i/o turning off everything you can is the only way to have you app not run slow as balls.

[–] 0 pt

Theoretically it sounded good, but I did not get any performance. Maybe the cpu is too slow to compress so everything ends up being a bit slower.

[–] 0 pt (edited )

No success. I found no setting for zram that improved performance. I tried lz4 and zstd algorithms and different sizes of the zram but seems to work better without zram for some reason. zram was able to cram a lot of into RAM, compression ratio was between 3 and 5 so normal swap was barely used at all, but "system" cpu usage got higher (because all compression/decompression?).

Tried lowering swappiness and increasing vfs_cache_pressure but that I think made performance worse.

Seems default settings have worked the best, how sad.

iostat -c on default settings:

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          38.69    0.49   42.71   15.94    0.02    2.15

iostat -c with zram (zstd). iowait is lower but %system higher (and %user lower):

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          12.33    0.17   83.96    2.83    0.01    0.70