Grimble
2022-08-12 09:31:30 UTC
I was interested to see if I could launch a small program at one-second
intervals, so I wrote a small python script to write a two variable row
to a database (timestamp, 10 character string). Not wanting to create
the X.service/X.timer entries in /etc/systemd/, I set up a transient
systemd timer as follows:
systemd-run --timer-property=AccuracySec=1us --on-calendar '*:*:1'
/home/graeme/Software/Python/write1.py
expecting the '*:*:1' string to be interpreted as every second.
However results were very strange:
2022-08-11 15:00:01.04493 | abcdefghij
2022-08-11 15:00:01.04534 | abcdefghij
2022-08-11 15:00:01.045509 | abcdefghij
2022-08-11 15:00:01.046762 | abcdefghij
2022-08-11 15:00:01.047677 | abcdefghij
2022-08-11 15:00:10.040712 | abcdefghij
2022-08-11 15:01:01.044398 | abcdefghij
2022-08-11 15:01:01.044442 | abcdefghij
2022-08-11 15:01:01.045927 | abcdefghij
2022-08-11 15:01:01.045973 | abcdefghij
2022-08-11 15:01:01.046043 | abcdefghij
2022-08-11 15:01:10.041792 | abcdefghij
2022-08-11 15:02:01.045485 | abcdefghij
2022-08-11 15:02:01.045624 | abcdefghij
2022-08-11 15:02:01.045988 | abcdefghij
2022-08-11 15:02:01.047145 | abcdefghij
2022-08-11 15:02:01.048968 | abcdefghij
2022-08-11 15:02:10.042064 | abcdefghij
In other words, 5 firings within a very short time followed by one 10
seconds later. This behaviour was consistent over a 40 hour period.
Over a shorter period, replacing the string with '*:*:10' (?every 10
seconds?) gave
2022-08-11 15:27:01.045152 | abcdefghij
2022-08-11 15:27:01.045541 | abcdefghij
2022-08-11 15:27:01.046604 | abcdefghij
2022-08-11 15:27:01.04555 | abcdefghij
2022-08-11 15:27:01.048399 | abcdefghij
2022-08-11 15:27:10.042014 | abcdefghij
2022-08-11 15:27:10.042807 | abcdefghij
5 firings within 3 millisecs followed by 2 firings
Over a shorter period, replacing the string with '*:1:00' (?every 1
minute?) gave the same results as the '*:*;1' string.
Have I misunderstood the specification of the "on-calendar" parameter?
intervals, so I wrote a small python script to write a two variable row
to a database (timestamp, 10 character string). Not wanting to create
the X.service/X.timer entries in /etc/systemd/, I set up a transient
systemd timer as follows:
systemd-run --timer-property=AccuracySec=1us --on-calendar '*:*:1'
/home/graeme/Software/Python/write1.py
expecting the '*:*:1' string to be interpreted as every second.
However results were very strange:
2022-08-11 15:00:01.04493 | abcdefghij
2022-08-11 15:00:01.04534 | abcdefghij
2022-08-11 15:00:01.045509 | abcdefghij
2022-08-11 15:00:01.046762 | abcdefghij
2022-08-11 15:00:01.047677 | abcdefghij
2022-08-11 15:00:10.040712 | abcdefghij
2022-08-11 15:01:01.044398 | abcdefghij
2022-08-11 15:01:01.044442 | abcdefghij
2022-08-11 15:01:01.045927 | abcdefghij
2022-08-11 15:01:01.045973 | abcdefghij
2022-08-11 15:01:01.046043 | abcdefghij
2022-08-11 15:01:10.041792 | abcdefghij
2022-08-11 15:02:01.045485 | abcdefghij
2022-08-11 15:02:01.045624 | abcdefghij
2022-08-11 15:02:01.045988 | abcdefghij
2022-08-11 15:02:01.047145 | abcdefghij
2022-08-11 15:02:01.048968 | abcdefghij
2022-08-11 15:02:10.042064 | abcdefghij
In other words, 5 firings within a very short time followed by one 10
seconds later. This behaviour was consistent over a 40 hour period.
Over a shorter period, replacing the string with '*:*:10' (?every 10
seconds?) gave
2022-08-11 15:27:01.045152 | abcdefghij
2022-08-11 15:27:01.045541 | abcdefghij
2022-08-11 15:27:01.046604 | abcdefghij
2022-08-11 15:27:01.04555 | abcdefghij
2022-08-11 15:27:01.048399 | abcdefghij
2022-08-11 15:27:10.042014 | abcdefghij
2022-08-11 15:27:10.042807 | abcdefghij
5 firings within 3 millisecs followed by 2 firings
Over a shorter period, replacing the string with '*:1:00' (?every 1
minute?) gave the same results as the '*:*;1' string.
Have I misunderstood the specification of the "on-calendar" parameter?
--
Grimble
Machine 'Haydn' running Plasma 5.20.4 on 5.15.58-desktop-2.mga8 kernel.
Mageia release 8 (Official) for x86_64
Grimble
Machine 'Haydn' running Plasma 5.20.4 on 5.15.58-desktop-2.mga8 kernel.
Mageia release 8 (Official) for x86_64