schwabe / ics-openvpn

OpenVPN for Android
3.29k stars 1.19k forks source link

Battery use is high. #1650

Closed rewolff closed 10 months ago

rewolff commented 10 months ago

To make issues more manageable, I would appreciate it if you fill out the following details as applicable:

General information

  1. Android Version -- 9 PPR1.180610.011 / MIUI GLobal 11.0.4
  2. Android Vendor/Custom ROM -- XIAOMI
  3. Device -- XIAOMI redmi 6.
  4. Version of the app (version number/play store version/self-built) -- playstore version. 0.7.49

Description of the issue

I don't use VPN to "hide my location", but to access my home network. It doesn't affect other stuff when openvpn would remain active when not actively used. However I can't do that as my battery drains about twice as fast as when openvpn is not running.

When not in use I don't think there would be any traffic. (I just tried tcpdump on the server, but packets for other private hosts are not visible on the TUN0 interface. They are on the destination machine. All quiet there but I can't be sure it is not doing weird stuff with other private hosts on the VPN, but it wouldn't have any business at all with those. )

Update: it seems to be doing a name lookup or two every five minutes or so. A failed attempt to connect to the domain-s port of my server and a succesful address lookup of android-context-data.googleapis.com. It could be that I've tried pointing the DNS to my internal DNS server as is is able to do internal names, as well as external names like the googleapis.com above. But I don't think I've gotten it to work. I've memorized the internal IPs I need....

Log (if applicable)

Configuration file

I've configured and started using openvpn a long while back, so I don't know where those live. Sorry.

rewolff commented 10 months ago

Update on the DNS configuration: Talking about it here, I've got it figured out. It was working all along. (I can use "just the hostname" on most of my machines, but need to use the FQDN for my server when using my phone.)

schwabe commented 10 months ago

This hard is hard to diagnose a lot of VPN proivders/configurations use a very low ping timeout that wastes a lot of energy. See also the FAQ for that.