shift cron.daily / logrorate timer

Bug #2028130 reported by Junien F
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Mirror Charm
Fix Released
High
Ivan

Bug Description

The archive servers see connections spikes with the following patterns :
- every hour, at :00 ("hourly" systemd timer, "0 X * * *" cron jobs) and :17 (cron.hourly)
- every day at 00:00 ("daily" systemd timer, which adds to the "hourly" timer)
- every day at 06:25 (cron.daily)

And generally, traffic is higher during EMEA and AMER day, and lower during APAC day.

We should try to make the archive servers as idle as possible during high usage hours, I would suggest updating logrotate.timer and cron.daily (in /etc/crontab) to start at 04:30 UTC.

Thanks

Related branches

Revision history for this message
Tom Haddon (mthaddon) wrote :

logrotate.timer is:

```
$ sudo systemctl cat logrotate.timer
# /lib/systemd/system/logrotate.timer
[Unit]
Description=Daily rotation of log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true

[Install]
WantedBy=timers.target
```

This should be amended via systemd override.

Revision history for this message
Junien F (axino) wrote :

logrotate.timer has AccuracySec=1h, but I'm seeing it always happen really near 00:00, which if I'm

ubuntu@prod-archive-servers-1:~$ journalctl -b -u logrotate.service|grep Starting
Jul 12 00:00:13 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 13 00:00:18 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 14 00:00:24 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 15 00:00:03 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 16 00:00:01 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 17 00:00:08 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 18 00:00:01 prod-archive-servers-1 systemd[1]: Starting Rotate log files...
Jul 19 00:00:01 prod-archive-servers-1 systemd[1]: Starting Rotate log files...

ubuntu@prod-archive-servers-2:~$ journalctl -b -u logrotate.service|grep Starting
Jul 12 00:00:03 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 13 00:00:03 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 14 00:00:03 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 15 00:00:01 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 16 00:00:01 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 17 00:00:03 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 18 00:00:01 prod-archive-servers-2 systemd[1]: Starting Rotate log files...
Jul 19 00:00:01 prod-archive-servers-2 systemd[1]: Starting Rotate log files...

ubuntu@prod-archive-servers-3:~$ journalctl -b -u logrotate.service|grep Starting
Jul 12 00:00:06 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 13 00:00:13 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 14 00:00:07 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 15 00:00:02 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 16 00:00:01 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 17 00:00:00 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 18 00:00:08 prod-archive-servers-3 systemd[1]: Starting Rotate log files...
Jul 19 00:00:09 prod-archive-servers-3 systemd[1]: Starting Rotate log files...

Revision history for this message
Junien F (axino) wrote :

The following cowboy has been installed on the production archive servers running jammy :

$ cat /etc/systemd/system/logrotate.timer.d/override.conf
[Timer]
OnCalendar=
OnCalendar=*-*-* 04:30:00
AccuracySec=1min

Revision history for this message
Paul Collins (pjdc) wrote :

I'd recommend not calling the override file the charm adds override.conf, though, since that's the default for systemctl edit and I've seen cases where it gets stomped on in haste.

Ivan (ivaneloff)
Changed in ubuntu-mirror-charm:
status: New → In Progress
assignee: nobody → Ivan (ivaneloff)
Haw Loeung (hloeung)
Changed in ubuntu-mirror-charm:
importance: Undecided → High
Ivan (ivaneloff)
Changed in ubuntu-mirror-charm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.