-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logging performance issues in Elasticsearch v2. rsyslog improvements
After upgrading to elasticsearch v2, some of our logging tests were consistently failing if they happened to follow a number of other tests. The issue was that if a test previously ran that made a bunch of requests, then Elasticsearch wasn't indexing the data quickly enough, causing rsyslog queue to get backed up. This resulted in the requests from the logging tests not getting indexed into Elasticsearch within the expected time. There were 2 main performance issues with Elasticsearch v2 that led to this: 1. Elasticsearch syncs the data to disk on every request in version 2, which hurts indexing performance. We've switched things back v1's mode of performing asynchronous syncs periodically (so we're trading some safety for speed, but that seems okay for this kind of log data). 2. Updating index mappings in Elasticsearch version 2 is more costly. Our mapping is mostly static unless you enable logging of the "request_query" field, which stores all the request query params as a nested object. We have some tests that generate a bunch of unique, random query parameters (mainly for cache busting), but this leads to a deluge of mapping updates since each new query param seen means the mapping needs to be updated. We recently disabled gathering this "request_query" field by default, but it was still enabled in our test suite by default, since we had some existing tests that relied on this functionality. So to solve the performance issues, we've shifted our test suite to disable gathering "request_query" too. This eliminates all the mapping updates during tests. The ability to enabled "request_query" collection still exists, and the existing tests for this functionality have been retained (just in a more isolated fashion that won't impact other tests). However, given the potential performance issues of enabling this, it might be a good reason to get rid of this functionality altogether. While debugging the performance issues, we've also made a couple tweaks and improvements to our rsyslog setup: - The queue.size wasn't configured, so the memory-portion of the queue was capped at 1,000 by default. This meant the configured highwater and lowwater sizes weren't actually being used. Set a higher queue.size to resolve this. - Enable the impstats plugin to output rsyslog queue stats every minute. This seems generally helpful to have in place to be able to see what rsyslog's up to and whether anything is becoming congested with logging. - More comments to explain some of the more cryptic rsyslog configuration settings.
- Loading branch information
Showing
9 changed files
with
434 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.