We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

Battery Drain with VPN

asked 2017-10-27 16:49:53 +0300

tomorrow gravatar image

updated 2017-10-28 09:37:51 +0300

I'm currently running Jolla 1 with SFOS 2.1.2.3 and OpenVPN connection. Works fine! However, I notice significant battery drain when the VPN is enabled. Usually, it does not help disabling the VPN connection on temporary base, the OS is only idling properly, when I do a restart of the phone, without auto reconnect of the VPN. I could not really enumerate any extra cpu cycles with a particular process, but Battery Log Tool indicates additional power consumption when the VPN connection is enabled, around 340 mA. Without the VPN, in the same conditions, the phone is idling at approx. 150mA. Needless to say, I don't have any background applications running that are frequently polling - generating network traffic.

Anybody experience the same?

edit retag flag offensive close delete

Comments

2

Not as much as I expected - battery lasts more than 24h still. Please note that an instanciated vpn connection has a steady keepalive data flow (about every 10s). This may block deep sleeeping of the device and the radio will drain the battery a bit more.

cy8aer ( 2017-10-27 21:57:46 +0300 )edit

Thanks. It would be great if Jolla could work on improving idling behavior, particularity when turning off the VPN connection. Also, I can think of an option that the tunnel gets disconnected when the automatic device lock kicks in, when unlocking the phone, the VPN connection would be reconnected. In my case I could easily live with that, as the VPN connects quickly.

tomorrow ( 2017-10-28 09:35:58 +0300 )edit

This idling thing is a problem of the tunnel definition and there are some older discussions about it (http://talk.maemo.org/showthread.php?t=65454, also for android...).

You can increase the keepalive in the openvpn configurations (on both - server and client). But this will have infliuences on the tunnel stability. If you are moving and the keepalive is too long the tunnel will not reinitialize on inter radio cell roaming.

Another thing: What communication protocol is your tunnel doing? udp or tcp? Tcp will increase the communication. This is because tcp in tcp tunneled you have twice the packages for Syn/Ack communication if packages are lost (syn/ack communication of the tunnel and syn/ack communication of the payload stream). The more packages are sent the more energy is needed.

Today's devices are way better in saving energy on radio communication (like with the n900) but such effects will increase the consumption...

cy8aer ( 2017-10-28 13:36:25 +0300 )edit

On my OpenVPN server 2.4.2, I'll leave it with the settings for now. I have default UDP as protocol.

tomorrow ( 2017-10-29 16:19:42 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-10-28 09:52:37 +0300

ghling gravatar image

Increased battery consumption while a VPN connection is active is totally normal - the phone has to actively keep the VPN connection alive, even while in idle mode, resulting in increased data traffic. Additionally, as already mentioned, this keep-alive can also prevent the device from going into deep sleeping / regularly waking it up after a short period of time.

However, this should not happen when the VPN connection is deactivated. This may be a bug (e.g. vpn modules are not unloaded or something like that). Jolla should look into this issue.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2017-10-27 16:49:53 +0300

Seen: 762 times

Last updated: Oct 28 '17