Our team is proud to introduce a new pg_timetable v5.3 release!
This time we focused solely on implementing new features for logging.
pg_timetable new feature – disable database logging
The first new cool feature we’ve added to pg_timetable v5.3 release is the opportunity to disable sending logs to the
We knew pg_timetable used a lot in high-load environments but never met the workloads where chains scheduled to fire every (sic!) second! It turns out such a workload can easily produce 10Gb of WALs in a day! One possible solution would be to change the
timetable.log definition to
ALTER TABLE timetable.log SET UNLOGGED;
Of course, you should also monitor table bloat and truncate it effectively.
Another approach is to output session logs to the local file only, while at the same time disabling database logging. Precisely in order to achieve this, we’ve added a new
--log-database-level=none command line and configuration option. It will altogether disable the session logging. However, the execution logging (tasks output and return codes) is still active and cannot be disabled. If you are experiencing bloating because of tasks output, I recommend piping the output to the
/dev/null or a local file. This situation applies only to
PROGRAM tasks since
SQL tasks are not wordy.
pg_timetable new feature – implement log rotation
Previously we had only two options to control file logging:
--log-file= File name to store logs --log-file-format=[json|text] Format of file logs (default: json)
🔔 To enable file logging, you must specify the
--log-file parameter! Otherwise, only database logging is on.
In this release, we added four more:
--log-file-rotate Rotate log files --log-file-size= Maximum size in MB of the log file before it gets rotated (default: 100) --log-file-age= Number of days to retain old log files, 0 means forever (default: 0) --log-file-number= Maximum number of old log files to retain, 0 to retain all (default: 0)
They are pretty straightforward, but let me stress some notes:
- You need to pass
--log-file-rotateto enable log rotation. Otherwise, pg_timetable will ignore all other configurations.
- Every log file produced will be the size of
--log-file-sizeat maximum. The current file will always have the
--log-filename, while the rotated one will always contain a timestamp in its name. Rule of thumb: only rotated (old) log files contain timestamps in the name.
- You can store log files forever. That’s the default. Or you can clean old log files after
--log-file-agedays of retention.
- The same as above but applied to the number of files to retain. For example, if you only want the last ten log files, start pg_timetable with
The full changelog is available on the v5.3 release page. We want to thank all contributors and users for their help.
If you want to contribute to pg_timetable and help to make it better:
- ⭐give a star to the project,
- feel free to open an 🤚issue and ask a 🎓question
- or even consider submitting a 📜pull request.