how do you separate init time from handler time when the logs only give me total duration
i can see p95 creeping up but i cannot tell whether it is a handful of cold invocations dragging the tail or my handler genuinely getting slower. the platform dashboard gives me duration and invocation count and nothing about which requests were cold. before i start optimising i want to know how many of my requests are actually paying init cost. how do you measure the split in practice?
@shadowing_sena · 2mo ago · 3 replies
on lambda the report line for an invocation includes an init duration field only when that invocation was cold, so counting the report lines that carry it gives you the cold rate directly and the init cost separately from the billed duration. if you are somewhere without that, the portable trick is to record a timestamp at module scope and compare it to the time at the top of the handler on the first request the instance serves. either way, tag the log line so you can group by cold and warm and stop reasoning about one average.
Reply
Report
@salted_hash_h · 2mo ago
and once you split them the tail usually stops being mysterious. mine was two clean distributions that looked like one ugly one.
Reply
Report
@first_repo_finn · 2mo ago
grouping by cold and warm rather than looking at one p95 is the reframe i needed. i have been averaging two different populations together.
Reply
Report