Last active
January 20, 2022 21:46
-
-
Save froop/fee2c1a4eafb09fa00b929bb81b81725 to your computer and use it in GitHub Desktop.
[Python] syslog負荷テスト
This file contains hidden or 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
import syslog | |
import time | |
import datetime | |
for i in range(100000): | |
time.sleep(0.005) | |
message = '%010d %s' % (i, datetime.datetime.now().time()) | |
syslog.syslog(message) | |
''' | |
CentOS7の場合、ログ出力制限解除 | |
デフォルトだと短時間に1500メッセージ程あるとそれ以降は捨てられてしまう。 | |
下記設定を無制限に変更。 | |
/etc/rsyslog.conf | |
$imjournalRatelimitInterval 0 | |
/etc/systemd/journald.conf | |
RateLimitInterval=0 | |
systemctl restart rsyslog | |
systemctl restart systemd-journald | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment