Repository navigation
Increase rate limiting in journald.conf - #3753
Conversation
|
https://bugzilla.redhat.com/show_bug.cgi?id=1380458 much discussion on this topic in this BZ |
| line: "{{ item.line }}" | ||
| with_items: | ||
| - { regexp: '^.*RateLimitInterval.*$', line: 'RateLimitInterval=1s' } | ||
| - { regexp: '^.*RateLimitBurst.*$', line: 'RateLimitBurst=10000' } |
There was a problem hiding this comment.
- { regexp: '^RateLimitBurst=.*$', line: 'RateLimitBurst=10000' }would be more conservative?
What if the existing values were already higher than the ones we're setting? This could have an unintended effect of doing the opposite of what the task name says.
There was a problem hiding this comment.
'^RateLimitBurst=.*$'
Isn't good enough, because that line might be commented out, but in that case I could add \#?. The remaining part is a good point, lemme think about the right approach to fix it.
|
So, normal logging default is 33/sec per service. We're cramming up to 1000 pods + node + docker into a single service. So should we go to 33333/sec to provide the same level of service that default logging would provide if they were all split out? |
|
I've made the regexp more strict and fixed the travis failure. I'm not sure about that 33333/sec. Let's start with this setting and we'll increase more if needed. My ansible-foo isn't good enough to do the conditional change, sorry @rhcarvalho. I hope other stuff can be fixed as a followup. |
|
Here's my concern. ANY global rate limiting potentially breaks end user apps that expect to get logs. NO global rate limiting potentially breaks the node. Administrators need to make a choice. The correct behavior would be that rate limiting is not global - journald is not in the correct position to determine rate limits, nor should logging from one container have anything to do with logging in another container. The upstream Kubernetes direction on this is pretty clear - each container is going to log to its own rate limited devices. That means separation of responsibilities from host logging - containers shouldn't be able to blow up host logs and vice versa, nor should containers be able to DOS other containers. We need to get to a place where host logging != container logging as fast as possible. We need the rate limits on the containers to be separate from the host rate limits. We still need limits - but the limit should penalize the app, not vice versa. |
|
Since rate limits are per service, the best we can do is increase Docker's rate limit a reasonable multiple of the expected volume. |
|
We need to get the containers team and the logging team to present a unified plan forward here - @jcantrill and @rhatdan are the ones who can help coordinate. |
| regexp: "{{ item.regexp }}" | ||
| line: "{{ item.line }}" | ||
| with_items: | ||
| - { regexp: '^#?RateLimitInterval=.*$', line: 'RateLimitInterval=1s' } |
There was a problem hiding this comment.
Are we also using persistent volumes? We have the potential to rapidly grow /run/log/journal to the default 4GB limit. May not be desirable.
|
There are only so many pipes for data to flow on a box. At some point, no matter how isolated the rate-limits may be for an app, its logging rate, or the combined logging rate of all the apps, can affect the system. Having individual rates is great, but it is going to be very hard to get that balance right to cover most situations so that host logging is not affected by app logging. Before that, though, don't we need to stop using With a configuration that properly curates the on-disk journal files to a reasonable size and retention policy, using on-disk storage for logs will prevent large memory use of |
|
The fact that these are all under the same journald service is the primary
problem. If we can improve the logging driver to that point, most of the
immediate problem goes away.
Nodes should be logging to disk by default for sure. However, the quota
needs to be per pod, not shared.
…On Thu, Mar 23, 2017 at 10:50 PM, Peter Portante ***@***.***> wrote:
There are only so many pipes for data to flow on a box. At some point, no
matter how isolated the rate-limits may be for an app, its logging rate, or
the combined logging rate of all the apps, can affect the system. Having
individual rates is great, but it is going to be very hard to get that
balance right to cover most situations so that host logging is not affected
by app logging.
Before that, though, don't we need to stop using /run/log/journal (tmpfs)
and start using /var/log/journal (on-disk)?
With a configuration that properly curates the on-disk journal files to a
reasonable size and retention policy, using on-disk storage for logs will
prevent large memory use of /run, while giving us the ability to review
the host logs for debugging on a crash; something like:
[Journal]
Storage=permanent
Compress=yes
# journald will fsync() once a second to persist logs to disk
SyncIntervalSec=1s
# applies to each logging entity, not to all logs flowing through journald
RateLimitInterval=1s
RateLimitBurst=40000
# Only keep 4GB of logs max
SystemMaxUse=4G
# ... but only if there is 40 GB of free disk space
SystemKeepFree=40G
# Store journal files up to 10 MB each so that when rotated, we don't lose too big of a time period of logs.
SystemMaxFileSize=10M
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3753 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p4jPjueMKKfCWxMkKua4B8au9C7yks5roy9sgaJpZM4Mm4hx>
.
|
|
Regarding quota per pod, agreed. Let's solve the logging to disk first. Perhaps see if could have two instances of journald running, one that listens to If the kubernetes logging path would consider including the metadata lost by NOT using journald, that might be sufficient. |
|
And, when we start persisting logs to disk via journald, we should turn off rsyslog if it is on and persisting logs to disk as well. |
If so, will need to ensure that fluentd is configured to use journald as input, because no /var/log/messages any more. Also want to make sure that customer is aware that other services provided by rsyslog by default will no longer be available: |
|
The alternative fix for the persistent logs issue could be never log to files or journald from containers and disable it for docker daemon as well. Instead, follow 12factor apps best practices:
This would remove a lots of "old school issues" and moving parts, like rate limiting, rotation et al. |
IIUC, this is already the case. Contained processes write to stdout/stderr, but then we need to do something with those streams, that's where journald or another solution plugs in. |
|
@bogdando, does factor 11 of the 12 Factor App say an app should only write to It seems that the 12 Factor App is about keeping the app writers concerns separate from the scaffolding of the environment in which the app runs. Would you agree?
The 11th Factor seems to acknowledge that an app has other events streams flowing from it in production environments, as it mentions "In staging or production deploys, each process’ stream will be captured by the execution environment, collated together with all other streams from the app, and routed to one or more final destinations for viewing and long-term archival." So it does not seem the 11th Factors directs us in a different path here. Finally, if we don't use docker's It would seem our best bet is to invest in |
| regexp: "{{ item.regexp }}" | ||
| line: "{{ item.line }}" | ||
| with_items: | ||
| - { regexp: '^#?RateLimitInterval=.*$', line: 'RateLimitInterval=1s' } |
| line: "{{ item.line }}" | ||
| with_items: | ||
| - { regexp: '^#?RateLimitInterval=.*$', line: 'RateLimitInterval=1s' } | ||
| - { regexp: '^#?RateLimitBurst=.*$', line: 'RateLimitBurst=10000' } |
There was a problem hiding this comment.
Also, this hardcodes the rate we want to be 10,000 log entries a second. It would be best if the user could deploy and update this setting with a value they can configure to accommodate their needs. In the future 10,000/s might be too small, while in other scenarios 10,000/s might be too large.
There was a problem hiding this comment.
I don't see any problems making it more configurable, I've opened this PR to have a discussion happening, since I've stumbled on this problem.
|
@portante @rhcarvalho You're right, either journald, or syslog, or fluentd et al for docker daemon would 100% fit the manifesto for its workloads: "A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout". I was thinking of the docker daemon as a part of the application stack. Because of the shared local host placement with its workloads, it can not be scaled well, and the rate limiting issue confirms that, I'm afraid. The next issue to arise shortly after that might stand for cgroups not handling the limits, and more fun. So my previous comment was badly written, perhaps I should've written it as: Only non local to workloads logs processing solutions would make it to scale well and journald is not the case, unless it can be configured as a dummy logs shipper, like if being told: "please use no rate limiting, no logs rotation, no persistence, nothing, just ship the logs to a given network endpoint." |
|
I'd like an option to disable rate limiting on the docker daemon. We would use that in specific clusters. I'm fine with higher limits, but the disable is what we need right now to get back to working. I'd like a fix for this in soon so we can kill these flakes. Having the option to selectively disable rate limiting on docker journald is the minimum requirement to address openshift/origin-ci-tool#133 |
|
Let's push this forward so we can turn it on in CI |
|
What are we going to do about the persistence question? |
|
cc @pweil- |
|
@portante With regards to storage, are we not at the mercy of what's available on disk for the host? I don't believe journal runs in a container so there is no persistent volume to be configured. |
|
aos-ci-test |
|
@jcantrill yes, we are at the mercy of what's available on the host. When persistence is enabled in journald, it will by default use In addition, see man journald.conf(5), specifically the discussion around |
|
@richm Are you saying we still have open questions regarding persistence or can we merge this PR? |
|
[test] |
|
Evaluated for openshift ansible test up to f827350 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_openshift_ansible/662/) (Base Commit: 581d5d2) (PR Branch Commit: f827350) |
|
The failures in |
|
Yes, but since this isn't addressing a blocker bug I'd prefer waiting until Monday when the branch opens up. |
|
@sdodson it is addressing a significant flake to our merge queue, where we fail because of missing data in journald. @smarterclayton any objections for merging this asap? |
|
openshift/origin#14785 for reference |
|
/test |
|
The error doesn't look like it's related to this PR. It was reported long time ago (openshift/origin#9624 and openshift/origin#7291) and closed due to inactivity. So it might be F25 specific issue. |
|
/lgtm |
|
/test all |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
Automatic merge from submit-queue |
|
The first time running the install since this merged it failed to restart journald on my host and I got the following in my logs. By the time I looked at the host it had started successfully but the playbook run failed. |
|
I did a bit of googling and it looks like there are 2 required actions for this to work properly:
I think we're failing the 2nd step. Let's sync when you're online. |
| register: journald_conf_file | ||
|
|
||
| - name: Update journald setup | ||
| replace: |
There was a problem hiding this comment.
Nice timing, @soltysh I was just looking into this problem in my env.
Would it have been more clean to drop a templated file into /etc/systemd/journald.conf.d instead?
There was a problem hiding this comment.
@dlbewley Yeah, that's probably a nice improvement. PR for that ? :-) Given this just merged I wouldn't worry about attempting to migrate anyone from how this PR modified things to the dropin file
There was a problem hiding this comment.
Other drop ins we've named 'openshift-ansible.conf' FWIW
There was a problem hiding this comment.
i noticed that in dnsmasq.d, @sdodson i'll try to find some time to do that PR. don't hold your breath :)
Automatic merge from submit-queue (batch tested with PRs 17217, 17597, 17606). Remove journald limits @mfojtik this is dropping the hacks we had in place to tweak journald, now that ansible is doing it (openshift/openshift-ansible#3753 and openshift/openshift-ansible#5796). I'm additionally bringing back the deployments e2e's that were suffering from it. Let's see how far we can go with it. /cc @tnozicka Fixes #14785
@sdodson ptal, this is to address issues from openshift/origin#12558
@smarterclayton @stevekuznetsov fyi