[InfluxDB] 413 Request Entity Too Large

Hello k6 community! I have been dabbling in k6 as we are investigating its abilities to become our new primary performance testing tool. So far the tool has performed pretty spectacularly! I’ve done most of the leg work to get it up and running and really only have one issue remaining. When running with anything more than 200 VUs on a single node, we’re getting the following error: 413 Request Entity Too Large. Needless to say we’re missing out on metrics when viewing the results in Grafana. I’ve taken a look at another forum post with the same issue: 413 error when writing data to InfluxDB. I tried Ned’s proposed solution of setting max-body-size. But as Ned noted might be the case, this did not seem to actually work for us, as we’re still getting the error and we’ve confirmed that the config is actually set on the influx server. This is pretty much blocking us, as if we can’t review the results of the test, then it’s not going to do us much good.

I have two questions:

  1. Does anyone have any further suggestions on remediating this issue?
  2. Has anyone been able to pump significant load to InfluxDB? I’m kind of surprised that this isn’t more commonly discussed, which leads me to believe that I just have something improperly configured.

Error message:

level=error msg="InfluxDB: Couldn't write stats" error="<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body>\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx/1.15.5</center>\r\n</body>\r\n</html>\r\n"

I’m going to give UDP connections a shot to see if that might solve this issue. Appreciate any suggestions or help on this!

Hi @rbs_bah,

What version of k6 are you using, you better just post the output of k6 version :wink: . Since v0.26.0 InfluxDB output should be less problematic … :). I do highly recommend using the latest v0.26.2 though.

From the output, it seems you have an Nginx in front of InfluxDB? nginx has a limit of its own which is 1m, probably a lot smaller then what k6 will send.

If you enable verbose logging (with -v) you will be able to see the size of what k6 pushes to InfluxDB. It is generally a LOT of data, I at least had troubles while writing this PR with InfluxDB being overwhelmed when I had a high number of RPS.

So you might be interested in playing around with, lowering the number of tags k6 produces, and possibly even using telegraf in order to aggregate some metrics if InfluxDB gets overwhelmed.

Hi @mstoykov ,
I got this problem on CentOS 7.8.2003 with K6 v0.32.0. I have set configuration for “max-body-size” on influxdb and “client_max_body_size” on nginx but it’s seem nothing change. The problem still existed.
Do you have any other idea ?
Thankyou so much.