element-hq / element-hq/element-android

many sync - big battery drain

Open
#2,733 8 comments 5 reactions 0 assignees View on GitHub
A-Performance A-VoIP
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

Android Element use many sync calls at every day and it is in top of battery usage.

Element do many sync periodicaly - this is strange. For example - we get 2021-01-26 (graphs show only syncs-requests of my phone to my matrix-server) - every 2 hour we get many syncs. And get every hour at second part of day:
![2021-01-26-syncs](https://user-images.githubusercontent.com/1297163/106084387-013af200-616a-11eb-89da-79cfa59e7e95.png)
Statistics from server logs about this day:
```
cat /var/log/matrix-synapse/homeserver.log* | grep 2021-01-26 | grep '@progserega:rsprim.ru' | grep YD201 | cut -d ' ' -f26 | cut -d '?' -f1 | cut -d '+' -f1 | cut -d '!' -f1 | sort | uniq -c | sort -n
1 /_matrix/client/r0/sendToDevice/m.room_key_request/$local.602bef93-d447-4c45-a028-16e224105c75
2 /_matrix/client/r0/capabilities
2 /_matrix/client/r0/pushers/set
2 /_matrix/client/r0/voip/turnServer
2 /_matrix/media/r0/config
6 /_matrix/client/r0/pushers
6 /_matrix/media/r0/upload
7 /_matrix/client/unstable/room_keys/version
9 /_matrix/client/r0/user/@progserega:rsprim.ru/account_data/im.vector.setting.breadcrumbs
11 /_matrix/client/r0/devices
16 /_matrix/media/r0/preview_url
18 /_matrix/client/unstable/room_keys/keys
32 /_matrix/client/r0/rooms/
80 /_matrix/client/r0/keys/query
423 /_matrix/client/r0/groups/
4013 /_matrix/client/r0/sync
```
I think ~4000 syncs per day - big value. I wont show number events received by me at this day, but I do not know sql query for that. If you help me - I will attach this information in comment.

For example - week syncs:
![week-syncs](https://user-images.githubusercontent.com/1297163/106085941-e158fd80-616c-11eb-99f7-c59e80aa7ee4.png)
We see periodicaly strange big number of syncs...

this essue as continue of #2163

Element Android: 1.0.13 gplay
Phone: Yotaphone2
Server: matrix-synapse-py3 1.21.2+stretch1 amd64 on debian 9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.