Currently the handshake time is included in the RTT, so TCP and TLS
retries/forwards makes upstreams look bad compared to UDP, and
discourage connection reuse as other "faster" origins end up
with lower score, so they would be preferred.
This commit excludes wait and handshake time, so only the actual
message exchange time is included in the RTT calculation.
}
}
+ /* Reset the query start time to exclude connection establishment time,
+ * otherwise server would appear slower on every reconnect / TCP retry.
+ * The sessions support query multiplexing and keepalive, so the connection time
+ * is amortized over multiple queries.
+ */
+ for (size_t i = 0; i < session->waiting.len; ++i) {
+ struct qr_task *task = session->waiting.at[i];
+ struct kr_query *query = kr_rplan_last(kr_resolve_plan(&task->ctx->req));
+ query->timestamp_mono = kr_now();
+ }
+
ret = worker_add_tcp_connected(worker, &peer->ip, session);
if (deletion_res == kr_ok() && ret == kr_ok()) {
ret = session_next_waiting_send(session);