# why system lags?



## unicorn (Jul 27, 2022)

I've been using FreeBSD about one month without any issue. Yesterday Firefox lost response sometimes, and some other applications too. I installed FreeBSD on an external hard disk. Today I still have such issue, system lost response and I have to power off system using power button. I had seen such issue with NetBSD and OpenBSD. Why FreeBSD also have such issue?


----------



## Bobi B. (Jul 27, 2022)

One possible reason is that your external drive enters standby and drops from the USB? bus. Losing access to root filesystem will, most likely, freeze everything. However, if that is the case you'll not be able to browse kernel log, as dmesg(8) will be unavailable. You can "catch" that if you configure syslogd(8) to forward events to another host.


----------



## 3301 (Jul 27, 2022)

Measure, dont' guess. If the OS enters such state - check CPU load and temperatures (maybe CPU starts throttling because of high temperature), memory occupancy, I/O load (disks/network/...). Useful tools - top (atop, htop), hwstat probably many other. My FreeBSD desktop has uptime of weeks and I didn't notice any lag.


----------



## richardtoohey2 (Jul 27, 2022)

External hard drive - maybe it goes to low power mode or sleep?


----------



## unicorn (Aug 18, 2022)

today system lags again, system back to normal when I unplug my phone. I use my phone's usb network share connect to internet. Is it possible my internet speed too slow?? I have to switch to netbsd, which install on an external SSD. FB is not on a SSD, it has someting with my external hard disk?


----------



## SirDice (Aug 18, 2022)

unicorn said:


> Is it possible my internet speed too slow??


Maybe not slow but a wireless connection like 3G/4G/EDGE could suffer from connection drops, it's not the world's most stable network connection. Certainly not when you're in a crowded area with lots of other 3G/4G users (it's one of the reasons why 5G was developed). That would certainly cause firefox (or any other query sent to the internet) to stall or even fail.


----------



## mer (Aug 18, 2022)

TCP connections dropping or actually dropping packets?  Yep that is going to cause issues (TCP retries and a whole lot of other stuff).  DNS, typically UDP, stalls until timeout or return packet.  If stalled, then repeat with the next resolver.  "Slow" but solid is typically not a big deal (not that long ago when internet was over dialup PPP connections, slow but solid once established).   Cellular wireless is all about available bandwidth and signal strength, voice calls probably take precedence over data;  limited bandwidth causes all the conditions to drop connections.


----------



## SirDice (Aug 18, 2022)

mer said:


> Cellular wireless is all about available bandwidth and signal strength, voice calls probably take precedence over data; limited bandwidth causes all the conditions to drop connections.


Even if the phone itself is stationary (you're not moving around town) you're constantly being switched to different cell towers.



unicorn said:


> Yesterday Firefox lost response sometimes, and some other applications too


Open an Xterm or other terminal and run `tail -F /var/log/messages`. Whenever you notice those issues have a look at the log. Do you see the connection dropping, maybe reconnecting?



unicorn said:


> Today I still have such issue, system lost response and I have to power off system using power button.


A dodgy network connection shouldn't hang up or stall the _entire_ system though. The application doing the network queries (firefox for example) may respond a little finicky but that shouldn't affect the rest of the system.


----------



## mer (Aug 18, 2022)

SirDice said:


> Even if the phone itself is stationary (you're not moving around town) you're constantly being switched to different cell towers.


Exactly.  Cell phones have become so reliable and universal compared to even 10 yrs ago that people forget how fragile the system can be at times, especially under overload conditions.


----------

