LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-24-2022, 10:28 AM   #1
ballsystemlord
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 219

Rep: Reputation: Disabled
[Solved] Home SSD getting ~100GB of writes per day.


Hello,
My SSD, mounted only to my home dir, is getting roughly 100GB of writes per day. I'm at a loss for how this could be. I'm using only very normal SW, mail-client (I turned off the shred function some time ago), webbrowser, etc. The filesystem is NILFS2, which is designed for SSDs. I also setup fstrim without an effect on how much data is being written.

Does anyone have an idea how I can figure out what is going on?
For example, is there a way to track writes? I know about iotop, but it often just lists kernel processes, not what is causing the kernel to perform a write.

Thanks!

Last edited by ballsystemlord; 11-03-2022 at 11:44 AM.
 
Old 10-24-2022, 11:35 AM   #2
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Website cache, most certainly. Video stream writes cache on your drive and deletes cache from your drive dynamically.
So you'll never see the cache directory inflate too much, but youtube for example does write quite a lot of that.
That said, everything's using disk as a cache dump these days, see: mesa shader cache, mozilla sqlite database.. etc..
 
2 members found this post helpful.
Old 11-03-2022, 11:46 AM   #3
ballsystemlord
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 219

Original Poster
Rep: Reputation: Disabled
I moved the browser's complete folder to an HDD. Now I'm getting about 6GB of writes to the SSD per day.
Thanks guys!
 
Old 11-03-2022, 02:17 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,633

Rep: Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636
Quote:
Originally Posted by elcore View Post
Website cache, most certainly. Video stream writes cache on your drive and deletes cache from your drive dynamically.
So you'll never see the cache directory inflate too much, but youtube for example does write quite a lot of that.
That said, everything's using disk as a cache dump these days, see: mesa shader cache, mozilla sqlite database.. etc..
Interesting...
If someone has spare ram, then, is it worth putting ~/.cache in a ramdisk?
How big would it need to be?
 
Old 11-03-2022, 02:43 PM   #5
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Interesting...
If someone has spare ram, then, is it worth putting ~/.cache in a ramdisk?
How big would it need to be?
Sure, what I did couple of years ago well I mounted tmp as tmpfs (in fstab) according to some advice I was given around here. It was 2G of 4G RAM, so half by default, configurable.
After that I'd just create /tmp/cache1 on boot with a rc.local, and then use the browser about:config to point default cache dir at /tmp/cache1
For another browser, I'd use /tmp/cache2 and so forth. After grasping the concept, I've done also an extraction of full browser profile archive to /tmp on boot, which is a bit more advanced.
I could also recommend squid if you're into caching web stuff locally, takes a while to configure and has huge documentation, but works nice in my experience.
If you have a LOT of big files, iso images, videos etc. it's probably better to have a mechanical storage disk or something. I do have some SSDs but for systems only, not for storage.

Last edited by elcore; 11-03-2022 at 02:45 PM.
 
Old 11-04-2022, 05:59 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,633

Rep: Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636
Wouldn't a symlink from ~/.cache to /tmp/cache1 do it? That even saves farting about with default locations. Is that stuff ever read?
 
Old 11-04-2022, 07:50 AM   #7
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Wouldn't a symlink from ~/.cache to /tmp/cache1 do it? That even saves farting about with default locations. Is that stuff ever read?
Probably worth mentioning it's ~/.cache/mozilla (if you're using firefox) and not ~/.cache (you'd likely want to keep the shader cache, and thumbnails for example).
If all of it is on tmpfs, on next boot you're basically recreating it all. Causing thumbnails to load slow, and forcing shaders to recompile.
But if you want to be thorough, sure, it can all go to tmpfs, even /home (where you might want to make some major changes in /etc/skel).
 
Old 11-05-2022, 05:00 PM   #8
ballsystemlord
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 219

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Wouldn't a symlink from ~/.cache to /tmp/cache1 do it? That even saves farting about with default locations. Is that stuff ever read?
Yes, that would work fine.

####

Something I discovered was that apparently there's an option browser.cache.disk.enable that will turn off caching on your disk. You might have to toggle something more than that. I'm not personally interested in the option, so I did not research it further.
 
Old 11-06-2022, 06:34 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,633

Rep: Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636
Thanks for the reply. I'm not going to go with that option if I can find a better one, as I'm told the mesa shader cache will have to be recompiled constantly.

Looking at tmpfs, it's got 1.6G and nothing used according to 'df -h'. Tmpfs has a line in fstab
Code:
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0
So I've created a directory /dev/shm/chromium-ungoogled and put a symlink to it from ~/.cache/chromium-ungoogled, which seems to work. It's holding 51M at the moment because I rsync'ed the existing cache. That all vanishes of course if I umount tmpfs, either shutting it down or unmounting. I'll check it later.

Last edited by business_kid; 11-06-2022 at 06:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the code that writes to SSD in Linux kernel? ComiXZonE Programming 5 08-16-2018 03:25 AM
SSD Writes Heats Linux - Software 1 12-10-2013 07:30 PM
Reducing writes to SSD: mounting /var (and others) on RAM disks (tmpfs). sysfce2 Slackware 7 08-26-2011 02:00 AM
grub not booting past approx 30GB on 100GB drive marvinudy Linux - Hardware 6 03-28-2006 10:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration