[ARCH] [EASYAF] Use RAM for Firefox and boost performance and decrease drive wear (wiki.archlinux.org)
from luthis@lemmy.nz to linux@lemmy.ml on 11 Mar 2024 23:29
https://lemmy.nz/post/7924837

Might be late to the party, but I just discovered you can do this. Super simple and easy to do.

After having a read of the linked page, I backed up and just used this option:

wiki.archlinux.org/title/Profile-sync-daemon

Installed, created config, and enabled service:

systemctl --user enable psd.service systemctl --user enable psd-resync.service

I definitely notice an increase in speed and less SSD usage should hopefully increase lifespan.

I’m sure there would be options for alternative distros, anything using Systemd should be able to use the daemon.

#linux

threaded - newest

ulterno@lemmy.kde.social on 11 Mar 2024 23:53 next collapse

Finally, a way to use the loads of RAM I have other than Compiling and Blendering.
Well, I guess we also have RAM drives

luthis@lemmy.nz on 11 Mar 2024 23:58 next collapse

Just reconfigured /etc/makepkg.conf to use extra cores and tmpfs… I’ve been compiling on the SSD with one core for so long it’s embarrassing.

d3Xt3r@lemmy.nz on 12 Mar 2024 02:56 collapse

While you’re still in your makepkg.conf, don’t forget to set march=native (and remove mtune) in your CFLAGS! (unless you’re sharing your compiled packages with other systems)

Helix@feddit.de on 12 Mar 2024 05:15 collapse

Where’s the difference between march=native and march=x86-64 in that case?

d3Xt3r@lemmy.nz on 12 Mar 2024 06:03 collapse

A ton of difference! march stands for microarchitecture levels (or feature levels). “x86-64” is the baseline feature set targeting common x86_64 instructions found in early 64-bit CPUs, circa 2003. Since 2003 obviously there have been several advancements in CPUs and the x86_64 arch, and these have been further classified as:

  • x86-64-v2 (2008; includes the SSE3, SSE4 instructions and more)
  • x86-64-v3 (2013; includes AVX, AVX2 and more)
  • x86-64-v4 (2017; includes AVX512 mainly)

So if you’re still on x86-64, you’re missing out on some decent performance gains by not making use of all the newer instructions/optimisations made in the past two decades(!).

If you’re on a recent CPU (2017+), ideally you’d want to be on at least x86-64-v3 (v4 has seemingly negligible gains, at least on Intel). There’s also CPU-family specific marches such as znver4 for AMD Zen 4 CPUs, which would be an even better choice than x86-64-v4.

But the best march you want use is of course native - this makes available all instructions and compiler optimisations that’s specific to your particular CPU, for the best performance you can possibly get. The disadvantage of native is that any binaries compiled with this can run only on your CPU (or a very similar one) - but that’s only an issue for those who need to distribute binaries (like software developers), or if you’re sharing your pkg cache with other machines.

Since the flags defined in makepkg.conf only affect AUR/manual source builds (and not the default core/extra packages), I’d recommend also reinstalling all your main packages from either the ALHP or CachyOS repos, in order to completely switch over to x86-64-v3 / v4.

Further reading on microarchitectures:

Benchmarks:

cc: @luthis@lemmy.nz

Helix@feddit.de on 13 Mar 2024 23:13 next collapse

Can I also compile a list of selected packages from the repositories fresh easily? E.g. Firefox? Or do I have to download their PKGBUILD to makepkg?

d3Xt3r@lemmy.nz on 14 Mar 2024 00:40 collapse

The repositories already contain pre-compiled packages. To install them, just add the repository before the Arch repos, and then simply reinstall the packages to install their optimised versions.

Helix@feddit.de on 14 Mar 2024 10:05 collapse

How can I trust them? At least with Arch there’s the “many eyes” principle.

d3Xt3r@lemmy.nz on 14 Mar 2024 10:53 collapse

It’s the same principle. Both CachyOS and ALHP are reasonably popular, and all their stuff is open for anyone to review - Cachy’s stuff is all on Github and ALHP is on SomeGit.

Helix@feddit.de on 15 Mar 2024 10:25 collapse

Both CachyOS and ALHP are reasonably popular

never heard of them. I need to research a bit more until I activate what is basically another “dangerous” non-maintainer repository. Thank you a lot for your links and explanations!

luthis@lemmy.nz on 14 Mar 2024 00:21 next collapse

holy shit!!! I’m definitely doing that!

luthis@lemmy.nz on 14 Mar 2024 03:48 collapse

Oh boy…

Total Download Size: 3390.65 MiB Total Installed Size: 13052.08 MiB Net Upgrade Size: 291.24 MiB

I wonder if I’m going to notice any better performance…

MonkderZweite@feddit.ch on 12 Mar 2024 09:07 collapse

Mount .cache as tmpfs. Rarely needs a workaround for some offenders to XDG spec though.

Pantherina@feddit.de on 11 Mar 2024 23:55 next collapse

Btw the private browsing mode is also RAM-only which is a hard requirement for the Tor browser (“no disk policy”)

NegativeLookBehind@lemmy.world on 12 Mar 2024 00:22 next collapse

Is there a specific package I can install to increase my RAM?

bigkahuna1986@lemmy.ml on 12 Mar 2024 01:15 next collapse

No I believe you have to download more RAM actually. But what would I know I’m just a proctologist.

just_another_person@lemmy.world on 12 Mar 2024 01:26 next collapse

No, this is wrong. I saw this documentary, ‘Johmny Neumonic’ I think, and it specifically showed a computer scientist increasing his storage and RAM through software, but you need a special device to plug in to do it. I’m sure Best Buy sells it.

Crashumbc@lemmy.world on 12 Mar 2024 03:35 collapse

Yes! They also showed the amount of RAM was just a guideline and it’s possible to “overfill” your RAM!

just_another_person@lemmy.world on 12 Mar 2024 03:38 next collapse

No, you are also wrong and need to rewatch that documentary. Sheer will and determination will allow you to double your RAM.

Wodge@lemmy.world on 12 Mar 2024 03:46 collapse

Also befriending a drugged up DARPA dolphin will be a massive boon too.

just_another_person@lemmy.world on 12 Mar 2024 05:32 collapse

No, you are also wrong.

bigkahuna1986@lemmy.ml on 12 Mar 2024 16:51 collapse

As a proctologist I recommend against this.

[deleted] on 12 Mar 2024 09:06 collapse

.

AmbroisindeMontaigu@kbin.social on 12 Mar 2024 02:37 next collapse

Have a look at https://wiki.archlinux.org/title/Zram - a compressed block device in RAM that can be formatted as swap. There are various tools to set it up, maybe your distro already includes one of them. And htop has a meter for it, so you can see how effective the compression is (besides its own zramctl tool).

FreudianCafe@lemmy.ml on 12 Mar 2024 03:46 collapse

Nah i think the right way to do it is go to some site (you can Google some) and download some RAM. They even make the link flash so its easy to find. If you need more RAM just download some more

[deleted] on 12 Mar 2024 11:13 collapse

.

SuperIce@lemmy.world on 12 Mar 2024 00:34 next collapse

I used to use this when I still had a hard drive, but this does nothing for performance if you’re on an SSD and profile writes are so few with browsers that it doesn’t significantly affect drive wear. In the end, all this does is make it more likely that something will break.

lemonuri@lemmy.ml on 12 Mar 2024 08:49 next collapse

Are you implying the tabs backups are not written into the profile folder? Because think 10 - 20 GB a day is still something to be convened about. servethehome.com/firefox-is-eating-your-ssd-here-…

I have used Firefox in ram for a couple of months now without problems and am pretty happy with it.

Valmond@lemmy.mindoki.com on 12 Mar 2024 17:55 collapse

Can someone back up my claim that 10-20GB writes per day is nothing for a modern SSD?

Edit: with a 256 TBW and a 20GB write/day it gives some 13.000 days so the lifespan of an SSD will largely be the limiting factor.

MonkderZweite@feddit.ch on 12 Mar 2024 08:58 collapse

Wrong. Using inotify-wait (inotify-tools), you see that FF has a bunch of read and write access on every page load (mostly in <profile>/storage). This is with the about:config option to use RAM as cache enabled.

Every single webbrowser is one giant clusterfuck.

Helix@feddit.de on 12 Mar 2024 01:45 collapse

thanks for reminding me. Didn’t activate this on my new install since I got 64G of RAM :)

systemctl --user enable psd-resync.service

I think this is not needed since psd.service has the following in it:

[Unit]
…
Wants=psd-resync.service