Kong - File Log Plugin

Hi,
We are planning to use File log plugin for Kong deployed in K8s environment. Is the docs it is mentioned as it may impact the performance as below -

This plugin uses blocking I/O, which could affect performance when writing to physical files on slow (spinning) disks.

We wanted to understand what impact it will have when logs are written “/dev/stderr” streams.

  1. Will it have impact to live traffic proxied though gateway?
  2. Will there be any loss of logs at high TPS?
  3. Will it add any latency to live traffic?
  4. What is recommended value for “config.reopen” parameter when logs are written to streams?

Thanks.

Any suggestions on this?

The underlying Lua calls to write to files are always blocking and will result in worse performance than the other log plugins (which use non-blocking socket calls to write log data). However, the time to write to stdout and stderr should be quite short (certainly much shorter than a disk), and the effect on throughput should be minimal.

We don’t maintain official benchmarks for this, but it should be simple enough to test by running a load tester against some route with and without file-log configured–if you wish to do so and can share your results here, they should be of interest to others.

reopen should not matter for stdout and stderr–I’m not aware of any circumstance where their file descriptor changes (I could be wrong, but it seems unlikely). Leaving it disabled will conserve some CPU time since it will skip those syscalls and go directly to a write.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ