# The flush operation took higher than the expected set push interval

**URL:** <https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734>\
**Category:** Grafana k6\
**Created:** [December 2, 2021, 11:01am UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734 "2021-12-02T11:01:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattK6](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MattK6](https://community.grafana.com/u/MattK6)\
**Post date:** [December 2, 2021, 11:01am UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/1 "2021-12-02T11:01:15Z")

</div>

Hi,

I am using K6 in a Docker with influx db and Grafana dashboard.

I am using rampingArrivalRate as shown below.

When I run the tests, in the containers I see lots of the following warnings. Anyone know what this means and how I can fix it please?

```auto
time="2021-12-02T10:48:56Z" level=warning msg="The flush operation took higher than the expected set push interval. If you see this message multiple times then the setup or configuration need to be adjusted to achieve a sustainable rate." output=InfluxDBv1 t=1.67979745s

```

Here are the options I am using in the test:

```js
export let options = {
  scenarios: {
    successfulLogin_rampingArrivalRate: {
      executor: 'ramping-arrival-rate',
      startRate: 280,
      timeUnit: '5m',
      preAllocatedVUs: 2,
      maxVUs: 8,
      stages: [
        { target: 280, duration: '1m' }, //Ramp up
        { target: 280, duration: '5m' }, //Stay at same level
        { target: 0, duration: '30s' }, // Ramp down
      ],
    },
  },

```

---

<div class="post-metadata">

**Author:** ![codebien](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/codebien/32/35274_2.png) [@codebien](https://community.grafana.com/u/codebien)\
**Post date:** [December 2, 2021, 2:14pm UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/3 "2021-12-02T14:14:39Z")

</div>

Hi @MattK6,  
the requests for flushing metrics to InfluxDB are taking longer (1.6s in your reported case) of the set flush interval (default to `1s`) so it means that `k6` is probably flushing more metrics than InfluxDB can really handle.  
Do you see a high value of CPU and/or RAM for your InfluxDB instance? Are you using the same machine for running k6 and InfluxDB or are they separated?

I list here some steps to try for getting a better response time from `InfluxDBv1`:

- You could set only the [SystemTags](https://k6.io/docs/using-k6/options/#system-tags) that you really need for your analysis. This can help for reducing the number of metrics that `k6` is generating and InfluxDB have to ingest.
- Tune the [options](https://k6.io/docs/results-visualization/influxdb-+-grafana/#influxdb-options) of the k6 output for InfluxDB:
  - You could consider excluding some tags to be indexed `K6_INFLUXDB_TAGS_AS_FIELDS` that should speed up the ingestion phase for InfluxDB. Note that not indexed tags could be slow when you need to query them.
  - Reduce the `K6_INFLUXDB_PUSH_INTERVAL` and increase the `K6_INFLUXDB_CONCURRENT_WRITES` options for flushing batches with a smaller number of metrics. You probably will need to check the logs with the [–verbose](https://k6.io/docs/using-k6/options/#verbose) option for setting the right values.

- Try to use [Telegraf](https://github.com/influxdata/telegraf) for aggregating some metrics before sending them to InfluxDB.

If none of the previous suggestions works for you then you could try the new [InfluxDBv2 extension](https://github.com/grafana/xk6-output-influxdb) and see if it’s able to ingest your metrics faster.

---

<div class="post-metadata">

**Author:** ![fatkobra](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fatkobra](https://community.grafana.com/u/fatkobra)\
**Post date:** [January 17, 2022, 2:02pm UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/5 "2022-01-17T14:02:05Z")

</div>

Hey man!

Would you please be so kind and explain (an example) how do manipulate these:

`K6_INFLUXDB_PUSH_INTERVAL`  
`K6_INFLUXDB_CONCURRENT_WRITES`

Is it via the command line? Like that:

```auto
$ k6 run K6_INFLUXDB_PUSH_INTERVAL=blah script.js

```

---

<div class="post-metadata">

**Author:** ![codebien](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/codebien/32/35274_2.png) [@codebien](https://community.grafana.com/u/codebien)\
**Post date:** [January 17, 2022, 3:37pm UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/6 "2022-01-17T15:37:47Z")

</div>

Hi @fatkobra,  
you can find documentation about how to use the options at the doc page [Using options](https://k6.io/docs/using-k6/options/#using-options).

So, as the example mention, in the case of shell you can use:

```sh
$ K6_INFLUXDB_PUSH_INTERVAL=1s k6 run script.js

```

---

<div class="post-metadata">

**Author:** ![fatkobra](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fatkobra](https://community.grafana.com/u/fatkobra)\
**Post date:** [January 19, 2022, 8:16am UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/7 "2022-01-19T08:16:23Z")

</div>

Thank you so much @codebien for your input.

I was able to successfully use `K6_INFLUXDB_PUSH_INTERVAL=2s` and see the positive changes.

```auto
K6_INFLUXDB_PUSH_INTERVAL=2s k6 run --out influxdb=https://influxdb.blah.blahblah:portNo/somedb script.js --quiet

```

---

<div class="post-metadata">

**Author:** ![naveenmarthala1](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@naveenmarthala1](https://community.grafana.com/u/naveenmarthala1)\
**Post date:** [January 26, 2025, 4:43pm UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/8 "2025-01-26T16:43:34Z")

</div>

> [@codebien](#):
>
> You could set only the [SystemTags](https://k6.io/docs/using-k6/options/#system-tags) that you really need for your analysis. This can help for reducing the number of metrics that `k6` is generating and InfluxDB have to ingest.

Where do I do this?

My K6 version is, `k6 v0.56.0 (commit/50afb99947, go1.23.4, linux/amd64)` and influx-db version is `1.11.8`.

I was running K6 script from bash like this, `k6 run --out influxdb=http://localhost:8086/db_name sample_tests.js`. Do I need to specify the the tags that need to be pushed to InfluxDB in a .config file somewhere? Can you point me to docs for this please, preferrably with an example. I couldn’t figure out much from the [SystemTags](https://k6.io/docs/using-k6/options/#system-tags) that you had linked above, as I was concerned primarily with sending/pushing tags to InfluxDB.

Thanks.

---

<div class="post-metadata">

**Author:** ![codebien](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/codebien/32/35274_2.png) [@codebien](https://community.grafana.com/u/codebien)\
**Post date:** [January 27, 2025, 9:54am UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/9 "2025-01-27T09:54:04Z")

</div>

Hey @naveenmarthala1,  
here there is the up to date link for [Options.SystemTags](https://grafana.com/docs/k6/latest/using-k6/k6-options/reference/#system-tags). Please, check it and let we know if it works for you.

---

<div class="post-metadata">

**Author:** ![naveenmarthala1](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@naveenmarthala1](https://community.grafana.com/u/naveenmarthala1)\
**Post date:** [January 27, 2025, 4:25pm UTC](https://community.grafana.com/t/the-flush-operation-took-higher-than-the-expected-set-push-interval/98734/10 "2025-01-27T16:25:43Z")

</div>

Thanks for the reply. In the section that opens from the link attached, I see `proto` ,`subproto` ,`status` ,`method` ,`url` ,`name` ,`group` ,`check` ,`error` ,`error_code` ,`tls_version` ,`scenario` ,`service` ,`expected_response`, however, to InfluxDB, metrics like `http_req_duration`, `http_req_connecting` are what I’m expecting to push and show up in my grafana dashboard. Where do I find the list of tags or metrics that are sent to influxDB via the flag `--out` (of `k6 run`) and how do I restrict that list of metrics? I’m sure I’m missing something here.
