Solved My low powered FreeBSD system has broken down

A few years ago I built a new system for FreeBSD and it worked pretty well at the time. You can see that here:

Unfortunately since then I have run into some problems that have gotten worse and worse until I can't use the computer any more. I can sum them up as two major problems. Konqueror SMB/Samba performance and high memory usage.

1. Konqueror SMB/Samba performance
Browsing through samba shares has always stuttered more than an average computer and file transfers with every FreeBSD computer I have ever used has been slower than Windows or Linux. Now it has degraded to the point that Konqueror is nonresponsive while scrolling through shares and file transfers are as slow as the very first computers or around 500 bytes/sec. The only solution I can see is a complete OS reinstall Windows 95 style. As I have said before, even the earliest computers in history are faster than this.

2. High memory usage
The system in question has 8GB RAM. I can only open 2 or 3 tabs in the browser at most before running out of memory. I kind of need a computer that will run at least 15 tabs open and when the browser crashes it will actually restore what I had open before. No such luck on this system. The only solution I can see is upgrading to a computer with at least 64 GB RAM so that I can have about 10 tabs open successfully. My Windows 8 HP Stream tablet will open 15 tabs no problem and it has only 1 GB RAM!

I have another new computer ready to go to replace this one but I think things like slow samba performance will remain. Additionally, this is a very low powered computer in the 10-15 watt range while the replacement computer is more in the 20-60 watt range. I feel that I am going to do a lot of work to transition to a new system only to have one marginally faster and more reliable. I am definitely at a kind of low point with FreeBSD right now.
 
While I have no canned solutions, I will ask questions, in the hope that they help you debug the problem.

First, Konqueror and Samba: I bet the problem is the SMB filesystem client running on FreeBSD. So try this: Instead of browsing the files with Konqueror, do the same operations from the command line: ls and "ls -l" (the difference is that "ls -1" needs to do a lot of stat calls, which might slow things down). Is the performance acceptable? Now, for comparison, use Konqueror on a local file system: Is the performance better? Try to nail down whether the problem is either one of Konqueror or SMB.

Second test: Using something like netstat or tcpdump, watch your network while browsing SMB. Are you killing the network? Could the problem be an incompatibility between your file server and the SMB FS client?

On the memory usage of the browser: 2-3 tabs in 8 GiB is indeed ridiculous. My only suggestion is to scientifically measure it. Memory usage before you start the browser? Then start the browser, and keep it on a welcome page. Then to go a really simple web page (you can store it on a local file system) which just says "Hello World". Then go to more complex web pages. Then increase the number of tabs. Try different web pages (simple versus complex) in your tabs. You should see some relation between complexity of the page and memory usage (although the difference might be too small to see), and the memory usage of the browser should increase linearly (with a large offset) with the number of tabs. This might help narrow down the problem.
 
Actually Konqueror has been in maintenance mode mostly since ages. If you want to have a KDE file manager you really should use its successor Dolphin instead, which gets way more love and attention.
 
I used to fiddle with samba for hours, the only benefit was network discovery.

I switched to ftp and all my problems disappeared (NFS may also be worth looking into).

In rc.conf:
Code:
# FTP Access
ftpd_enable="YES"
ftpd_flags="-m"         #Allows anonymous writing to the ftp server (filesystem permissions also have to be set for the ftp user)

I run it on a RPI3 with 1gb of memory.
I never used over 200mb with just the FTP daemon running.

In the file manager [I use thunar], just type "ftp://ftp@hostname-OR-IP-address/"
{I'm not worried about security behind my firewall your circumstance may be different.}
 
Also 8GB is a lot of memory. I have 8GB of memory and i run poudriere build with 9 concurrent threads.
The resident memory usage of Firefox is certainly acceptable with 8GB of memory.
 
It also sounds like you may be using ZFS.

ZFS has an arc cache which can cause unusual RAM usage like what you are describing.

Unless it is quite imperative, I wouldn't suggest ZFS, but then I'm biased toward the performance boost of UFS {to each their own}.

This website describes how to tune the ARC cache on ZFS.

=====

Konqueror is a KDE application KDE also has something called a baloo file which can cause these sort of symptoms. You can read about it here.
=====

XFCE does put a much lower load on the machine than KDE and Gnome...plus you can make it look however you want.

For example, I changed the drab default settings to this:
 

Attachments

  • Screen_2021-05-29.jpg
    Screen_2021-05-29.jpg
    630.1 KB · Views: 130
2. High memory usage
The system in question has 8GB RAM. I can only open 2 or 3 tabs in the browser at most before running out of memory.
I have 250 tabs open in Firefox, and am also running Thunderbird
Code:
last pid:  1416;  load averages:  0.37,  0.27,  0.17                                    up 0+00:16:49  15:21:01
57 processes:  1 running, 56 sleeping
CPU:  0.3% user,  0.0% nice,  0.3% system,  0.0% interrupt, 99.4% idle
Mem: 3503M Active, 764M Inact, 127M Laundry, 1294M Wired, 923M Buf, 25G Free
Swap: 3797M Total, 3797M Free
What on Earth are you doing?
 
… the computer …

Which version of FreeBSD?

Ideally, share a probe of the computer. <https://bsd-hardware.info/>

… 8GB RAM …

That should be fine for ZFS. No need to tune.

… ZFS has an arc cache which can cause unusual RAM usage like what you are describing. …

I can't think of what's described as symptomatic of an issue with ZFS.

… a baloo file which can cause these sort of symptoms. …

FreeBSD bug 230726 – sysutils/kf5-baloo: freezes the system – I never encountered the bug and for what it's worth, I doubt that it's a factor in this case.

In my experience, it's more likely that baloo_file will simply crash very soon after login to the desktop environment. Not logged as a bug, but developers of KDE on FreeBSD are aware of the issue.
 
It is great to see all the replies here from many different people.

FreeBSD version is:
FreeBSD TRITON 12.1-RELEASE-p11 FreeBSD 12.1-RELEASE-p11 GENERIC amd64

I am going to consider the Samba problem solved for now. I noticed that two FreeBSD systems on the network had the same hostname. After changing that the transfer speed is about 55 MB/sec. This is about as fast the EMMC and SATA SSD on ZFS can do most likely. My Windows 10 computer between the same server gets about 110 MB/sec but is much faster and obviously does not have the ZFS overhead.

The high memory usage problem is much more insidious. I am using Falkon browser because that is just what I use on KDE systems these days for the most part. I wanted everyone to be aware that this browser can crash the entire operating system. That is obviously very bad behavior. There is no sysrq keys like on Linux so there is nothing you can do. It is not temporary - you can leave the computer for days and it will not recover. Additionally, the virtual terminals start to "echo" what is typed in xorg and generally freak out and do not respond to proper button commands. It only takes maybe 1 Amazon tab to do this. Just hover your mouse over the item picture so it "zooms" and memory starts leaking away. Finally it is really just SLOW. Try to load a page like this:
If you do not recognize this page, this is a website that people use to do work in the real world. It is kind of essential that pages like this do not scroll up and down like they are running on a 386.

I wanted to address the lack of tabs restoration also. It appears that the setting for restore session needs to be set in the Falkon settings to restore tabs after a crash. I tested with killall -9 and it worked. This is actually the default setting anyway.
 
… Falkon … can crash the entire operating system.

A kernel panic?

Using latest packages, or quarterly?

… SLOW. Try to load a page like this:
https://www.grainger.com/category/fasteners/nuts/lock-nuts … scroll up and down …

No slowness with the page here.

Code:
% pkg query '%o %v %R' falkon
www/falkon 3.1.0_1 FreeBSD
% uname -KrU
14.0-CURRENT 1400025 1400025
%

1625813002001.png


… 12.1-RELEASE-p11 …

Have you tried updating to 12.2?

<https://www.freebsd.org/releases/12.1R/errata/>

<https://www.freebsd.org/releases/12.2R/errata/>
 
It is great to see all the replies here from many different people.

FreeBSD version is:
FreeBSD TRITON 12.1-RELEASE-p11 FreeBSD 12.1-RELEASE-p11 GENERIC amd64

I am going to consider the Samba problem solved for now. I noticed that two FreeBSD systems on the network had the same hostname. After changing that the transfer speed is about 55 MB/sec. This is about as fast the EMMC and SATA SSD on ZFS can do most likely. My Windows 10 computer between the same server gets about 110 MB/sec but is much faster and obviously does not have the ZFS overhead.

A suggestion if you want to test/isolate the network from the disk subsystem is to obtain iperf and install the package/port benchmarks/iperf/.

Then, on the Windows 10 computer, run iperf.exe –s –w 1m (the window size might need to be smaller, say 100k).
On your FreeBSD box, start a 30 second test iperf –c {YOUR_WINDOWS_10_IP#} –w 1m –t 30s –i 1s"

The -w portion sets the window size. Often larger than the MTU is best.

Then swap the operations around and test again.

This will isolate any network issue from the disk sub-system.

The high memory usage problem is much more insidious. I am using Falkon browser because that is just what I use on KDE systems these days for the most part. I wanted everyone to be aware that this browser can crash the entire operating system. That is obviously very bad behavior. There is no sysrq keys like on Linux so there is nothing you can do. It is not temporary - you can leave the computer for days and it will not recover. Additionally, the virtual terminals start to "echo" what is typed in xorg and generally freak out and do not respond to proper button commands. It only takes maybe 1 Amazon tab to do this. Just hover your mouse over the item picture so it "zooms" and memory starts leaking away. Finally it is really just SLOW. Try to load a page like this:
If you do not recognize this page, this is a website that people use to do work in the real world. It is kind of essential that pages like this do not scroll up and down like they are running on a 386.

I wanted to address the lack of tabs restoration also. It appears that the setting for restore session needs to be set in the Falkon settings to restore tabs after a crash. I tested with killall -9 and it worked. This is actually the default setting anyway.


As grahamperrin has alluded to, more information is required. Is there output of the crash in the logs?

Perhaps install another browser and test it on the same web page to see if it is as slow as the one you use now?
 
That alone tells not the whole picture. Konqueror is in maintenance mode, it hasn't got any meaningful new features since ages, it's just maintained to the point that it is still runnable today. Nothing more, nothing less, aside that it doesn't get much love anymore since Dolphin has been the standard file manager of KDE since years. So this means that chances are quite good that some file operational stuff which does not run well in Konqueror does in Dolphin.

It's not the default file manager any longer, nor the default web broswer of KDE, which is Falkon if you install it. In fact, most Linux distributions nowadays don't even have Konqueror in their base KDE packages any longer, in case you want to have it you've got to install it explicitely.

Konqueror is on its way of slowly getting phased out sometime in the near future, that's how things are right now.
 
Indeed, to add my data point until very recently I had been running a FreeBSD 12.2 system on an old laptop having 4Gb of RAM. I was able to simultaneously have vscode open (vscode uses electron so memory heavy), libreoffice, file manager instances and firefox with 15+ tabs while the system remained usable. This was a surprisingfly stable setup, I only rebooted the laptop once every 3 months. And by the way, it even used ZFS-on-Root with automatic snapshots and full disk encryption.

Unfortunately, I've had to move this laptop to OpenSuse to have better hardware - and more importantly software support. Fiddling to get the technologies I use for work to have them kind of work on FreeBSD have had a huge impact on my productivity (not FreeBSD's fault, but the vendor's). I had a vision of FreeBSD everywhere in the company (from workstations to servers), but at least for time being I've had to change it to FreeBSD on servers and appliances, and OpenSuse on workstations because employees have to get stuff done. But FreeBSD did its part of the deal, no complaint, very stable and resource efficient.
 
2. High memory usage
The system in question has 8GB RAM. I can only open 2 or 3 tabs in the browser at most before running out of memory.
This is a shot of me editing text for my website with 24 instances of Leafpad open, Firefox-ESR, Audacious, two instances of Xfe, urxvt, Gimp and gKrellm2 on my Thinkpad W520 with the following specs:

FreeBSD 12.2-RELEASE-p7
Thinkpad W520
Intel Quad Core i7-2760QM @ 2.40GHz
8 GB RAM PC3-10600
HITACHI Travelstar 500GB HDD @ 7200 RPM
Nvidia Quadro 1000M with 2GB DDR3 RAM
15.6" TFT display with 1920x1080 (FHD) resolution with LED backlight
SOP.png


This is a shot of a different W520 I keep offline as my multimedia machine with the same specs at 181 days uptime. It's running FreeBSD 12.1-RELEASE-p3 with 2 instances of urxvt, Xfe, audacious, VLC, gKrellm2 and Gimp for the shot:

Dark_Ness13666.jpg


This one has top running so you can see a very low amount of resources are being used.

Those are my high end machines. I have one other that has an Intel Core2 Duo P8600 @ 2.4GHz and 8GB PC3-8500 RAM and one that has a AMD Phenom II x 3 N830 Triple Core @ 2.1GHz and 4GB DDR3 RAM.

The rest are all Intel Core 2 Duo CPU T7700 @ 2.4GHz with 4GB PC2-5300 RAM. I use them for general purpose desktop activitities every day and am never short on resources.
 
I still see the problem with slowness with Falkon on Grainger after upgrading to 12.2 and updating packages. It hangs and then is very slow and then hangs again.

I have now been able to try Otter Browser on Grainger and it is noticeably better. It hangs and then goes to full speed and then hangs again. The ad blocking and javascript controls are also very good. Sometimes it loads pages so fast I cannot comprehend it.

So I have decided to use Otter Browser for now.

Chromium and Firefox do not have any performance problems at all on the system in question but I do not use Chromium or Firefox. I don't like how commercial they are and how unresponsive to their users they are. I also don't like how much computing resources are required to compile either browser from source. I also prefer the "qt style" KDE system integration from Falkon and Otter Browser. An exception would be the system which I am posting from right now which is so old that only Chrome works to post here.

edit:
I am going to mark as solved because the system is not really broken down any more.
 
Back
Top