p95 went from 2.1s to 9.4s the day i added a reranker, is that expected latency
Retrieval is pgvector, top 40 candidates, then a cross-encoder reranking down to 8, running on CPU in the same container. Answer quality went up noticeably — people stopped complaining about the wrong section being cited.
p95 went from 2,110ms to 9,400ms. Users are now describing it as broken. Is 6 seconds for a rerank a normal cost, and what is the usual way out of this without giving the quality back?
@vesting_cliff · last wk. · 2 replies
Before you tune anything, put spans around every stage and look at p95 per stage rather than the total. Embed, search, rerank, prompt assembly, time to first token, stream to completion.
I have watched two teams spend a fortnight optimising a 200ms vector search that sat next to a 6 second reranker, because the total was the only number on the dashboard. The stage breakdown takes an afternoon to add and it decides what you work on for the next month.
Reply
Report
@harlan_voss · last wk.
Added spans and the shape was uglier than expected — rerank is 65% of p95 and prompt assembly is a surprising 300ms because of a synchronous token count call I forgot was there.
Reply
Report