/srv/irclogs.ubuntu.com/2017/09/09/#ubuntu-us-mi.txt

vorathiel21Hi people, i wanna   put   /home/user/.cache  and   /tmp  directories  in  /run/shm   to increase performance and   clean temp files on every reboot.  Can i do this with symlinks  ??19:06
cmaloneyvorathiel21: I'd recommend using tmpfs for /tmp19:29
cmaloneyhttps://askubuntu.com/a/173294/161419:30
cmaloneyas far as cache is concerned unless there's a reason not to write .cache I'd leave it alone19:31
cmaloneyreason being:19:31
cmaloneyThere's a lot of things in there that will take longer to re-create19:31
cmaloneyeg: thumbnails and the like19:31
cmaloneyso you'll slow your machine down if you constantly re-create cache19:32
vorathiel21thanx for your answer.  i've already try  tmpfs  .  it worked fine . The thing is today  i discover  this /run/shm  directory19:37
cmaloneyIt's the same thing19:37
cmaloneyIf you cd to /run and type `df .` you'll see that it's using tmpfs19:37
cmaloneyhttps://askubuntu.com/questions/169495/what-are-run-lock-and-run-shm-used-for19:39
vorathiel21don't you think if i put  those  directories under  /run/shm  , them will share the space ??   i think it's a waste of ram to declare  separated  tmpfs in fstab for  /tmp  and  .cache  ... if there is already a ramdrive available on  /run/shm19:42
vorathiel21am i wrong ??19:43
cmaloneyI think you're misunderstanding how Linux allocates RAM19:43
vorathiel21it can be possible19:43
cmaloneytmpfs is not cordoned off the way you might think it would be for a physical disk19:44
cmaloneyeg: /run/shm doesn't have half of your memory allocated19:44
cmaloneyIt's showing the maximum that it will allocate19:45
cmaloneyWhat is allocated is what you see when you run df19:45
cmaloneyLinux tries to keep as much in an internal cache as possible for performance19:46
cmaloneyand will free up those pages as memory pressures become larger19:46
cmaloneyThat's why if you run `free` you'll notice that there's precious little memory left19:46
cmaloneythat's Linux trying to ensure that it goes to disk as few times as it can19:47
cmaloneymost of the time it'll read things from cache19:47
vorathiel21hmmm19:48
cmaloneyhere's an easy test19:49
cmaloneyas root:19:49
cmaloneysync; echo 1 > /proc/sys/vm/drop_caches19:49
cmaloneythat will clear out the cache19:49
cmaloneythen run (as a normal user) `watch free`19:49
cmaloneyand use your machine19:49
cmaloneyYou'll notice it start to fill up the cache again19:49
vorathiel21i understand.  So... linux already is doing what am trying to do19:50
cmaloneyExactly19:51
cmaloneychanging /tmp to tmpfs is still a decent idea19:51
cmaloneyI do it on all of my machines19:51
cmaloneybut going much beyond that isn't going to give you what you think it will19:52
vorathiel21thank you for enlightening me on this19:55
cmaloneyno problem. glad I could help19:56
vorathiel21c ya19:56
cmaloneyttyl19:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!