TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
183 stars 49 forks source link

DOCKER-483: Audit log causes out of memory crashes #47

Closed misterdjules closed 9 years ago

misterdjules commented 9 years ago

This change prevents logging the body of a given request if its size is superior to a given constant.

This prevents some of the out of memory crashes that are due to stringifying large requests' bodies before logging them.

misterdjules commented 9 years ago

/cc @trentm @joshwilsdon @twhiteman Looking for preliminary feedback.

There are other things we could do regarding this:

  1. For requests with large payloads, we could log a portion of the body instead of not logging it at all, which might help us troubleshoot issues sometimes.
  2. The threshold could also be made configurable in config.json.
misterdjules commented 9 years ago

Mostly as a note to myself, after some discussions with @trentm and @joshwilsdon, here's what we'll do:

  1. Create our own fork of the resitfy audit logs plugin.
  2. Make that fork accept different configurations/values for requests and responses.
  3. Make that fork not log buffers and truncate large strings (> 10 KBs) in requests and responses' bodies by default.
  4. Make that fork accept overrides for the threshold of what is considered to be too large for a request/response body.
misterdjules commented 9 years ago

@trentm Updated this PR according to our discussion with a second commit. Could you please take a look and let me know what you think?

trentm commented 9 years ago

LGTM

misterdjules commented 9 years ago

Merged with 90fb9aa688d152fe6b1bbb124baa54c992ca762d.