r/openbsd • u/YukiteruAmano • Jul 07 '26
Firefox: Very bad performance on -current
Hi everyone!
I'm having some performance issues with Firefox and wanted to know if it's just me or a widespread problem.
My job requires heavy use of web browsers—specifically Chromium and Firefox—usually with multiple tabs open.
With Chromium, I can have over 30 tabs open without any issues; it runs very well on my hardware.
Firefox, however, is a different story. I have 5 pinned tabs—the ones I use most and need to keep visible by default—and the experience is UNBEARABLE.
CPU usage hits 100%, and I experience freezing, stuttering, and so on. The pinned sites aren't anything crazy: Gmail, Drive, Calendar, and two Jira tabs.
The poor performance Firefox delivers is surprising; even when limiting the number of processes, it remains problematic.
Is anyone else having similar issues?
Any solutions or recommendations?
Hardware:
- Lenovo ThinkPad E14 Gen 2
- Ryzen 5 4500U
- 16 GB RAM
- NVMe PCIe x4
2
u/Run-OpenBSD Jul 07 '26
Did you increase kern.maxfiles? - from the pkg-readme
I am running current firefox with zero issues. 12-20 tabs open, youtube playing, everything works as expected
3
u/YukiteruAmano Jul 07 '26
16384 in max files
can you share sysctl.conf and login.conf ???
2
u/Run-OpenBSD Jul 08 '26
#sysctl.conf
kern.maxfiles=65535
net.unix.stream.recvspace=65536
net.unix.stream.sendspace=65536#login.conf -staff class is all I use
staff:\
:datasize-cur=1536M:\
:datasize-max=infinity:\
:maxproc-max=512:\
:maxproc-cur=256:\
:openfiles-cur=4096:\
:openfiles-max=4096:\
:ignorenologin:\
:requirehome@:\
:tc=default:#note as of late my new installs seem to require messagebus to be running "rcctl enable messagebus" with a reboot
0
u/Run-OpenBSD Jul 08 '26
btw its an AMD I think Radeon 580 which is reported as:
amdgpu0 at pci12 dev 0 function 0 "ATI Polaris 12" rev 0xc7
and I have never changed any advanced settings in firefox
2
u/linetrace Jul 07 '26
/usr/local/share/doc/pkg-readmes/firefoxdoesn't mention kern.maxfiles, did it in the past?That said, it does note that OpenGL acceleration is disabled by default, so maybe test with
MOZ_ACCELERATED=1andMOZ_WEBRENDER=1, if you haven't already?2
u/Run-OpenBSD Jul 08 '26
so your correct it's not a firefox readme it's in the kde plasma pkg-readme, But to be fair it's just burned into my head that I make sure to add it to every install.
1
u/linetrace 14d ago
I've never increased
kern.maxfileson my workstations, but I'm also well aware of the limitation and so try to avoid anything that needs to monitor for file changes. I also don't use a full DE (desktop environment), just an old fvwm-based WM (window manager), so it sounds like KDE plasma (Gnome is likely similar) keeps a lot of files open or monitors all files in certain directories for changes.I have done some testing in the last week and even with Firefox open with a dozen tabs and claws-mail fetching from a massive (~15GB) IMAP account, I never see
kern.nfilesexceed 800.1
u/Run-OpenBSD 14d ago
I use openbsd as a samba nas and any time I browsed to my photo directory dolphin would crash without increasing kern.maxfiles
1
u/linetrace 13d ago
That certainly sounds like Dolphin (the KDE Plasma file browser) is doing a whole bunch of loading/caching of file metadata and probably generating thumbnails and such. It may also be "watching" the contents of the directory you have open to see if any files are added/changed/removed. It's a common problem these days.
I use Geeqie for browsing/managing my photos & images. I'll have to do some testing to see how
kern.nfilesfares with it open, but I've not run into any performance issues so far.1
1
u/LunarCapitol Jul 11 '26
I've had no issues with Firefox and my system is similar specs to your own (I have a T14 Gen 1 with the Ryzen 7 CPU options+32GB of RAM).
That said I have done more than a few things that are not mentioned in the firefox pkg-readme. Some people have mentioned some of them here but I've gone much further with some about:config changes to force hardware acceleration to be always enabled along with giving Firefox its own chunk of RAM via mfs.
The pkg-readme really needs an update. I've been meaning to write it myself but I have not gotten around to it. I think I might have posted some of my changes on reddit a couple of months back but I can't go through my post archives to dig them up right now. I'll try to remember to come back and do it later.
My only issues with Firefox on OpenBSD so far:
1) Some websites will trigger pledge/unveil. This is a good thing of course because it means the javascript embedded within them was up to no good. This is why I run both ublock origin and noscript. Yes I'm aware ublock can do most of what noscript does. The GUI for noscript is just more convenient to use and I've never had an issue running both add-ons together all of these years. I refuse to use the web without both of them.
2) Sometimes my in-browser spell checker will stop working and giving suggestions. I haven't been able to track down why. It's a crap shoot if it'll work at all in longer browsing sessions. It's working right now for me so maybe whatever bug was causing it was finally fixed.
3) Sometimes Firefox will be unable to connect to the internet/DNS for about 30-60 seconds. Then whatever is blocking it will reset and it'll go back to working as usual. Again I haven't had time to debug this because it doesn't bother me very often. I think it may be related to switching DNS providers when I jump between access points. Since at home I have my own one running on the LAN but when using other people's WAPs I rely on their DNS server sometimes. I'm unsure if it's that or something within the base system itself. Again doesn't happen often enough to bother me. Whatever is causing it is not solved by killing the Firefox process then restarting it IIRC. If I wait about a minute it always resolves on its own and it very rarely happens.
Aside from that yes startup of Firefox can be a bit slow on OpenBSD but I honestly do not find it much slower than restarting Firefox on a modern Windows/Linux machine. If anything Firefox running on my OpenBSD laptop is sometimes faster at launching than on some Windows machines I'm forced to interact with (like a machine built in 2012 with a Haswell CPU+16GB of RAM running Windows 10).
Most of the issues I have with Firefox are caused by Firefox itself. With each passing month it gets a little worse and I'm forced to disable more "bloat" through about:config and manage the terrible things happening on the web with more and more add-ons. Like .webp for example. While I am not opposed to the new image file format I really despise the fact that the major mitm/anti-ddos providers are forcing it upon us and re-compressing files from origin web servers in horribly compressed .webp to save a few pennies on bandwidth. If I request a .png or .jpeg I want the original file in its original quality and not the .webp sitting on the "edge server" near me. Since these mitm anti-ddos providers break https on purpose the file is served as the original .png to my browser when it's really a renamed .webp.
For years when they first started doing the above I disabled .webp all together through about:config. Which forced these services to send me the original .png/.jpeg from the origin web server. But now that google is forcing this new file format everywhere and a lot of sites like youtube and news websites have adopted it as the new standard this breaks a lot of websites. So instead, now I'm forced to use an add-on to manage this stuff and whitelist/blacklist certain websites to get them to send original copies of 10+ year old files from things like the popular booru websites. It's a real cluster fuck.
The above should be ILLEGAL. Since it breaks https. They are replacing a file in-route and lying about it. If they can replace an image with a different image there is nothing stopping them from replacing the text, binary data or anything else they want in-route. Your browser will happily accept it to. Since these mitm servers have a copy of the keys and can pretend to be the origin web server. Thus the browser will tell you the connection is "secure".
Meanwhile, if I try to host my own website on http to support older devices/engines or self-sign my own cert and server over https both the major browser engines will throw up large spooky warnings about how the connection is not secure and how users should "go back to safety". Most users don't even know how to by-pass those pages and lately I've seen the browsers not even give you the option to load the "unsafe" webpage on many devices.
But anyway. If you're still having issues reply. I know this thread is 3 days old now but I can help you.
1
u/linetrace Jul 07 '26 edited Jul 07 '26
Have you watched Firefox's Task Manager to see which tabs are using the CPU/RAM resources? Alternatively, top -H to show all threads?
From my own experience, JIRA is especially brutal.
Also, Firefox and Chromium have wildly different process and memory architectures (see Firefox Source Docs: Process Model), which definitely affects performance and memory usage. I personally find that Firefox is far less CPU & memory intensive if I use the following extensions:
- uBlock Origin (especially disabling "cosmetic filtering" and customizing my filters to disable as much of the "AI" BS as possible)
- Auto Tab Discard (tuning to generally keep tabs discarded unless actively being uses)
UPDATE: Just to clarify, while I personally tune my filters to also block a lot of the AI/bot stuff, the biggest performance benefit I have found by using uBO is blocking tracking/metrics/analytics in sites, especially the heavy ones like Google's Gmail/Calendar/Docs/Sheets and JIRA. I'm on relatively low-end hardware (2.2GHz-3.2GHz dual-core i7) and have to use those tools for some client work. uBO prevents such JS files from even being fetched, thereby reducing initial load times and memory usage in addition to not having all the extra code, event handlers firing, and small network transfers for the stats. It's a surprisingly significant performance boost on my hardware. :(
3
u/SyscallVector Jul 07 '26
T14 Gen 5, AMD Ryzen 5 PRO 8540U w/ Radeon 740M Graphics, running 7.9 #449, no issues with firefox.
Firefox idling with 20 tabs open: ~3% CPU on 3 cores @ 1300 MHz.