QuestionQ122

VerifiedCost & Performance Optimisation

A Structured Streaming job running in production has experienced delays during the day’s peak hours. Currently, in normal operation, each data micro-batch is processed in under 3 seconds. During peak hours, the execution time of each micro-batch becomes highly variable and sometimes exceeds 30 seconds. The streaming write currently uses a 10-second trigger interval.

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

Explanation

A shorter processing-time trigger checks for arriving data more frequently, which can prevent peak-hour records from accumulating into large micro-batches. Smaller batches can reduce spill and execution-time variability, helping keep record processing below the required latency. Structured Streaming processing-time triggers run micro-batches periodically; a missed trigger runs immediately after the preceding batch completes, rather than concurrently with it.

Learn more

Community Discussion

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