0
0
Kafkadevops~10 mins

Disk I/O optimization in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the log segment size to 1 GB for better disk I/O performance.

Kafka
props.put("log.segment.bytes", [1]);
Drag options to blanks, or click blank then click option'
A2048
B1048576
C512000
D1073741824
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1048576 which is 1 MB instead of 1 GB.
Using too small values causing frequent segment rollovers.
2fill in blank
medium

Complete the code to enable log preallocation to improve disk write performance.

Kafka
props.put("log.preallocate", [1]);
Drag options to blanks, or click blank then click option'
A"false"
B"true"
C"auto"
D"enabled"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "false" disables preallocation, reducing performance benefits.
Using invalid strings like "auto" or "enabled" which are not accepted.
3fill in blank
hard

Fix the error in the code to correctly configure the flush interval to 5000 milliseconds.

Kafka
props.put("log.flush.interval.ms", [1]);
Drag options to blanks, or click blank then click option'
A5000
B5
C"5000"
D"five thousand"
Attempts:
3 left
💡 Hint
Common Mistakes
Using an integer without quotes causes a type error.
Using words instead of numeric strings.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that sets log retention to 7 days and segment bytes to 1 GB.

Kafka
config = {"log.retention.hours": [1], "log.segment.bytes": [2]
Drag options to blanks, or click blank then click option'
A"168"
B"604800000"
C1073741824
D168
Attempts:
3 left
💡 Hint
Common Mistakes
Using retention as integer instead of string.
Using incorrect byte size for segment bytes.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that sets flush interval to 1000 ms, enables preallocation, and sets segment bytes to 512 MB.

Kafka
config = {"log.flush.interval.ms": [1], "log.preallocate": [2], "log.segment.bytes": [3]
Drag options to blanks, or click blank then click option'
A"1000"
B"true"
C536870912
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer 1000 instead of string "1000" for flush interval.
Using "false" instead of "true" for preallocation.
Incorrect byte size for 512 MB.