QuestionQ177

VerifiedCost & Performance Optimisation

A Structured Streaming job running in production has experienced delays during peak hours of the day. Currently, during normal execution, each microbatch of data is processed in under 3 seconds. During peak hours, the execution time of each microbatch becomes highly inconsistent, sometimes exceeding 30 seconds. The streaming write is presently configured with a trigger interval of 10 seconds.

Holding all other variables constant and assuming records must be processed in less than 10 seconds, which adjustment will satisfy the requirement?

Explanation

A fixed-interval Structured Streaming query cannot run overlapping microbatches; when a microbatch takes longer than its trigger interval, the next microbatch starts only after the prior one finishes. Reducing the interval to 5 seconds can limit peak input per microbatch, reducing the likelihood of backlog and oversized batches that spill, thereby helping keep record processing below 10 seconds.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!