raspbian hangs on heavy network traffic


16 posts
by robotfunk » Thu Jun 14, 2012 7:07 pm
Hi, just installed Raspbian (hexxeh's raspbian-r3) yesterday, a lot faster in many things, and super nice to have ssh and rpi-update working out of the box..

One issue I keep having is that the pi locks up with heavy network traffic, such as copying a large video file, or even during apt-get sessions. Is anyone else having this issue?
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by abishur » Thu Jun 14, 2012 7:11 pm
That's odd, that sounds a bit like an old firmware issue... I'd double check and make sure you're using the most recent firmware.
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4297
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by robotfunk » Thu Jun 14, 2012 7:16 pm
that's what rpi-update does, doesn't it?

I run that daily :)
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by abishur » Thu Jun 14, 2012 7:36 pm
robotfunk wrote:that's what rpi-update does, doesn't it?

I run that daily :)


It is what it should be doing, it's just that the issue sound identical to an old firmware issue so it would be worthwhile to manually check the dates :-)
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4297
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by jbeale » Thu Jun 14, 2012 8:23 pm
might also be worth checking logs for any relevant error messages. Is the USB/Ethernet chip very hot, by any chance? Also, make sure you've got a good power supply ...
User avatar
Posts: 2075
Joined: Tue Nov 22, 2011 11:51 pm
by hayesey » Thu Jun 14, 2012 8:27 pm
I was going to mention the power supply. Mine did that under heavy network load (in Raspbian and Debian armel) and it was down to insufficient power. I run it off a good 1A power supply now (was running it connected to a PC USB port before).
User avatar
Posts: 77
Joined: Mon Nov 28, 2011 12:46 pm
Location: Manchester, England
by robotfunk » Thu Jun 14, 2012 8:31 pm
$ ls --full-time
total 40289
-rwxr-xr-x 1 root root 2047848 2012-06-13 19:56:28.000000000 +0200 arm128_start.elf
-rwxr-xr-x 1 root root 2047848 2012-06-13 19:56:28.000000000 +0200 arm192_start.elf
-rwxr-xr-x 1 root root 2047848 2012-06-13 19:56:28.000000000 +0200 arm224_start.elf
-rwxr-xr-x 1 root root 16528 2012-06-13 19:56:28.000000000 +0200 bootcode.bin
-rwxr-xr-x 1 root root 124 2012-04-19 09:58:06.000000000 +0200 cmdline.txt
-rwxr-xr-x 1 root root 24 2012-06-13 20:43:18.000000000 +0200 config.txt
-rwxr-xr-x 1 root root 26 2012-04-19 09:58:06.000000000 +0200 issue.txt
-rwxr-xr-x 1 root root 4195844 2012-06-13 19:56:30.000000000 +0200 kernel_cutdown.img
-rwxr-xr-x 1 root root 5948852 2012-05-13 14:33:58.000000000 +0200 kernel_debug.img
-rwxr-xr-x 1 root root 16344532 2012-06-13 19:56:40.000000000 +0200 kernel_emergency.img
-rwxr-xr-x 1 root root 6236636 2012-06-13 19:56:42.000000000 +0200 kernel.img
-rwxr-xr-x 1 root root 314691 2012-06-13 19:56:30.000000000 +0200 loader.bin
-rwxr-xr-x 1 root root 2047848 2012-06-14 13:31:40.000000000 +0200 start.elf

looks pretty up to date, also I don't remember having this issue with Debian Squeeze..

also I'm running off a 1 Amp supply..
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by mpthompson » Thu Jun 14, 2012 10:44 pm
If you have a Debian Squeeze image where this problem doesn't occur, I would encourage you to copy the files from the /boot directory on that Debian Squeeze image to the /boot directory on your Raspbian image (backup those files first, of course). The kernel and config files should work on Raspbian, but you may have to edit the cmdline.txt file to make sure the correct partition is loaded as root.

Does this make a difference? Also, how are you testing a load? Are you making sure the same test and load is being applied to both images?
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by marsman2020 » Thu Jun 14, 2012 11:51 pm
How long is the load applied before the hangup occurs?

I have not had this issue...

A suggestion: for testing network load, I run python3 on another machine on my network, and use 'python -m http.server 8000' to create a simple http server. I picked a random ~100 MB .zip to use as a test download. This lets me load up the Pi's networking without depending on outside servers. Proper firewall rules must be applied on the machine running the server, of course.
Posts: 70
Joined: Sun May 20, 2012 11:26 pm
by robotfunk » Fri Jun 15, 2012 11:22 am
I haven't been 'load-testing', just noticed this behaviour from the moment I switched to Raspbian. I can't really compare between the two as I've formatted my Squeeze card to put Raspbian on. I've had a quick look in /var/log and haven't found anything alarming yet, not sure which log files to look for.
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by plugwash » Fri Jun 15, 2012 1:37 pm
do you have vm.min_free_kbytes set in /etc/sysctl.conf and if so what is it set to?
Forum Moderator
Forum Moderator
Posts: 2320
Joined: Wed Dec 28, 2011 11:45 pm
by robotfunk » Fri Jun 15, 2012 1:50 pm
nope, should I?
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by mpthompson » Fri Jun 15, 2012 5:00 pm
robotfunk, you really should have the following line in the file '/etc/sysctl.conf', reboot and try running your tests again:

vm.min_free_kbytes = 8192

This tells the kernel to try and keep 8MB of RAM free at all times. It's useful on swap-less machines, where you don’t want incoming network traffic to overwhelm the kernel and force an out-of-memory condition before it has time to flush any buffers.
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by robotfunk » Fri Jun 15, 2012 5:27 pm
Thanks for the tip, I just added that, will let you know if it improves my situation.
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by robotfunk » Fri Jun 15, 2012 6:51 pm
Spot on. I just copied a 7 GB file to the Pi with no lockups. This was previously unthinkable, I'm considering this solved. Much obliged!
Posts: 45
Joined: Wed May 30, 2012 7:28 pm
by shalo » Tue Jun 19, 2012 4:18 pm
Just something which is probably obvious to other users but just putting this out there that my pi still hangs with vm.min_free_kbytes = 8192

I've been using raspbian for ~9 days now. The first ~5 days typically caused the pi to hang once a day after it has a decent amount of uptime going. The past ~4 days consecutive uptime have been trouble free with doubling the setting eg: vm.min_free_kbytes = 16,384.

I suppose my questions though are:
1. I didn't get any errors in messages/syslog, is that normal or could it be to do with rootfs on usb hdd? My first suspicion was power for this reason.
2. Any idea of the maths behind this, I'd guess not because of some large variables?


Here's some information for the curious on how I was overloading it with just a 10mbit internet connection:

Raspbian "Pisces" R2
Headless with 224/32 split, rpi-update(d)
1gb swap partition on usb hdd
~4gb rootfs partition on usb hdd
~140gb partition as samba share on usb hdd

Only added a few 24/7 items:
ZNC, Sick Beard (uses about constant ~40mb)
SABnzbdplus configured to use 5 connections (not SSL currently)
and two further connections on a backup server.

SABnzbdplus is the culprit and it is a python usenet client with a simple http frontend. It has no real problem maxing my 10mbit at 1.2mb/s even when it is unraring a download at the same time. I never had any issues at 100mbit transfers over lan but I guess the nature of usenet binary article downloads is a pretty big factor here.
Posts: 74
Joined: Tue May 08, 2012 7:25 pm