first request each morning takes 1.1s and the rest 60ms, is that just cold start Cold Start
First deployed project. Every morning the first page load takes around 1.1s, and after that everything sits at 50-70ms for the rest of the day. If I leave it alone for an hour or two over lunch the slow one comes back.
I assumed cold start, but I do not really know what that covers or whether 1.1s is a normal amount of it. Is there a way to tell what the second is being spent on before I start changing things?
@two_vcpu_club · 3mo ago · 3 replies
Normal, and there are usually two separate sleeping things rather than one. Measure before you touch anything:
plus a module-scope
const boot = Date.now()you log once, so you can tell a cold instance from a warm one.Then force a cold one and read the split:
Guessing between those two costs a weekend. Measuring costs ten minutes.
Reply
Report
@two_vcpu_club · 3mo ago
That is the most common answer for a first project, because scale-to-zero is usually the default on the free and cheap tiers - which is exactly right for a hobby project and surprising the moment somebody else is using it. Now you know what you are buying if you ever upgrade the plan.
Reply
Report
@flashcard_fen · 3mo ago
It was the database. 740ms of the 1.1s was the first query, and the compute is on a plan that suspends after five minutes of no connections. I had never even seen that setting.
Reply
Report