Every shard of Simple Log Service triggers the function when new data is written. Therefore, the trigger frequency includes the number of times that a Logstore is triggered as a whole. In addition, when the trigger is delayed, data catchup occurs, which may shorten the trigger interval of triggers.
Problem description
The execution frequency of a Simple Log Service trigger is sometimes higher than the expected trigger frequency.
Possible causes
Each shard is triggered independently. Although you may observe a high total number of triggers for a Logstore, the real-time trigger interval for each shard matches the specified interval.
The trigger interval for a single shard corresponds to the timestamp range of the data processed in each execution. During function execution, two scenarios can occur. For example, assume the trigger interval is 60 seconds.
No trigger delay: The function is triggered at the specified interval. It triggers once every 60 seconds and processes data within the timestamp range of
[now - 60 s, now).Note
Function triggers are independent for each shard. For example, if a Logstore has 10 shards and processes data in real-time with no trigger delay, 10 function executions are triggered every 60 seconds.
Trigger delay: A delay occurs if the current processing position of a Simple Log Service shard is more than 10 seconds behind the most recently written data. The trigger then starts a catch-up process for the data. This process can shorten the trigger interval to as little as 2 seconds, but the timestamp range for each execution remains a 60-second window.