xxx

Wednesday, 19 November 2025

Will Linux run well on your computer?

Image of a Computer by Nick Youngson CC BY-SA 3.0 Pix4free

 

A lot of new users try Linux in older computers and ask if the performance will be good.

While it is almost impossible to answer for a particular system, there are things one can do to ensure performance is acceptable.

The main factors which affect performance are the following:

  • Hardware
  • Choice of Desktop Environment
  • Choice of applications
  • Usage patterns (the most important)

Hardware

This includes mainly the CPU, GPU, Storage, Memory, although network and internet connection speed can also be included.

From these, the ones which have the most visible impact in older systems are Storage and Memory. Usually in tandem.

Linux normally makes use of a special partition or file called swap, when it is running out of memory, it moves things that it's not using to swap. While this allows you to use more memory than physically available, it also makes things slower as storage is slower than RAM.

Here are some relatively inexpensive things you can do to improve performance:

Increase RAM

If your computer allows it, this may be the cheapest upgrade and the one with the most impact. You can find memory for older computers for under $5 USD for 4 GB. Sometimes you may need to throw away the old memory and install bigger DIMS and sometimes you can just add to empty slots. It is important to check your motherboard manual to see which kind of memory you can use and what is the maximum.

Reducing the reliance on swap may increase the performance an order of magnitude or mor.

Switch from HDD to SDD for storage

Old spinning Hard disk drives are much slower than modern SDDs. If your system allows you to have more than one storage device, you don't even need to get rid of your HDD, but it is important to put your system partition on the SDD.

You can find a 128 GB SDD for less than $25 USD and if you have a laptop without space for also the HDD, you can move it to an external enclosure for less than $10 USD.

Putting the swap file on the SDD will improve performance, but it is not recommended if you will be relying a lot on it as it may degrade the SDD sooner than normal, but for regular use, it will make a difference.

GPU

While the GPU is a core performance component on a new system, in an older system it may not be cost effective to replace/upgrade it as the CPU will be the main bottle neck when playing.

Choice of Desktop environment

This is one where people focus the most but may have the least impact. I won't go in detail here as there is a lot of information around and I think Hardware, choice of apps and usage patterns have a bigger impact.

One thing to know is that heavier Desktop environments do more for the end user. If one takes a lighter desktop environment and tries to get the same functionality, they may end up using the same resources.

For example, the lowest load is having just a light window manager but then you will need to add a task bar, a network manager, a display manager, etc. In the end the difference may just a few 100 MB, which is not relevant but for the most limited systems.

If you want to have a look at a very low footprint environment have a look at my posts about installing and configuring a minimal LXQt 

Choice of applications

After hardware, this is where the biggest impact is. Unfortunately, the trade off is either functionality or complexity, but if you have an older system, it may be worth it.

The most basic example, the terminal
  • XTerm (only X11) uses less than 20 MB
  • Foot uses 40 GB
  • Alacritty 160 MB
If you open three terminals, use Xterm you use less than 60 mb. With Alacritty you use almost 500 MB!

Yes, the configuration in XTerm in .Xresources is clunky but you can get samples of the internet which will make it look nice. For example, my own .Xresources file  (please note that it imports other files under .config)

The next big resource hungry application is the browser. While Firefox, Chrome, Edge and similar are full featured, they also consume a lot of memory. The landscape changes frequently so your homework is to search for light browsers and use one which adapts to your needs.

For every need compare the resource utilisation of the application and you may find that you can achieve the same you do using 1/2 the resources.

Usage Patterns

This should probably go at the top as it is the one which has the most impact. However, I think it was important to go through the other sections to understand this one.

It doesn't matter which system you have, if you have a heavy workflow, your system will feel it.

Sometimes small changes in workflow can have a huge impact.

Rely on bookmarks

It is not unusual to have 10 or more tabs open on the browser. That may be OK if you have lots of resources, but in a limited system, bookmarking pages and opening and closing tabs will make a huge difference.

Focus on one task at a time

Don't open many applications at once. One of the advantages of Linux is the use of multiple workspaces, and that's great if you have the resources, but in a limited system, closing an app before opening another will improve the changes that the application will work as intended.

Leverage the console

While I know Linux can be used without ever (or rarely) opening the console, it's undeniable that doing things on the console is more resource efficient and once you get used to it even more productive.

Here are some examples

Nemo file manager uses 70 MB, nnn in the console uses 6.3 MB,
Baobab disk usage analyser starts at 205 MB, In contrast ncdu starts at 5 MB. Both will use as much memory necessary for the filesystem they are analysing but a difference of 200 MB to start with is noticeable.

If you are experiencing resource constraints, I'd recommend looking at console/terminal applications alternatives.

Bottom line

I hope now you understand that a few inexpensive changes to your computer and a few changes on behaviour can help you enjoy even a computer with limited resources.

Read More

Saturday, 12 March 2022

Making the .cache folder a temporary folder under linux

HDD and Memory chip

 A lot of people complain about the size of the ~/.cache folder and many people ask if the folder can be deleted. The answer is "Yes, with some caveats". If that folder can be deleted, why is it a permanent folder and not a temporary one?

The answer usually is "Because storage space is cheap and computing power isn't". And that is a good answer. However, that is only valid if you are accessing the same files over and over day after day. For most of us, we do different things every day, browse different websites, see different pictures, read different emails, etc. So new files are cached and the old ones remain just taking space.

Here I will show two ways to make the .cache folder temporary: Deleting old files regularly and storing the .cache folder in ram.

Neither of these methods require sudo or root access. However, they require that you use systemd.

In reality you could use this method to make any other folder temporary, for example,  a user's temp folder or the Downloads folder.


Delete old files regularly

Advantages

  • The folder does not keep ballooning

Caveats

  • If you have an application which incorrectly assumes .cache is permanent, it may malfunction
  • If you have an application which generates a lot of cache files for things that you regularly use it may take a bit more time (usually negligible), next time it needs the files as it needs to recreate them.

How to cleanup .cache regularly

Get the user identifiers by executing 

 id

Create a file under ~/.local/share/user-tmpfiles.d with a rule to clean up the folder at a particular interval, for example, every week. Replace <uid>, <groupname> and <username> with the numeric user DI, the user group and the user name respectively.

mkdir -p ~/.local/share/user-tmpfiles.d
echo "D /run/user/<uid> /cache 0700 <groupname> <username> 1w" > ~/.local/share/user-tmpfiles.d/cachetmp.conf

For example, to clean john's cache every week:

mkdir -p ~/.local/share/user-tmpfiles.d
echo "D /run/user/1000 /cache 0700 john john 1w" > ~/.local/share/user-tmpfiles.d/cachetmp.conf

Note: You can find more information about the parameters in the tmpfiles.d man page 

man tmpfiles.d

Enable and start the cleanup service

systemctl --user enable systemd-tmpfiles-clean.timer
systemctl --user start  systemd-tmpfiles-clean.timer

And that's it.

 

Storing the .cache folder in ram

Advantages

  • Browsing is faster as all files are cached in memory
  • If you use SDD, it doesn't wear that much
  • If you use HDD, it doesn't trash the disk that much
  • It extends your battery time as HDD usage is reduced
  • The folder doesn't keep growing with crud from previous sessions as all the files are gone when the computer shuts down.
  • Increased privacy. All the cached files are gone when you shutdown. This includes thumb images.

Caveats

  • If a program caches large files you may consume your ram. This may not be noticeable most of the time but you need to be aware of it
  • If you have an application which incorrectly assumes .cache is permanent, it may malfunction
  • All the If you have an application which generates a lot of cache files for things that you regularly use it may take a bit more time (usually negligible), next time it needs the files as it needs to recreate them. Given that the files are stored in ram, generation is usually very fast.

How to create the .cache folder in ramdisk

Get the user identifiers by executing 

 id

 Create a file under ~/.local/share/user-tmpfiles.d with a rule to create the folder and clean it up at a particular interval, for example, every week. (the cleanup is only necesary if you don't reboot your computer frequently. Replace <uid>, <groupname> and <username> with the numeric user DI, the user group and the user name respectively.

mkdir -p ~/.local/share/user-tmpfiles.d
echo "D /run/user/<uid>/cache 0700 <groupname> <username> 1w
L+ /home/<username>/.cache - - - - /run/user/
<uid>/cache" > ~/.local/share/user-tmpfiles.d/cachetmp.conf

For example

echo "D /run/user/1000/cache 0700 john john 1w
L+ /home/john/.cache - - - - /run/user/1000/cache" > ~/.local/share/user-tmpfiles.d/cachetmp.conf

Note: You can find more information about the parameters in the tmpfiles.d man page

man tmpfiles.d

For example, the age parameter can be a number and ms,mu,s,m,h,d,w for miliseconds, microseconds, seconds, minutes, hours, days and weeks.

Enable and start the creation and cleanup services

systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
systemctl --user start  systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer

 

Restoring the .cache folder to it's original state

If an application is giving you trouble or find that your cache is using all your memory, you just need to disable the services and delete the cachetmp.conf file

systemctl --user stop    systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
systemctl --user disable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
rm ~/.local/share/user-tmpfiles.d/cachetmp.conf

If at next boot the .cache folder is not created, just create it manually.

And that's it.

Read More

Sunday, 17 January 2021

The falacy of the mythical grandma

(Image courtesy of Wikimedia shared under the Creative Commons Attribution 2.0 Generic license)
 

There is a very common phenomenon occurring, mostly, with people who are new-ish to Linux. They love  Linux but given that they are new, they think it's hard.

 

They envision a version of Linux that is "Easy enough for Grandma".

 

I dislike this phrase with passion.

 

Why "Grandma" and not "Grandpa"? 

There is blatant sexism of the phrase. 

Somehow Grandma is less knowledgeable, less experienced or plainly less intelligent. It gives me the impression that, whoever says that, gives her Grandma an blender so she can be happier in the kitchen. It assumes that Grandpa will just "get it" and Grandma can't possibly do it. I know situations where it is the other way around.

 

Why "Grandma" and not "Children"?

There is blatant ageism in the phrase.

It is 2020, computers have been around for decades. By now, many women who are Grandmas have had successful careers using computers. But many have other interests that have nothing to do with computers.

 

Why "easy for Grandma" and not "easy for you"?

There is blatant smugness in the phrase.

Somehow the person saying that phrase "got it" as a new user. Was able to install Linux and use it, but other people couldn't possible "get it", right? They must be above average intelligent.

 

Maybe it is not about being a Grandma but about being interested in computers. My mom claimed to be a technophobe. At 60 I gave her a laptop and configured it with three buttons, one for the browser, one for the email and another to shut down. Well, she was not interested in browsing things or emailing people (I live in Canada, she lives in Mexico). That laptop just collected dust.

 

However, at 78, my mother, who is a very social person, got her first smart phone. She still does not browse or send emails but she uses Facebook, Messenger, Whatsapp and the camera because that's what her friends and family use. She is 83 now and still using her smart phone, initiating and answering video calls to me and her grand children.

 

I know other grandmas who like to write and have learned to use the computer to open the text editor and write to their hearts content. Even publish books.

 

So, give more credit to grandmas and more credit to Linux.

There are distributions who are usable with little training by non-technical users. If they don't use the computer is usually because they don't want to. Not because they can't.

 


Read More
© 2014 Using FOSS. Designed by Bloggertheme9
Powered by Blogger.