diff --git a/ebpf-run.sh b/ebpf-run.sh index a85566c..12c8d4e 100644 --- a/ebpf-run.sh +++ b/ebpf-run.sh @@ -24,10 +24,25 @@ fi while : do -if [[ "${ENABLE_LOGS}" == "false" ]]; then - ./ebpf-logging >> "$LOG_FILE" 2>&1 -else - ./ebpf-logging -fi + # Start the mirroring module in the background + if [[ "${ENABLE_LOGS}" == "false" ]]; then + ./ebpf-logging >> "$LOG_FILE" 2>&1 & + else + ./ebpf-logging & + fi + mirroring_pid=$! + + # Monitor the process for 1 hour + elapsed=0 + while [ $elapsed -lt 600 ]; do + if ! kill -0 $mirroring_pid 2>/dev/null; then + break + fi + sleep 2 + elapsed=$((elapsed + 2)) + done + + # Kill the mirroring process after 1 hour or if it stopped + kill $mirroring_pid 2>/dev/null sleep 2 done diff --git a/trafficUtil/kafkaUtil/kafka.go b/trafficUtil/kafkaUtil/kafka.go index 979b72e..9c91aad 100644 --- a/trafficUtil/kafkaUtil/kafka.go +++ b/trafficUtil/kafkaUtil/kafka.go @@ -306,7 +306,7 @@ func getKafkaWriter(kafkaURL string, batchSize int, batchTimeout time.Duration) WriteTimeout: batchTimeout, Async: true, Balancer: &kafka.Hash{}, - Compression: kafka.Zstd, + Compression: kafka.Lz4, } if useTLS {