Home Blog

2026-10-04 · Africa Flying

Two slow endpoints, two fixes, and the number we do not have yet

The 26 September load test named two real bugs, and both are the kind that only show up when many people ask at once. The /api/latest/ endpoint returned a server error nine times in fifteen seconds under 50 simultaneous clients. The /api/ndvi-trends/ endpoint timed out on 50 of 150 requests, one in three.

A clue to the first came from asking the same endpoint three times. An endpoint that caches its answer gets faster each time: /api/regional/ dropped from 905 milliseconds to 108 and then 27. /api/latest/ barely moved, from 501 to 232 to 217, because nothing was caching its result. The chart at the end shows this for four endpoints.

On 27 September both were reworked. The latest-position endpoint now asks the database only for the ten columns it returns, keeps the answer for two seconds with a guard so many requests do not all rebuild it at once, and gains a new index through migration 0020. The commit also records that the index we first suspected already existed, so the lead in the original brief was wrong, and the fix was aimed at the real cost. The trends endpoint now asks the database one grouped question instead of one per country, caches the result for fifteen minutes behind a lock, rejects bad latitude, longitude or day values with a clear error, and reads only the validated Sentinel-2 rows, no longer a copy of MODIS data that had been reported as truth.

Here is what we have not done: rerun the load test after the change. The repository holds the before numbers and the tests of the new logic, and nothing else, so this post makes no claim about how much faster either endpoint now is. When the rerun exists, it will get its own post. The first test is described in the previous post, and the live service health is on the status page.

All of this is backend work for a pre-operations, simulation-only platform.

Read next

The detail chart

Latency of the first, second and third call to four endpoints, before the fix. Secondary to the story above.

Grouped bar chart of the latency in milliseconds of the first, second and third call to four endpoints before the fix: /api/latest/ 501, 232, 217; /api/sim-homes/ 345, 238, 226; /api/regional/ 905, 108, 27; /api/procedures/ 135, 30, 16.
Load test 26 Sep: latency of three repeated callsCredit: Africa Flying. Licence: Project content, draft; the numbers are the project's own records

Sources and credits

Written for the Africa Flying blog, September 2026 issue. Pre-operations R&D: nothing described here is a flight operation.