· Troubleshooting · About 8 min read

v2rayNG Battery Drain: Android Battery Optimization and Background Settings

Troubleshoot v2rayNG battery drain on Android, from VPN activity and battery optimization to background limits and per-app proxy settings.

At a glance

If v2rayNG ranks high in battery usage, first compare overall battery drain with the VPN on and off. If the connection drops when the screen locks, determine whether the VPN service stopped or the node became unreachable. Loosen v2rayNG’s battery restrictions only if background limits reliably reproduce the issue. If background traffic is the main concern, narrow the per-app proxy list.

Distinguish an always-on VPN from background traffic and repeated retries

v2rayNG uses Android’s VPN interface to receive traffic from apps routed through the VPN, then processes it using the Xray core according to your configuration. The VPN icon in the status bar only means Android still has a VPN connection; it does not confirm that the node is reachable or that large amounts of data are moving in the background. Apps may still make requests after the screen turns off, including message sync, photo backups, and app updates.

App requestVPN intercepts trafficRoute matchOutbound connectionResponse returned

Measure actual battery drain with a screen-off comparison

Use the same stable Wi-Fi network, working node, and system battery settings for both tests. Pause backups and large downloads beforehand. Don’t charge the phone or turn on the screen during either test, and keep it in the same place for both. Android’s idle behavior depends on the screen being off, the device being stationary, and whether it’s plugged in; pressing the power button alone doesn’t mean the phone immediately enters deep idle.

Android 6.0
Allow Doze to take effect
60 minutes
Suggested screen-off duration for an initial test
1 setting
Change only one setting in each comparison
  1. Establish a baseline. In a test environment that doesn’t depend on the VPN, stop v2rayNG and note the starting and ending battery levels and times. If turning off the VPN would interrupt work access or trigger a system block policy, leave it on and compare the current proxy list with one that includes only essential apps. Don’t disable blocking protections just to run a test.
  2. Run the comparison. Connect to the same node with your usual settings and leave the phone idle for the same amount of time. When you unlock it, note the overall battery level, VPN status, and whether the logs show repeated timeouts. If the problem only happens overnight, extend both tests to the same overnight period; a 60-minute initial test may not trigger idle restrictions.
  3. Reverse the order and test again. For example, if one test drops from 80% to 77% and the other from 80% to 75%, the total drain is 3 and 5 percentage points—a difference of 2 points. This is just an example, not a fixed v2rayNG battery usage figure. If the difference is small or reverses on a repeat test, check signal strength, sync tasks, and battery-level rounding before changing any allowlists.

How to assess the results: test drain and disconnects separately

If the extra drain is reproducible but the VPN stays connected with the screen off, try narrowing the proxy list or testing another stable node. If battery drain is about the same but the connection always drops when the screen turns off, focus on background restrictions. After each change, retest only the symptom it targets and keep the change only if it helps.

Disconnects when the screen locks: check battery optimization and manufacturer-specific background settings

Battery optimization allowlists relax some system restrictions; they’re not a permanent keep-alive switch. First restore v2rayNG’s standard background permissions. If the issue still occurs, try setting it to Unrestricted. Menu names vary by Android version and manufacturer. If you can’t find the option, search Settings for “App battery usage,” “Battery optimization,” or “Background usage limits.”

  1. Stock Android and Pixel: Long-press the v2rayNG icon → App info → App battery usage. If background usage is turned off, allow it and leave the setting on Optimized. If background usage is already allowed but the connection still drops with the screen off, try Unrestricted. On some versions, you need to tap the “Allow background usage” row to open its options, rather than just toggling the switch beside it.
  2. Older battery optimization list: If the app details don’t show the options above, search Settings for “Battery optimization,” switch the filter to All apps, find v2rayNG, and select Don’t optimize if needed. Note the original setting and restore it if the test shows no improvement.
  3. Samsung One UI: Go to Settings → Battery → Background usage limits. On some versions, open Battery and device care first. Check whether v2rayNG is listed under Sleeping apps or Deep sleeping apps, and remove it before testing again. Consider adding it to Never auto sleeping apps only if the system puts it back on the list and it’s actually disrupting the connection.
  4. Xiaomi HyperOS: In v2rayNG’s App info, look for Battery saver or Battery usage and set the app to No restrictions if needed. If the issue only happens after a reboot, search for Background autostart and check its permission. Autostart and maintaining an existing connection while the screen is off are separate things; allowing autostart doesn’t guarantee the app will connect to a node immediately after startup.

VPN is connected, but nothing loads: use the logs to narrow down the issue

Check the v2rayNG logs around the time of the disconnect, and note whether you had just switched from Wi-Fi to mobile data. The examples below are errors you may see in Xray logs. Look for repeated low-level errors rather than treating a summary message as the sole cause. If Android terminates the process, the app may not have time to write a final log entry.

Error: i/o timeout

Cause: A network read, write, or connection attempt reached its timeout. This doesn’t mean Android killed the VPN service. What to do: Test the original node over Wi-Fi, then test another known-working node on the same network. If the issue only happens on mobile data, troubleshoot that network separately.

Error: connection refused

Cause: The destination endpoint or an intermediate device explicitly rejected a connection, often because nothing is listening on the destination port. What to do: Check whether the destination in the log is local or remote, then verify the relevant service and port. If you’ve just updated your subscription, make sure you haven’t selected an outdated entry.

Error: failed to find an available destination

Cause: An outbound connection could not be established. This summary error may include a DNS resolution, dial, or handshake failure. What to do: Read the rest of the same log entry or the nearby low-level error and troubleshoot the specific cause. Don’t switch DNS servers or add a battery optimization exception based on this message alone.

If you temporarily raised the log level to capture the issue, restore the original setting afterward so frequent logging doesn’t skew your battery test. When asking for help, you can share the error type and timestamp, but remove sensitive details such as subscription URLs, node credentials, and server addresses first.

Per-app proxy: route only the apps that need it through the VPN

Per-app proxying is useful when you need a browser or a few apps to use the proxy while other apps can connect directly. It can reduce the background traffic v2rayNG handles, but it won’t stop excluded apps from syncing on their own or prevent battery drain caused by a weak mobile signal.

  1. Open the menu in the top-left corner of v2rayNG → Settings → Per-app proxy. After enabling it, leave Bypass mode off if the option is available, and select only the apps that actually need the proxy. In bypass mode, selected apps are excluded instead. Read the current version’s on-screen description before saving.
  2. Disconnect and reconnect the VPN so the app list is applied when the VPN service starts again. Test one selected app and one unselected app separately, then check sign-in, links that open in an external browser, and notifications with the screen locked. If a workflow hands off to another app, decide whether to add it based on which app makes the actual request.
  3. Keep the app list unchanged and repeat the screen-off comparison under the same conditions. If background drain hasn’t improved, don’t keep adding apps to the allowlist. Check the logs and battery usage again for network retries or background tasks from other apps.

FAQ: balancing an always-on connection with battery life

Do I need to add v2rayNG to the battery allowlist if I only use the proxy while browsing?

Usually, leave the system’s default Optimized setting in place. When you’re done, stop the VPN from within v2rayNG instead of just swiping its card out of Recents. Then check whether the system VPN icon disappears. If an always-on VPN is enabled, Android may restart the service; first confirm whether that setting is required for work or security.

Will enabling Always-on VPN stop disconnects when the screen locks?

When supported, this setting tells Android to keep the selected VPN service running or restart it. It won’t fix a node timeout. Search Settings for “VPN,” open the settings for the v2rayNG entry, and check whether your device offers this option. If the icon stays on but connections fail, check the logs instead; this setting can’t fix an unreachable node.

The proxy works with the screen locked, but chat notifications arrive only after I unlock. What should I do?

Use another device to send a test message while the phone is locked, and note when it’s sent and received. If the proxy stays connected but notifications from only one app are delayed, check that app’s notification permissions and background usage under App info, then review the per-app proxy list. Don’t relax background restrictions for v2rayNG and the entire phone just to address one app’s notifications.

If I need the VPN connected all day, which settings should I keep?

Start with a node you’ve confirmed is stable, the proxy scope your work requires, and the system VPN policy you need. Allow v2rayNG unrestricted battery usage only if disconnects repeatedly occur with the default battery optimization and the app passes the same test reliably after restrictions are relaxed. After a system update, check the menu settings and run one overnight idle test; there’s no need to redo everything.

Download the client