For v2rayNG users dealing with disconnects when the screen is off, battery drain on standby, or an unexpectedly high battery-usage ranking. First distinguish a stopped VPN service from a timed-out node connection, then compare standby drain on the same phone. Change battery or auto-start settings only after confirming that background restrictions are affecting the connection.
Android Doze and manufacturer background limits: what can interrupt a connection when the screen is off
Android 6.0 introduced Doze. When a phone is unplugged, stationary, and has its screen off for an extended period, Android restricts background network access and some tasks, batching them into maintenance windows. Android 7.0 added a lighter idle mode that can impose some restrictions even when the screen is off and the phone is moving. The screen turning off does not trigger deep Doze immediately, and the time it takes to enter Doze is not fixed.
Manufacturer background management adds another layer of restrictions. It may prevent apps from starting in the background or stop services that are already running. The first can mean no automatic connection after a reboot; the second can cause the VPN to disconnect after the screen has been off for a while. If the node or network fails, Android may still show the system VPN as connected because it reports the local VPN interface, not whether the node is reachable.
- System VPN is disconnected: Check battery settings, background restrictions, and whether another app has taken over the VPN before reviewing the node configuration.
- System VPN is still connected, but an app won't load: Note the time and preserve the current state. Check network changes, the node connection, and routing rules first.
- Connection recovers after unlocking: Check both idle restrictions and the underlying network; this alone does not prove Doze is the cause. After unlocking, check the system VPN status before opening v2rayNG so the app does not alter the state you're investigating.
Compare standby battery drain: measure total drain first, then check app usage
Open Settings → Battery → Battery usage and note the change in overall battery level and v2rayNG's listed usage. The app ranking is a system estimate for the selected time window; being ranked first does not mean the phone lost that same amount of battery. Check whether the window includes screen-on use, charging periods, or background sync from other apps.
- Measure a disconnected baseline: When doing so won't disrupt your work or device security policy, turn off the VPN using the main switch in v2rayNG. Leave the screen off for 60 minutes in the same location on the same Wi-Fi network, and record the starting and ending battery levels. If your device requires an always-on VPN, don't disable that policy for this test.
- Run a connected comparison: Use a node you've confirmed is working, with the same battery mode, network, and standby duration. Don't charge the phone, play media, manually update subscriptions, or run batch speed tests during either test. Keep the starting battery level and device temperature as similar as possible.
- Record when the problem occurs: Note when the screen turns off and wakes, the VPN status, any network changes, and the log timestamps. To check longer standby periods, extend both tests to 6–8 hours rather than extrapolating an hour of drain across an entire night.
Example: the disconnected test drops from 81% to 80%, while the connected test drops from 81% to 78%—a difference of 2 percentage points. These figures illustrate how to record results; they are not measured findings or a normal range. Battery levels are shown as whole numbers, so small differences in a single test may come from rounding or background sync. Repeat the tests twice under similar conditions before deciding whether the difference is consistent.
Bottom line: confirm a consistent difference before changing background permissions
If both tests show similar drain, leave the setting at Optimized and investigate overall battery use. Look further into the node, network, and app traffic routed through the VPN only if the connected test repeatedly drains noticeably more than the baseline.
Connection timeouts and repeated requests: use logs to find the source of battery drain
If the phone works normally with the screen on but keeps losing battery on standby, check whether outbound requests are repeatedly failing during the affected period. These requests may come from apps using the VPN, not from v2rayNG running repeated speed tests. Retries and frequent small transfers can increase network activity, but a single error in the log does not tell you how much battery it used.
Common log messages and what to check
Error: failed to find an available destination
Cause and next steps: Xray could not establish this outbound connection. This summary error alone does not tell you whether the failure occurred during DNS resolution, dialing, or the handshake. Check lower-level errors from the same time, then compare the address and port with the client configuration and server details. Check port 443 only if your configuration actually uses 443; don't change ports at random while troubleshooting.
Error: context deadline exceeded
Cause and next steps: An operation exceeded its timeout, but that alone does not mean the server is offline. Keep the same node and make the same request once on stable Wi-Fi and once on mobile data. If the error appears only briefly after switching networks, first investigate how the underlying connection recovers rather than changing battery settings.
If the error keeps recurring on stable Wi-Fi, keep the usage scenario the same and try a different node known to work. If the error persists, open v2rayNG and go to Settings → Per-app proxy to temporarily narrow the apps included in the test. In bypass mode, selected apps are excluded from the VPN. Check the mode before making changes so you don't accidentally exclude apps that need the VPN. Restore the original app selection when you're done. Before sharing logs, remove subscription URLs, node addresses, and account identifiers.
Choosing battery optimization, auto-start, and persistent notifications
Keep the defaults first, then change settings one at a time based on the symptoms. Use the same screen-off duration and network conditions for each retest. Setting names vary by manufacturer and Android version. If you can't find an option, search Settings for “App battery usage” or “Auto-start” and follow the options shown on your phone.
| Symptom | Setting and action | How to verify |
|---|---|---|
| Works with the screen on, but the system VPN disconnects when the screen is off | On phones with this option, go to Settings → Apps → v2rayNG → App battery usage. If the current setting is Restricted, change it to Optimized first. If the problem still reproduces consistently, try Unrestricted as a separate test. | Repeat the screen-off test under the same conditions. After waking the phone, check whether the system VPN is still active, then compare overall battery drain. Restore the original setting if there's no improvement. |
| Have to open the app manually after a reboot | On phones with a Background auto-start option, search for it and check v2rayNG's permission. Change it only if you need the app to start automatically. Allowing auto-start does not mean the app will connect to the VPN automatically. | After rebooting and unlocking, don't open v2rayNG yet; check the system VPN status directly. If you need Android to keep the VPN active automatically, also check Always-on VPN. |
| Hard to tell whether the VPN is connected; no notification appears | Go to Settings → Apps → v2rayNG → Notifications and check the main notification switch and any available notification categories. On Android 13 and later, notification permission affects whether foreground service notifications appear in the notification drawer. | After connecting, check both the notification drawer and the system VPN page. Seeing the notification again only confirms that the status is visible; it doesn't mean Android has removed battery restrictions. |
For phones that connect only when needed, starting with Optimized and a visible notification is usually enough. For phones that need to stay connected for long periods, first confirm that the VPN service actually stops when the screen is off, then try relaxing battery restrictions for the app. Auto-start addresses startup needs; it won't fix handshake failures on a poor network. Battery optimization exemptions don't guarantee an app will stay running: manufacturer background policies, network changes, and manually stopping the service can still affect the connection.
Common questions about screen-off behavior, reboots, and notifications
Does a VPN disconnect as soon as the screen turns off mean Doze is definitely the cause?
Not necessarily. First turn off automatic network switching if it could interfere with the test, keep Wi-Fi unchanged, and turn the screen off for 5 minutes and then 60 minutes. After waking the phone, check the system VPN status first. If the service stops within a short time, check the app's battery settings and manufacturer background management. If the service is still running but requests fail, use the logs to troubleshoot outbound connections.
Do I have to tap Connect after every reboot, or can Android handle it?
Search Settings for VPN and tap the settings button next to the v2rayNG entry. If Always-on VPN is available and allowed by your device policy, enable it and verify after rebooting. Block connections without VPN is a separate setting: when enabled, it blocks traffic that isn't routed through the VPN if the VPN is unavailable. Don't turn it on just to test automatic startup.
Will turning off the persistent notification reduce standby battery drain?
Disabling notifications and stopping the VPN are two different things. Check the service status on the system VPN page. When you don't need a connection, stop the service from the v2rayNG main screen. If Always-on VPN is enabled, also check whether Android will restart the connection. Hiding the notification alone does not provide a valid disconnected baseline for battery testing.
Battery drain is still high on Unrestricted. What should I check next?
If relaxing battery restrictions doesn't fix the disconnects, restore the original setting first. Retest with the same node on stable Wi-Fi, then check battery usage for background activity from sync, downloads, or calling apps. If you use Per-app proxy, change one group of apps at a time. Changing nodes, routes, and networks together makes it hard to identify the cause.