Field Notes
Upgrading Supabase from Small to Medium: some real production numbers
This Monday morning I upgraded the Postgres database for LeadTruffle from a Supabase Small instance to Medium.
This takes you from 2 GB to 4 GB of RAM, and the listed compute price goes from about $15 to $60 a month (both are still shared CPU). You can see the instance sizes and pricing here.
So it’s another $45 a month for the database compute. I wanted to see how much of a difference that actually made in the application, so I went back through the AWS Lambda logs and compared this week with last week.
Comparing the logs
I used Monday through Wednesday from both weeks: October 26–28 and November 2–4. Since I did the upgrade around 6 AM Monday, I started both Mondays at 6 AM too. This gives us 66 hours on each side.
There was also a daylight saving time change between the two weeks, so these are matched by Eastern local time. Otherwise you end up comparing slightly different parts of the day.
The API handled 454,627 invocations in the first window and 452,095 in the second. Basically the same volume.
Here are the execution times from the Lambda REPORT logs:
| API execution time | Small | Medium | Reduction |
|---|---|---|---|
| Median | 48.2 ms | 47.3 ms | 1.8% |
| Average | 247.9 ms | 195.9 ms | 21.0% |
| p95 | 810.5 ms | 615.4 ms | 24.1% |
| p99 | 3,384.4 ms | 2,001.5 ms | 40.9% |
The median barely moved. But if you look at the slower requests, the difference gets quite large. At p99 we went from about 3.4 seconds to 2 seconds. That’s roughly 1.4 seconds off the time at that percentile.
For context, p95 is the duration that about 95% of invocations finished within, and p99 is the same idea for 99%.
The p95 improvement also showed up on each individual day. It wasn’t just one unusually good day pulling the whole thing down. Excluding explicit cold starts still left about the same improvement, and comparing only Tuesday and Wednesday gave a roughly 26% reduction.
Contact search improved quite a bit
We have a separate timer around contact search, which is useful here because it runs a database query and processes the results. There isn’t an AI model or external CRM call inside that timer adding some unrelated delay.
| Contact-search time | Small, 182 searches | Medium, 187 searches |
|---|---|---|
| Median | 127 ms | 50 ms |
| Average | 462 ms | 64 ms |
| p95 | 2,356 ms | 123 ms |
This is the more interesting result to me. The median fell about 61%, and the p95 went from over 2 seconds to 123 milliseconds. The median improved on all three days here too.
Of course, 182 and 187 searches is a much smaller sample, and these are different people searching for different things. The timer also includes connection waits and network time. I wouldn’t assume every database query is going to improve by the same amount.
More generally, these are production application timings. Traffic mix, other deployments, etc. can affect them, and I don’t have historical database CPU or cache-hit measurements to pin down exactly where the improvement came from. The background workers had much smaller changes, with average durations ranging from basically unchanged to about 14% lower.
But given what showed up in the API and contact search, I think the extra $45 a month looks pretty reasonable for this workload. The typical API request was already quick. Getting the slower requests down is where this upgrade seems to have helped.