Slow internet over ethernet


17 posts
by lumeno » Thu Jan 24, 2013 2:08 am
First post here -- I've just finished setting up a VPN'ed NAS with my newly acquired un-overclocked Raspberry Pi Model-B and I've run into something I can't find an answer for elsewhere.

The internet bandwidth, as determined using

Code: Select all
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip


is much slower than what I'd expect to get. I'm getting around 1.2 MBps on my Pi through ethernet when I'm getting close to 7MBps when the ethernet is plugged directly into my laptop.

Is this comparable to what others are getting for a +50mbps (~7MBps) home broadband connection? As far as I understand, the ethernet standard on the Pi uses 100mbps -- so is this a CPU performance issue? Should I expect it to improve if I overclock it?
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by lumeno » Thu Jan 24, 2013 2:21 am
I just tried checking what the transfer speed between the Pi and my laptop are when both are connected via ethernet to the router using the method specified in the link here

viewtopic.php?f=36&t=17878

and I consistently got 11.8MBps. So the ethernet transfer works as expected, but when it's downloading off the internet, the bandwidth is only 10% (~1.8MBps) despite the fact that I get nearly 65% of the bandwidth(~7MBps) when I use my laptop. Help?
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by lumeno » Thu Jan 24, 2013 5:49 am
UPDATE:

The problem is with OpenVPN, but I can't figure what exactly it is.

Here's how I know this.

I compared the download rates on the Pi with the VPN turned off and on -- it was 5.03 MBPS vs 1.34 MBPS.

Then I tried it on my laptop (wired) -- it was 6.9 MBPS (perfect) vs 6.7 MBPS (near perfect).

So the fault doesn't lie entirely with my VPN service (PrivateInternetAccess) which gives a 3% reduction in bandwidth on my laptop -- but has to do with the way OpenVPN runs on the Pi which gives a 74% reduction in bandwidth.

Any ideas on why OpenVPN on Raspbian is being so terrible?
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by repercussion » Mon Feb 04, 2013 10:21 pm
Yo, Lumeno,

I hate to hijack your thread here, but I was hoping you might be able to help me set up PrivateInternetAccess on my Pi. Did you follow a guide you can point me to? I've got OpenVPN installed and set up, but whenever it tries to connect to one of the VPNs, I get "curl: (7) Failed to connect to 49.212.202.172: Network is unreachable" likely because I haven't yet figured out where I put in my login information!

I'll definitely run some speed tests for you when I'm connected... Thanks mate. Appreciate whatever you can get me.
Posts: 5
Joined: Mon Feb 04, 2013 9:33 pm
by repercussion » Mon Feb 04, 2013 11:32 pm
So, I ran some tests for you and it's pretty plain to see that, for whatever reason, OpenVPN on the Pi is slowing things down.

Wired Mac no VPN
Image

Wired Mac through PIA France
Image

Wired Pi no VPN
Image

Wired Pi through PIA France
Image

Wired Pi through PIA Seattle
Image

Wireless HP Mini 311 Linux Mint 14 no VPN
Image

Wireless HP Mini 311 Linux Mint 14 France
Image

Wireless HP Mini 311 Linux Mint 14 Seattle
Image
Posts: 5
Joined: Mon Feb 04, 2013 9:33 pm
by repercussion » Mon Feb 04, 2013 11:59 pm
Obviously, I'm connecting to PIA using OpenVPN now.

Still, if you have a script that will automatically connect to a VPN server on boot and remove the default gateway so that if the VPN drops, I don't start leaking traffic outside of the VPN, I'd be pumped!
Posts: 5
Joined: Mon Feb 04, 2013 9:33 pm
by lumeno » Tue Feb 05, 2013 12:12 am
I used this
viewtopic.php?f=26&t=13024

It's pretty comprehensive and has what you need to prevent IP leaks from VPN drops.

Speedtest.net reports in megaBITS and wget in mega/kiloBYTES -- if you didn't already notice that. Still, there seems to be a significant drop on the Pi for you as well.
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by repercussion » Tue Feb 05, 2013 12:52 am
I thought you may have used that guide. It's what I tried as well after winging it. Problem is, it doesn't automatically connect on boot and when I get rid of the default gateway I can't get out of the local network whatsoever. Writing something for init.d will probably be pretty simple though. I'm sure I can figure it out in a day. Thanks man.

Yes, I realized that about the SpeedTest.net. Divide by eight I guess.

Here are some results using curl instead of wget or speedtest.net:

Mac No VPN
Image

Mac France
Image

Ran another test just now after a reboot through the french server and got the best speeds yet so I thought I might share. As you can see, the speeds are really close and all I did was reboot. I guess this means the Pi has the ability to match the speeds you see elsewhere...

Pi France
Image

Pi UK
Image

Pi no VPN
Image
Posts: 5
Joined: Mon Feb 04, 2013 9:33 pm
by lumeno » Tue Feb 05, 2013 4:58 pm
Thanks repercussion,

Are you located in Europe? Can you also post what your transfer rates to US East and other servers in the US look like?

The max speed on my network is around 7MBPS but the Pi saturates around 1.34MPBS. If your max speed is less than 1.34, I guess it wouldn't help to compare with your setup (and obviously, shouldn't bother you either!).
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by M33P » Tue Feb 05, 2013 6:16 pm
CPU speed.
Encryption/decryption in OpenVPN will take a hefty wad of CPU cycles and memory accesses - try simultaneously running top in a separate terminal to the wget download.
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm
by repercussion » Tue Feb 05, 2013 9:30 pm
When downloading, I can see that OpenVPN is taking up between a fifth and a half of the CPU. Mine isn't overclocked yet either. We'll see what type of results overclocking yields.
Posts: 5
Joined: Mon Feb 04, 2013 9:33 pm
by lumeno » Tue Feb 05, 2013 9:38 pm
See my similar post here
http://raspberrypi.stackexchange.com/qu ... t-over-vpn

OpenVPN uses 70% of the CPU for me, and overclocking did nothing to improve the transfer rate.
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by technion » Tue Feb 05, 2013 11:09 pm
I'm not directly familiar with OpenVPN - but encryption does use a lot of resources.
Not long back, web hosts still avoided SSL because of the strain it put on servers.

Does OpenVPN have a choice of ciphers? If you're simply using it to access an Internal network, one of the faster options may be better for you, even if less secure.
Posts: 231
Joined: Sun Dec 02, 2012 9:49 am
by Devon Mafia » Sun Feb 17, 2013 6:20 pm
hey to hijack the thread too, how did you get internet over ethernet in the first place??

I been trying...my god i been trying :roll:
User avatar
Posts: 117
Joined: Thu Jan 10, 2013 2:16 pm
by Zagor64 » Thu Mar 21, 2013 6:43 pm
Sorry to revive this old thread but I wondering if there was any progress in finding a solution or do we just have to live with this limitation since it looks like the hardware just isn't powerful enough.

I am experiencing a near 80% drop in download speed when using openvpn to my VPS. As others have already mentioned, when using openvpn on my laptop connecting to the same VPS, I am experiencing hardly any loss at all.
Posts: 4
Joined: Tue Mar 19, 2013 3:18 am
by lumeno » Sun Mar 24, 2013 1:21 am
@Devon: it worked out of the box? I didn't have to configure anything.

@Zagor64: no, sorry, I still haven't found a way to get around this. I briefly considered trying something other than OpenVPN, but got busy with other things. Post here if you figure something out!
Posts: 9
Joined: Thu Jan 24, 2013 1:48 am
by BadPractice » Wed Apr 02, 2014 4:48 pm
Hi, Having the same issue.

So far i found out its not Rspberry Pi related: People on amd64 experiencing the same issue (but still may be debian related, dont know)

my kernel: raspberrypi 3.10.25+ (raspberian)
opevpn version: 2.2.1-8+deb7u2
Posts: 1
Joined: Wed Apr 02, 2014 4:40 pm