Skip to content

Instantly share code, notes, and snippets.

@froop
Last active January 20, 2022 21:46
Show Gist options
  • Save froop/fee2c1a4eafb09fa00b929bb81b81725 to your computer and use it in GitHub Desktop.
Save froop/fee2c1a4eafb09fa00b929bb81b81725 to your computer and use it in GitHub Desktop.
[Python] syslog負荷テスト
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