Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/k6/next/using-k6/protocols/http-2.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/k6/next/using-k6/protocols/http-2/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
HTTP/2
Overview
HTTP/2.0 is the latest version of the HTTP protocol. It improves significantly upon HTTP/1. Most importantly, it introduces a binary wire protocol with multiplexed streams over a single TCP connection. This solves a long-standing performance issue with HTTP/1.1: head-of-line blocking.
Well, it at least partially solves it. The TCP congestion control mechanisms can interfere with the intended independent nature of the multiplexed streams in cases of lost/dropped packets and retransmission/reassembly. The full solution is to run HTTP/2.0 over UDP, as Google implemented with QUIC.
Additional features of HTTP/2.0
- Builtin compression of HTTP headers
- Server push
- Pipelining of requests
- Prioritization of requests
Load testing HTTP/2 with k6
When you make HTTP requests in k6, k6 automatically upgrades the connection to HTTP/2.0 if the server supports it, just like your web browser would.
To check what protocol was used for a particular request, refer to the proto property of the response object.
import http from 'k6/http';
import { check, sleep } from 'k6';
export default function () {
const res = http.get('https://quickpizza.grafana.com');
check(res, {
'protocol is HTTP/2': (r) => r.proto === 'HTTP/2.0',
});
sleep(1);
}To see the values that the r.proto field can have, refer to the documentation for
k6 HTTP.
Was this page helpful?
Related resources from Grafana Labs

