The homepage of our Drone server takes ~10 seconds to load. Specifically, the request to the "/api/user/repos?latest=true" endpoint takes ~10 seconds to respond.
From the source code of the Drone server, we see that this endpoint executes a PostgreSQL query: https://github.com/harness/harness/blob/4f85961434061d8a36be9d7528e5a0171a07d3ba/store/repos/repos.go#L520-L529
Our Drone server uses a PostgreSQL instance in Google Cloud SQL. From the query insights, we have confirmed that this query takes ~10 seconds to execute. We have tried increasing the number of CPU cores for the PostgreSQL instance, which resulted in some improvement, but the query remains very slow.
There is a "TODO" comment from 6 years ago acknowledging that this query needs performance tuning: https://github.com/harness/harness/blob/4f85961434061d8a36be9d7528e5a0171a07d3ba/store/repos/repos.go#L496-L506
The comment also suggests an alternative query, which is significantly faster. We request that you update the query in the source code of the Drone server.
Created by Abhishek
·