Skip to content

Commit f015925

Browse files
committed
ft-orchestration jq.py use parallel with --linebuffer and prevent ram exhaustion
1 parent 181144a commit f015925

File tree

1 file changed

+1
-2
lines changed
  • tools/ft-orchestration/src/collector

1 file changed

+1
-2
lines changed

tools/ft-orchestration/src/collector/jq.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, executor: Executor, file: str):
121121
EOF
122122
123123
ipfixcol2 -c {Path(self._conf_dir, self.CONFIG_FILE)} |
124-
parallel --pipe --block 10M --recend "}}" --recstart "{{" -j 0 -- jq -r -f "$file"
124+
parallel --pipe --recend '\n' --line-buffer --memfree 6G -L 200K --retries 0 -j 100% -- jq -r -f "$file"
125125
"""
126126
# Reads fds file and outputs json with ipfixcol2, then converts json with jq to csv.
127127
# In the csv output the IPv4/IPv6 addresses are merged to source/destinationIPAddress.
@@ -351,4 +351,3 @@ def save_csv(csv_file: str):
351351
except Exception: # noqa: BLE001 - best-effort cleanup
352352
pass
353353
logging.getLogger().info("CSV output saved in %.2f seconds.", (end - start))
354-
logging.getLogger().info("CSV output saved in %.2f seconds.", (end - start))

0 commit comments

Comments
 (0)