Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service log rate limiting doesn't work #32745

Open
dtardon opened this issue May 10, 2024 · 4 comments
Open

Service log rate limiting doesn't work #32745

dtardon opened this issue May 10, 2024 · 4 comments

Comments

@dtardon
Copy link
Collaborator

dtardon commented May 10, 2024

systemd version the issue has been seen with

current main (commit b2062ee)

Used distribution

Fedora 38

Linux kernel version used

6.7.9-100.fc38.x86_64

CPU architectures issue was seen on

x86_64

Component

systemd-journald

Expected behaviour you didn't see

Service won't log more than LogRateLimitBurst= messages during a given interval.

Unexpected behaviour you saw

Service logs all messages, regardless of rate-limiting settings.

Steps to reproduce the problem

cat > /tmp/verbose.awk <<EOF
#!/usr/bin/awk
BEGIN {
	i = 1
	for (j = 1; j <= 5; j++) {
		for (k = 1; k <= 50; k++)
			print "Here is startup message #", i++
	}
}
EOF

systemd-run --wait -u reproducer.service -p LogRateLimitBurst=200 -p LogRateLimitIntervalSec=10 awk -f /tmp/verbose.awk
journalctl -u reproducer.service --grep startup | wc -l

Additional program output to the terminal or log subsystem illustrating the issue

No response

@dtardon dtardon added the bug 🐛 Programming errors, that need preferential fixing label May 10, 2024
@bluca
Copy link
Member

bluca commented May 10, 2024

Is this a regression or a pre-existing issue in 255?

@yuwata
Copy link
Member

yuwata commented May 10, 2024

I guess this is expected. See below:

/*
* Example:
*
* <= 1MB = rate * 1
* 16MB = rate * 2
* 256MB = rate * 3
* 4GB = rate * 4
* 64GB = rate * 5
* 1TB = rate * 6
*/

@dtardon
Copy link
Collaborator Author

dtardon commented May 13, 2024

Is this a regression or a pre-existing issue in 255?

No, not a regression.

@dtardon
Copy link
Collaborator Author

dtardon commented May 13, 2024

I guess this is expected. See below:

Hmm... systemd.exec(5) should be improved then, because it describes LogRateLimitBurst= as if it were a hard limit: If, in the time interval defined by LogRateLimitIntervalSec=, more messages than specified in LogRateLimitBurst= are logged by a service, all further messages within the interval are dropped until the interval is over.

@poettering poettering added documentation and removed bug 🐛 Programming errors, that need preferential fixing labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants