**❓ Re: High latency for KV** I'm experiencing a latency of 20ms-200ms for KV.get, even when there'

❓ Re: High latency for KV

I'm experiencing a latency of 20ms-200ms for KV.get, even when there's only one record and multiple requests are made from the same location. The value remains unchanged throughout. The lowest latency I've observed is 14ms, but it's infrequent.

Here's how I measured:

export default {
  async fetch(request, env, ctx) {
    const time_start = Date.now();
    const data = await env.KV.get("test");
    const latency = time_start - Date.now();
    return new Response(JSON.stringify({ data, latency }));
  },
};

The latency response should remain unaffected by any delays in the request. Given the current response rate, it would be more efficient to utilize the database.

What mistake am I making?
Was this page helpful?