# [Closed] Torrenting makes entire PC freeze

## genericspider

This is an issue I've been having for ages, across multiple distros. 

For some odd reason, torrenting specifically (regardless of client) freezes my entire machine. Pressing the reset button takes much longer than usual to restart. I've dealt with this on Debian, Arch, Void, and multiple Gentoo installs. 

My wireless card:

```
04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8192CE PCIe Wireless Network Adapter (rev 01)
```

Back ages ago when I dual-booted this never happened on Windows, but did on my Linux install during the time, so it's possible it's a driver issue.Last edited by genericspider on Sun Dec 22, 2019 2:01 am; edited 1 time in total

----------

## mike155

I asked Google and found: https://superuser.com/questions/51479/why-is-it-that-when-i-download-bittorrent-my-router-freezes

Maybe you suffer from the same problem?

Does it help to limit the torrent upstream bandwith (as suggested in the answer)?

----------

## Hu

If you switch to a wired network connection, is the system stable?  With what kernel versions have you observed the problem?

----------

## genericspider

 *mike155 wrote:*   

> I asked Google and found: https://superuser.com/questions/51479/why-is-it-that-when-i-download-bittorrent-my-router-freezes
> 
> Maybe you suffer from the same problem?
> 
> Does it help to limit the torrent upstream bandwith (as suggested in the answer)?

 

It's my system, not my router to be clear. I will give this a shot and report back.

 *Quote:*   

>  If you switch to a wired network connection, is the system stable? With what kernel versions have you observed the problem?

 

I've observed it on a lot of kernels, I can't specifically remember but I've used stable defaults on all distros, and as of now 5.2.17, and previously 4.19. I'll try this as well.

----------

## mike155

 *Quote:*   

> It's my system, not my router to be clear. 

 

At first sight, the superuser article is about a router and it doesn't seem to apply to your problem - because it's your system that freezes, not your router.

If you take a closer look, you will see that the superuser article is about bandwidth saturation and peculiarities of torrent traffic. Bandwidth saturation happens in the dirst device that can't handle network traffic. In many setups, this will be the router. But it can well be that network saturation happens in the network interface of your machine, especially if you use WiFi.

It could also well be that there is a bug in the RTL8192CE driver that causes a freeze if you send torrent packets at a high rate.  That's also discussed in the superuser article. They talk about 'router firmware', but you can translate this to 'Linux kernel RTL8192CE driver'.

Anyway, the proposed solutions 'limit the bandwidth of upstream torrent traffic' and 'limit the number of outgoing torrent connections' are worth a try.

----------

## genericspider

 *mike155 wrote:*   

>  *Quote:*   It's my system, not my router to be clear.  
> 
> At first sight, the superuser article is about a router and it doesn't seem to apply to your problem - because it's your system that freezes, not your router.
> 
> If you take a closer look, you will see that the superuser article is about bandwidth saturation and peculiarities of torrent traffic. Bandwidth saturation happens in the dirst device that can't handle network traffic. In many setups, this will be the router. But it can well be that network saturation happens in the network interface of your machine, especially if you use WiFi.
> ...

 

After testing, reducing it to 1mb/s seems to stop the issue. I can't test with ethernet since I don't have a way to hook it up. Has there been any patches released to fix the issue? Or elsewhere where the issue is tracked?

----------

## Hu

What do you mean by "freeze"?  Does the system lose all network connectivity?  Does it cease responding interactively?  Does it panic?  Does it halt?  At this point, it's hard to say whether the issue has a tracking ticket anywhere because it's not clear what the ticket should say.

----------

## genericspider

 *Hu wrote:*   

> What do you mean by "freeze"?  Does the system lose all network connectivity?  Does it cease responding interactively?  Does it panic?  Does it halt?  At this point, it's hard to say whether the issue has a tracking ticket anywhere because it's not clear what the ticket should say.

 

It freezes, the audio loops for a bit, and it just stops responding. Can't ping it, use sysrq, or anything. I'm not sure what exactly because there's never any logs (that I've been able to find at least).

----------

## musv

I had a problem like this many years ago, when I used Reiser4 as file system on a hdd. The dancing trees weren't able to handle the Torrent chunks properly. The behaviour was a permanent running hdd and an almost unusable system. 

Btrfs has a similar structure. If you use Btrfs on the disk where you torrent chunks are saved, this could be a reason.

----------

## genericspider

 *musv wrote:*   

> I had a problem like this many years ago, when I used Reiser4 as file system on a hdd. The dancing trees weren't able to handle the Torrent chunks properly. The behaviour was a permanent running hdd and an almost unusable system. 
> 
> Btrfs has a similar structure. If you use Btrfs on the disk where you torrent chunks are saved, this could be a reason.

 

This has happened on EXT4 and XFS. Currently using XFS.

----------

## Hu

Does sysrq normally work for you?  If yes, and it does not work during this freeze, then this freeze sounds like a kernel panic (which I asked about above).  You should also notice your keyboard LEDs blinking during a kernel panic.  If you get a kernel panic, then that is good news.  You should capture and share the panic text, which should tell where it froze and why.  Panic text is printed to the console if the kernel is in text mode when the panic happens.  If you need to be in graphic mode, you can also try to extract the panic text over a serial port.

----------

## genericspider

 *Hu wrote:*   

> Does sysrq normally work for you?  If yes, and it does not work during this freeze, then this freeze sounds like a kernel panic (which I asked about above).  You should also notice your keyboard LEDs blinking during a kernel panic.  If you get a kernel panic, then that is good news.  You should capture and share the panic text, which should tell where it froze and why.  Panic text is printed to the console if the kernel is in text mode when the panic happens.  If you need to be in graphic mode, you can also try to extract the panic text over a serial port.

 

None of my keyboard LEDs blink. It can take a while for the crash to happen, so I'd rather be in graphical mode (if you mean running an attached X server). I don't have a serial port on my PC either, unless that includes USB. How otherwise could I catch the potential kernel panic? Could I do it from a TTY?

EDIT: SysRQ doesn't work. Nothing does it seems.

EDIT 2: I thought of a game plan. I can leave my computer torrenting overnight. I might just switch to a tty and hopefully wake up to the kernel panic if it does exist.

----------

## TheLexx

 *Hu wrote:*   

> Does sysrq normally work for you?  If yes, and it does not work during this freeze, then this freeze sounds like a kernel panic (which I asked about above).  You should also notice your keyboard LEDs blinking during a kernel panic.

 

Correct me if I am wrong, but blinking keyboards light on panic is just for old fashion bus keyboards. Is far as I remember USB keyboard lights don't blink on kernel panic.

----------

## Hu

genericspider: I don't think USB will work for extracting a kernel panic.  If you are in text mode, then you will probably get panic output if one happens.  You could check by going to text mode during normal operation and using a non-destructive sysrq, such as Help, to see if it prints to your screen.

After a kernel panic, the system's powersaving features will not be functional.  If you intend not to catch the panic promptly, be sure the system has wall power and good cooling.

TheLexx: That sounds plausible.  I haven't experienced a kernel panic in a long time.  Since the OP has a rather limited laptop (no serial, no wired NIC), I hoped he would also have an onboard keyboard with appropriate LEDs, rather than a built-in USB keyboard.

----------

## genericspider

 *Hu wrote:*   

> genericspider: I don't think USB will work for extracting a kernel panic.  If you are in text mode, then you will probably get panic output if one happens.  You could check by going to text mode during normal operation and using a non-destructive sysrq, such as Help, to see if it prints to your screen.
> 
> After a kernel panic, the system's powersaving features will not be functional.  If you intend not to catch the panic promptly, be sure the system has wall power and good cooling.
> 
> TheLexx: That sounds plausible.  I haven't experienced a kernel panic in a long time.  Since the OP has a rather limited laptop (no serial, no wired NIC), I hoped he would also have an onboard keyboard with appropriate LEDs, rather than a built-in USB keyboard.

 

The crashes happen so randomly that it's hard to be in text mode. I need X11 for work I do during the day. Would there be any other way to capture a kernel panic that doesn't involve text mode or serial? I tried doing SYSRQ Space and it successfully printed out a list of sysrq commands.

----------

## Hu

In general, netconsole might work, but since this seems to be network related, I wouldn't recommend that.  You could also try to configure the kernel to write the panic text to a persistent memory store.  I've never done that, and cannot help you configure it.  Read up on pstore and ramoops if you want to follow this path.

----------

## Ant P.

EFI pstore has worked for me in the past for catching kernel crashes, but be extremely careful not to leave it turned on by default, the storage space is tiny and there are buggy implementations that don't know how to free up space from deleted efivars.

----------

## TheLexx

 *genericspider wrote:*   

>  It freezes, the audio loops for a bit, and it just stops responding. Can't ping it, use sysrq, or anything. I'm not sure what exactly because there's never any logs (that I've been able to find at least).

 

Humm, I am being more pedantic rather than suggesting that calling you a total noob, but I want to go over the basics again.

The log that is found at "/var/log/messages" (this being Gentoo it is actually optional) should contain the information that would give vital clues. If the logging system is up and running the command "tail -f /var/log/messages" should give you real time response as you plug and unplug USB devices. From here on out I will assume that your system logger is running and that your computer has USB port(s) available.

I would find a USB device that I don't use much which creates a unique line in the message log. When the system freezes due to the torrent overload, plug in the USB device and wait 3-5 minutes, for the system to detect it and record the detection to disk. Then remove the USB device, and wait 3-5 minutes for the removal to be recorded, before forcing a reboot of the system.

You will then be able to review the system-log after you reboot. You can do this by booting to Gentoo you will just need to read back before the latest boot. Personally I prefer to boot into Finnix if I want to hunt something in a log after a system crash. If the USB insertion/removal is not detected then your system really had a hard crash (most likely a kernel panic).

I am wondering since it only happens when the system's is networking hard I'm wondering if it could be a heating issue. Windows may have a thing either intentionally or unintentionally that limits things enough to prevent over-heating. I'm not sure if high network traffic is enough to over-heat any chip available to lm-sensor. (perhaps other people here have an idea). Lm-sensors can find out the temp of chips, but it will only monitor a few chips such an microprocessor and northbridge chips. I do have a USB WiFi adapter (that I don't use much) that can overheat during high traffic. The kernel detected the malfunction and gracefully closes the link and removes wlp0s2f1u1.  perhaps there is a bug in the driver that causes the kernel to panic if your RTL8192CE overheats. I would expect that is an over heating RTL8192CE makes your kernel crash then perhaps you might find a few "kernel oops" in the system log.

I do remember a diagnostic distro called "Stress Linux" that had a thing that would "stressout" the networking. The distro is no longer maintained and may not even have the driver for RTL8192CE. But you might find the name of the program that it uses to test networking and see if that program is being maintained.

If you have USB ports available, there is also the option to use a wired/WiFi USB adapter and see if your system still crashes.

Also if you want to see if a kernel panic can make your KBD lights flash, you can safely induce a kernel panic at boot, by failing to provide a root directory. The kernel will put a message on the screen that says something like "root directory not found". If you boot with grub2, then just use the "e option" to change things around. The "e option" does not save things to disk, it is a one-time-only feature.  This failed boot does not even mount the drives, so it will not corrupt drive files (the worst part about a kernel panic).

----------

## Hu

If sysrq reboot does not work in the bad state, and sysrq commands do work when the system is otherwise responsive, that suggests that the bad state is very bad, probably a kernel panic.

----------

## genericspider

 *TheLexx wrote:*   

>  *genericspider wrote:*    It freezes, the audio loops for a bit, and it just stops responding. Can't ping it, use sysrq, or anything. I'm not sure what exactly because there's never any logs (that I've been able to find at least). 
> 
> Humm, I am being more pedantic rather than suggesting that calling you a total noob, but I want to go over the basics again.
> 
> The log that is found at "/var/log/messages" (this being Gentoo it is actually optional) should contain the information that would give vital clues. If the logging system is up and running the command "tail -f /var/log/messages" should give you real time response as you plug and unplug USB devices. From here on out I will assume that your system logger is running and that your computer has USB port(s) available.
> ...

 

In terms of the world of minimal distros, I am a complete and utter noob. I've used Arch for a while and Void but I never got my hands dirty. So this is probably a great learning experience.

Anywho, I'm going to try Stress Linux just for testings sake. I'll also try your suggestion to see if the keyboard lights flash.

I've done a search for enabling logs but I'm kind of confused on what is what. How would I enable logs in /var/logs/messages for this case? The file doesn't seem to exist.

EDIT: I give up on this. I really don't have the time for this and I'm going to be getting a new wireless card soon anyways. Thanks for the help.Last edited by genericspider on Sun Dec 22, 2019 2:01 am; edited 1 time in total

----------

## Hu

/var/log/messages, not /var/logs/messages.  Whether it exists depends on the configuration of your system logger.  You may be writing an equivalent file under another name.  For a time, /var/log/syslog was a popular alternate name.

However, if the system is freezing due to a kernel panic, you may not get any useful logs.  Logs are written by the userspace system logger transcribing the kernel's output.  In case of a panic, the system will not run any further userspace programs, so the logger never gets a chance to transcribe the panic output.  That is why you need it written to the text console, to a serial console, or to pstore.

----------

## TheLexx

 *genericspider wrote:*   

> I've done a search for enabling logs but I'm kind of confused on what is what. How would I enable logs in /var/logs/messages for this case? The file doesn't seem to exist.

 

I would just cd to /var/log, and do a "ls -ltr", to see the last modified files.  The command "dmesg|tail" and doing a tail on the file in question should return similar results. The log file will usually have a bit of a prefix at the start of the line that dmesg does not.

If you want to see if a logging system is installed on your system the command "emerge --search log" will provided a list of packages with the word log in the title. The line "Latest version installed:" will display ether a version number or "[ Not Installed ]". There are different logging packages available. I choose syslog-ng early on have decided to stick with it as it seems to offer a bit of flexibility that I could use if a choose. the command "emerge --search syslog-ng" will tell you if you have the logger that I use, installed.

 *Hu wrote:*   

> However, if the system is freezing due to a kernel panic, you may not get any useful logs.  Logs are written by the userspace system logger transcribing the kernel's output.  In case of a panic, the system will not run any further userspace programs, so the logger never gets a chance to transcribe the panic output.  That is why you need it written to the text console, to a serial console, or to pstore.

 

True. If the RTL8192CE is acting faulty and causing a freeze then possibly there could be a few kernel oops in the log before a full blown kernel panic.  I had a bad video card that would caused a kernel panic from time to time. Still it would often cause a few oops(s) that would get recorded in the log prior to the panic.

----------

