API endpoint for transmitter statistics is very slow
The API endpoint for transmitter statistics is very slow nowadays.
This endpoint is used by the auto-scheduler to fetch the transmitter statistics which is needed for an informed scheduling decision. While this endpoint is paginated, the scheduler is usually interested in a lot of transmitters and thus sequentially fetches all pages.
A small script (measure_network_api.py) was used to produce the following measurements (2022-01-08). This script is based on the auto-scheduler code.
- network-prod:
$ ./measure_network_api.py https://network.satnogs.org/api/transmitters/ Number of requests: 49 Average time per page: 2.31 s Total time waiting for response: 113.16 s
- network-dev:
$ ./measure_network_api.py https://network-dev.satnogs.org/api/transmitters/ Number of requests: 14 Average time per page: 0.16 s Total time waiting for response: 2.24 s
- Investigate caching of this endpoint
- Once cached, consider offering an unpaginated view to reduce the number of requests needed
Edited by Fabian P. Schmidt