Latensy spikes

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
User avatar
superkolaideris
OpenVpn Newbie
Posts: 2
Joined: Tue Mar 22, 2011 8:53 am

Latensy spikes

Post by superkolaideris » Tue Mar 22, 2011 9:56 am

Hello everyone, I'm new here:)

When I am connected to the server, and ping an inside and external ip address, every 10 pings or so I get a spike of latency.
VPN is mostly used for gaming online, so that kind of lag is really annoying. There is no encryption and tried to disable comp-zlo. Tried to set real-time priority for openvpn-gui, didn't helper either.

OpenVPN build on OpenVZ virtualization, Ubuntu 10.10 OS. CPU usage mostly 2~5%. Ping from server is about ~1ms and lower.

Server config

Code: Select all

port 443
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 10.8.0.1"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
Client config

Code: Select all

client
dev tun
proto tcp
remote domain.com 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
ns-cert-type server
comp-lzo
verb 3
Image

Many thanks for developers of this great software:)
Looking forward for replys;)

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: Latensy spikes

Post by Bebop » Tue Mar 22, 2011 10:08 am

Is proto tcp absolutely necessary in your situation?

I have a quote from the forum rules:
Sometimes you cannot avoid tunneling over tcp, but if you can avoid it, DO. Why TCP Over TCP Is A Bad Idea: http://sites.inka.de/~bigred/devel/tcp-tcp.html
My only suggestion would be to try proto udp insead.

The VPN experts here might have some more, alternate advice.

ps. Close all other apps that use network resources such as uTorrent (which is visible in your taskbar).

pps. What is the graph on the bottom right? Is it a network usage graph, or a lag graph? There are 2 spikes in the graph, which would suggest 2 spikes in network resource usage, which can also cause a lag spike. Not saying it is the cause, but definitely something to look at.

ppps. close openvpn connection and make another ping test. Show us that you can have perfect pings when VPN is closed, then you can be sure your problem is VPN related. Without that evidence, your problem could be anything.
The cure for boredom is curiosity

User avatar
superkolaideris
OpenVpn Newbie
Posts: 2
Joined: Tue Mar 22, 2011 8:53 am

Re: Latensy spikes

Post by superkolaideris » Tue Mar 22, 2011 10:58 am

Problem solved! Changed to UDP 6112 port, and everything goes just fine:)
The main problem that we have mean university camp admin, who blocked all ports except tcp 21,22,80,443. Thank God that few weeks ago he opened Battle.net ports which they use UDP. That's why i didn't even tried, there was no open UDP ports and thought that there is no difference between TCP and UDP.

Image

Thanks you for help.

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: Latensy spikes

Post by Bebop » Tue Mar 22, 2011 11:05 am

Excellent result :] thank you for the feedback.
The cure for boredom is curiosity

Post Reply