Open jayb-g opened 1 month ago
Do you have battery optimization enabled for this app?
Do you have battery optimization enabled for this app?
I have all the default and recommended settings. So battery usage is set to unrestricted. The issue seems to be mostly when on mobile data.
@jayb-g Maybe have a look here: https://github.com/binwiederhier/ntfy/issues/687
@Finn10111 interesting and seems likely
I'm experiencing the exact same issue on Pixel 8a, Android 14 and (recently) 15. It is caused by the keep-alives (TCP + websocket ping-pongs) that are constantly waking the radio up. These intervals are hard-coded in go source - https://github.com/golang/go/blob/master/src/net/dial.go#L19-L23 Ntfy alternatives like gotify are also suffering from the same issue, see here: https://blog.wirelessmoves.com/2020/08/improving-the-keep-alive-behavior-of-gotify.html
Gotify has the option to increase/remove keepalives, but unfortunately even when using gotify and configuring the options, it didn't help me and I believe this is due to using another go-based "product" in the chain - Caddy as a reverse proxy. I cannot easily remove Caddy to prove my hypothesis...
In any case, since ntfy doesn't have the configurable keepalive options, your only options is to use the "cloud"/paid version that is using FCM.
@aelth you're probably right about pixel 8a having the problem. But keepalives shouldn't be a problem in general. Keepalives shouldn't cause a battery problem at all. That's what it's (kinda) designed for. I'm no expert but this has something to do with specific devices/radios having the issue. So probably vendor drivers related and maybe fixed only by OS update some time in future.
On the other hand I wouldn't rule out the possibility of buggy implementations of keepalives by certain apps. Can be deduced if we can confirm at least one or two apps which uses push/keepalives but doesn't use a lot of battery on mobile data.
Would help devs if ntfy logs(while only on mobile data) is shared.
Recently observed more than 40% battery usage on mobile data in around 10 hours of wifi outage.
:question: Question
Asked initially at https://github.com/binwiederhier/ntfy-android/issues/90
I tested this app on a degoogled android and it gives more than 10% battery usage. The least I have seen is 4-5%.
This is on Mobile data, no WiFi. On (mostly)WiFi it seems to work fine with <1% battery usage.
All default settings. With only molly unifiedpush setup with it.
Battery optimization is disabled for both ntfy and molly-up
Is this normal battery usage for ntfy?
Android 14 latest on Pixel 7