UFS How do I speed up firefox by having it not hit disk?

Since I don't use Firefox, I can't say if this page is up to date. But according to it, you can set your profile directory with the -profile parameter.
Simply mount a tmpfs(5)-based filesystem (/tmp would be good), use a script to populate a directory there (e.g. /tmp/myffprofile) with previously-saved profile files and run Firefox using that parameter.
 
Honestly speaking, I don't understand what is slow in Firefox. Really! I use it exclusively many years, never noticed things mentioned by many people here on the Forums.
Would somebody bring an example please?
 
I think the problem with Firefox is any number of people want to add in useless and bloated dependencies, without understanding why they choose to bring them in.
 
Perhaps more interestingly, why are you so happy to be rid of ZFS?

I run 11.1 with icewm and deluge. Deluge takes about 500M of 16G ram. Somehow when zfs is running...I start to swap. Esp if deluge has run all night. So zfs seemed to be slowing things down and causing swap. I also had a problem where a second usb external drive got disconnected and /dev/da0 became dev/da1 and this took me a few days to unravel with zfs. Things seem fine now that I made everthing ufs with soft updates, per the guide newfs -U....but maybe this is subjective...What is your experience?
 
Since I don't use Firefox, I can't say if this page is up to date. But according to it, you can set your profile directory with the -profile parameter.
Simply mount a tmpfs(5)-based filesystem (/tmp would be good), use a script to populate a directory there (e.g. /tmp/myffprofile) with previously-saved profile files and run Firefox using that parameter.


Is /tmp some kind of ram backed disk area?
 
Honestly speaking, I don't understand what is slow in Firefox. Really! I use it exclusively many years, never noticed things mentioned by many people here on the Forums.
Would somebody bring an example please?
I run fire fox with these plugin:
custom tab to let me open say 30 tabs
download helper
ad blocker I forget name a new one since ublock origin is supposedly 'outdated' (Is this a move to get rid of ad blocking with this new label by firefox etc, have they sold out? ...)

box is 6 core amd64 fx 3.2ghx 16g ram desktop.

When I open say 5 movies firefox will start burning the cpu.
I don't know if its a loop fighting javascript by the adblocker on each page or what.
Everything will be pause-y and when I open the popup to save the movie....it might take a second or 2 to load.

Chrome is faster and doesn't ever burn the cpu. However I haven't gotten into adding adblock or downloader to chrome since I had bad experience a few months back.
With deluge running, which does cause i/o, but only on the external usb 5t drive.....box also tends to swap....or it did with zfs before I got rid of it.
So firefox is really slow and seems to burn the cpu badly n cause massive pausing with multiple tabs and movies playing.
Chrome no such problem.
Now I do have 16G of RAM so if firefox could be tricked into using ram.....I wish there was a button to simply not write to disk just use ram, then it seems it would be fast.
Currently its almost worth it to use chrome and just watch the stupid ad on youtube or whatever instead of having all that go away with firefox.
I just love to download movies, and have the ads stripped out.
 
Caching generally improves browsing, not slow it down. What makes you think it would be faster?

Ram is faster than disk. You imply that I said caching slows down an app? I did not say that. If data came from network into ram without hitting disk, that would be a lot faster, no? I can only infer that you meant that the browser leaving nonactive things on disk frees up ram? So I guess you are with me on that idea...I have a large amount of ram on my desktop so I think it could skip disk entirely..

Chrome is vastly lower load and faster than firefox in my setup. I am not sure what your experience is.

My case is playing and downloading many movie clips at same time while running deluge. Firefox slows down drastically. To be fair, chrome doesn't have the download plugin or adblock..., but if I skip downloading and just play say 7 movies....firefox is way way way slower, and iceWM little load graph goes to 100%....while in chrome it stays like 10% with tiny spikes....even with chrome playing 7 movies...
 
Ram is faster than disk.
Yes, but RAM is generally in short supply compared to disk space. And caching usually involves a mix of both RAM and disk usage.
You imply that I said caching slows down an app? I did not say that.
Caching is really the only reason why Firefox would "hit the disk".

If data came from network into ram without hitting disk, that would be a lot faster, no?
That depends on how exactly the caching mechanism is implemented. Most mechanisms read stuff into RAM and only write to disk (which can happen asynchronous) once it's been processed. The next request for the same data will then be read from disk to RAM instead of the network to RAM, and disk to RAM is typically faster.

There's also the issue of reading so much data into RAM the system will start swapping. This is certainly not ideal. So you're left with a small amount of RAM that's actually available for caching, and means it's going to be flushed quite frequently (high cache-miss ratio), causing data to be constantly fetched and re-fetched from the internet.

But if I skip downloading and jsut play say 7 movies....firefox way way way slower, and iceWM little load graph goes to 100%....while in chrome it stays like 10% with tiny spikes....even with chrome playing 7 movies...
This is probably more related to how pages or content is rendered. In these cases there will be very little caching, only some buffering, and this doesn't require a lot of CPU. Rendering the content however could use a lot of CPU cycles.
 
Yes, but RAM is generally in short supply compared to disk space. And caching usually involves a mix of both RAM and disk usage.

Caching is really the only reason why Firefox would "hit the disk".


That depends on how exactly the caching mechanism is implemented. Most mechanisms read stuff into RAM and only write to disk (which can happen asynchronous) once it's been processed. The next request for the same data will then be read from disk to RAM instead of the network to RAM, and disk to RAM is typically faster.

There's also the issue of reading so much data into RAM the system will start swapping. This is certainly not ideal. So you're left with a small amount of RAM that's actually available for caching, and means it's going to be flushed quite frequently (high cache-miss ratio), causing data to be constantly fetched from the internet.


This is probably more related to how pages or content is rendered. In these cases there will be very little caching, only some buffering, and this doesn't require a lot of CPU. Rendering the content however could use a lot of CPU cycles.

Yes yes this is all obvious.
I have plenty of ram 16g as I said.
So you don't know howto have firefox not use disk?
Is using /tmp a way? As one user suggested?
Is that a ram backed disk area or something?
 
I sometimes wish smalltalk lisp haskell swi prolog forth or ada folks would make a browser.

Something that went from network to ram...until ram full....then started using disk....but only for the last tabs....
 
It might, it might not.


That depends on how you configured your system. With a standard install /tmp is just a filesystem on disk. A lot of people (myself included) use tmpfs(5) for /tmp.

This seems the way to go.....I will experiment to night....

thx all
 
It might, it might not.


That depends on how you configured your system. With a standard install /tmp is just a filesystem on disk. A lot of people (myself included) use tmpfs(5) for /tmp.


Will it dynamically take needed memory? or do you set it to use N amount?
 
Will it dynamically take needed memory?
Yes.

or do you set it to use N amount?
No, but you can set a maximum:
Code:
     size    Specifies the total file system size in bytes.  If zero (the
             default) or a value larger than SIZE_MAX - PAGE_SIZE is given,
             the available amount of memory (including main memory and swap
             space) will be used.

If you want something with a set size you may want to look at mdmfs(8) instead.
 
Don't forget the mode=1777 permissions or you will get some weird errors with certain applications.

THx will do.....

I guess then I move the firefox profile here and start firefox with profile switch?
hmmm!

Guna get interesting to see if firefox keeps all its stuff in that directory...
 
https://lifehacker.com/5687850/speed-up-firefox-by-moving-your-cache-to-ram-no-ram-disk-required firefox wouldn't start when I moved .mozilla to /tmp after mounting tmpfs......

damn I can't paste from xterm to chrome on this forum wtf

ok did with firefox:

Code:
$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    447G     22G    389G     5%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ada1p1    451G    299G    116G    72%    /a
/dev/da0       4.4T    2.8T    1.3T    69%    /vogt
tmpfs           16G    139M     16G     1%    /tmp
$ cat /etc/fstab
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2     /               ufs     rw      1       1
/dev/ada0p3     none            swap    sw      0       0
/dev/ada1p1     /a              ufs     rw      2       2
tmpfs        /tmp            tmpfs   rw,mode=1777    0 0
 
https://lifehacker.com/5687850/speed-up-firefox-by-moving-your-cache-to-ram-no-ram-disk-required firefox wouldn't start when I moved .mozilla to /tmp after mounting tmpfs......
Code:
tmpfs        /tmp            tmpfs   rw,mode=1777    0 0
Your configuration used tmpfs. I had md(4) for /tmp through /etc/rc.conf. md can be found in rc.conf(5) as tmpmfs:
Code:
tmpmfs="YES"
tmpsize="16g"
#tmpmfs_flags=""
/var/tmp can be soft linked, ln -s, to root /tmp. You could alternatively run tmpfs for every directory or temporary file.

And, only if that file designed to be temporary, instead of moving the file, then mount that file in /etc/fstab with either md or tmpfs. If that file is not meant to be temporary, then don't mount it under a memory file system.

I can't paste from xterm to chrome on this forum
Use editors/leafpad or other desktop text viewer to open it, to copy and paste. I often use the terminal to > or >> output into a file to be opened. You can use ~/.Xdefaults to configure copying from a terminal, but you'll have to look through various documentation to do that.
 
Back
Top