apiserver: change default buffer size to 1000, make configurable #7505

Merged
merged 1 commit into from Jun 16, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Jun 15, 2017

Description of change

Change the default logsink buffer size to 1000,
matching the underlying limit of 1000 for bulk
insertions to Mongo. Also make the buffer size
and flush interval configurable via agent.conf.

QA steps

  1. juju bootstrap localhost
  2. juju debug-log -m controller
  3. juju model-config -m controller logging-config='=TRACE'
    (observe the log records are flushed at 2 second intervals)
  4. edit agent.conf, set "LOGSINK_DBLOGGER_FLUSH_INTERVAL: 1s" and restart jujud
    (observe the log records are flushed at 1 second intervals)
  5. edit agent.conf, set "LOGSINK_DBLOGGER_BUFFER_SIZE: 1" and restart jujud
    (observe the log records are flushed without delay)

Documentation changes

None.

Bug reference

None.

apiserver/apiserver.go
+ if cfg.DBLoggerBufferSize <= 0 || cfg.DBLoggerBufferSize > 1000 {
+ return errors.NotValidf("DBLoggerBufferSize %d <= 0 or > 1000", cfg.DBLoggerBufferSize)
+ }
+ if cfg.DBLoggerFlushInterval <= 0 {
@wallyworld

wallyworld Jun 15, 2017

Owner

Can we put an upper bound on this. Like we did for conn throttling config. We want to prevent the user from specifying something stupid.

@axw

axw Jun 16, 2017

Member

done, set to 10s

apiserver: change default buffer size to 1000
Change the default logsink buffer size to 1000,
matching the underlying limit of 1000 for bulk
insertions to Mongo. Also make the buffer size
and flush interval configurable via agent.conf.
Member

axw commented Jun 16, 2017

$$merge$$

Contributor

jujubot commented Jun 16, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 97aa24d into juju:2.2 Jun 16, 2017

1 check passed

github-check-merge-juju Ran tests against PR. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment