SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-08-21 13:48:31

liviococcia
Member
Registered: 2011-07-02
Posts: 33

Making Google Chrome browser use RAM for cache, does this work in !#.?

Hello Members, so far my USB external 'solid-state' drive, with the Cruchbang 10 Xfce OS installed runs very well on my Macbook's, but I'm always looking to see if improvements can be made, especially with regards to browser speed.

I've been using Google Chrome rather than Chromium for a few weeks now, and prefer it, so while browsing the web i came across a few articles regarding Chrome's cache, namely changing where it is kept, or how it's used to make it run even faster, link below

http://thinkwhere.wordpress.com/2010/04 … for-speed/

Have members tried these instructions in Crunchbang, especially if they've the same set-up as me. The link describes the process when running Ubuntu, so i wouldn't know if it's possible to do this Crunchbang.

Also, are there sacrifices regarding the preserving of any browser history, or data when caching in RAM? and when doing this using a Macbook should anything else be considered?

kind regards
Livio

Offline

Help fund CrunchBang, donate to the project!

#2 2011-08-21 14:55:46

machinebacon
#! unstable
From: PRC
Registered: 2009-07-02
Posts: 6,212
Website

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

It's a question if /var/tmp or /tmp/ram/ are in RAM.

This solution looks more sexy: https://bbs.archlinux.org/viewtopic.php … 85#p967385 - no warranty, I haven't  tested it (yet, but I can do it later when I'm back on netbook)


Start Distrohopping here! -> Break your own... cool  VSIDO  cool LinuxCNC  kiss Frugalware <- It's all just a kernel.

Offline

#3 2011-08-21 16:15:09

Istvan
#! CrunchBanger
From: Budapest, Hungary
Registered: 2010-02-20
Posts: 147

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

chromium-browser --disk-cache-dir="/dev/shm"
or
chromium-browser --disk-cache-dir="/tmp"

seems better to me.


Ha ezt el tudod olvasni, biztosan nem vagy rövidlátó.

Offline

#4 2011-08-23 07:10:52

liviococcia
Member
Registered: 2011-07-02
Posts: 33

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

Thanks machinebacon, Istvan, sorry for slow reply, i'm guessing Istvan's way is going to be easier for me and that as each method points Chrome to using just the RAM for it's cache, nothing get remembered when browsing.

machinebacon, did you try it out, and was there any noticeable benefit?

regards

Offline

#5 2011-08-23 07:14:41

machinebacon
#! unstable
From: PRC
Registered: 2009-07-02
Posts: 6,212
Website

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

@livio, I will post the outcome here as soon as I get back to the baby smile


Start Distrohopping here! -> Break your own... cool  VSIDO  cool LinuxCNC  kiss Frugalware <- It's all just a kernel.

Offline

#6 2011-08-23 10:50:48

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

Well, pointing the cache directory to /tmp or /var/tmp will only work, as machinebacon said, if one of those folders is a tmpfs already. Let's have a look at your /etc/fstab and the output of mount, shall we?

The most sane and clean approach would be creating a folder (e.g. user_cache) in /tmp that is mounted as tmpfs, and chreate a hierarchy per user:

/tmp/user_cache/user1
/tmp/user_cache/user1/chromium
/tmp/user_cache/user1/chrome
/tmp/user_cache/user1/firefox
/tmp/user_cache/user1/other_app_that_chaches_too_slowly
/tmp/user_cache/user2
/tmp/user_cache/user2/chromium
/tmp/user_cache/user2/chrome
/tmp/user_cache/user2/firefox
/tmp/user_cache/user2/other_app_that_chaches_too_slowly

user[0-9] would be the names of the users, of course. Those folders and the child folders would need to be mode 700 (or 730 or 733, if you want other users to read your cache - not recommended). Then all you need is symlinks from the home folders of those users to the respective cache folders.

The good:
- You will only have to deal with one entry in the fstab
- Your fstab does not point to a single user's home folder (which is ugly)
- Users can activate and deactive RAM tmp without root access or a slow fuse setup.

The bad:
- 5mins work

The ugly:
- nothing really.


I'm so meta, even this acronym

Offline

#7 2011-08-24 17:52:22

liviococcia
Member
Registered: 2011-07-02
Posts: 33

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

Just an update, i gave IstVan's method a go and typed the instructions he posted into a terminal window, both command versions opened Chromium rather than the Chrome browser, if i changed the word 'chromium' in these commands to 'chrome' this didn't work, so i guess Chrome's files are in another location.

What i did notice, is that the command below.....

chromium-browser --disk-cache-dir="/dev/shm"

....seemed to feel faster between the two suggested, but i really couldn't see a great difference between running Chromium using these commands (cacheing in RAM), or running Chromium from its normal desktop menu launcher,

I not to sure how i 'tmpfs' the /tmp (temp folder), or whether there's any real speed gain in doing this?

I think I'll see what results machinebacon comes to before struggling to work out all the details to make the necessary changes.

regards

Offline

#8 2011-08-24 17:57:26

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,716

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

Why is an fstab pointing to a single user's folder bad if you only ever log in as that user? I have my ~/tmp mounted in RAM and haven't had any issues.

Offline

#9 2011-10-29 22:42:26

dc46and2
New Member
Registered: 2011-10-29
Posts: 2

Re: Making Google Chrome browser use RAM for cache, does this work in !#.?

An easy method of adding command-line parameters to every instance of chromium-browser is to set an environment variable in ~/.profile :

export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=52428800"

After your next login, these parameters will get applied no matter how you launch chromium.  I've got a tmpfs mounted on /tmp, so this puts my cache in RAM and limits the size to 50MB.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo