Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 339

K6 v0.57 HTTP requests hang on AWS EC2 (curl & Python succeed)

$
0
0

I have three clients on the same EC2 instance calling the same API:
1) k6 (v0.57):

import http from 'k6/http';
export default function () {
  http.post(
    'https://api.example.com/endpoint',
    JSON.stringify({ foo: 'bar' }),
    { headers: { 'X-Auth-Token': __ENV.TOKEN }, timeout: '60s', redirects: 5 }
  );
}

2) Python:

import json, sys
from urllib import request

req = request.Request(
  'https://api.example.com/endpoint',
  json.dumps({ 'foo': 'bar' }).encode(),
  { 'X-Auth-Token': sys.argv[1], 'Content-Type': 'application/json' }
)
resp = request.urlopen(req, timeout=60)
print(resp.read())

3) Shell (curl):

curl -sSL -w "STATUS:%{http_code}" \
  -H "X-Auth-Token: $1" \
  -H "Content-Type: application/json" \
  --data '{"foo":"bar"}' \
  https://api.example.com/endpoint

Observed:

  1. Python & curl complete in ~200 ms.
  2. k6 blocks for 60 s, then times out (server did not see the request).

What I’ve already tried:

  1. export K6_DNS=“policy=onlyIPv4” (still hung)
  2. export GODEBUG=“http2client=0” (still hung)
  3. k6 run --dns=“policy=onlyIPv4” --http-debug=“full” script.js
  4. change container from alpine to ubuntu, still hung

Notes:

  1. k6 v0.57
  2. No proxy in use

Questions:

  1. What else can I try to force k6 to behave like curl/python?
  2. Any known bugs in v0.57 around DNS or HTTP/2?
    Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 339

Trending Articles