Skip to content

Run Checkov scanners one at a time - #63

Merged
lolgab merged 1 commit into
masterfrom
checkov-sequential
Dec 3, 2026
Merged

lolgab merged 1 commit into
masterfrom
checkov-sequential

Conversation

@lolgab

@lolgab lolgab commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Checkov runs out of memory on larger IaC repos. The pod has a memory limit but no CPU limit, so Checkov sizes its process pools by the node's core count and forks one process per scanner (about 28) at the same time. Part of TAR-276.

  • The wrapper defaults CHECKOV_PARALLELIZATION_TYPE to none, so Checkov runs its scanners, and the parsing inside each one, in a single process one after another.
  • Peak memory stays near the largest single scanner instead of the sum of all of them. The cost is run time on the largest repos.
  • It uses setdefault, so an environment that sets the variable keeps its value.

This is the scanner-ordering part of #62, shipped on its own so it doesn't wait for framework selection and the timeout fix. The memory and run-time numbers are in #62's benchmark. #62 will need a trivial rebase, since it adds the same line.

Same class of fix as codacy/codacy-opengrep#50.

  • 7 days after deploy: Checkov ToolOutOfMemory count, compared with the 7 days before
  • 7 days after deploy: Checkov run-time p99 and timeouts, compared with the 7 days before

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@lolgab
lolgab marked this pull request as ready for review December 3, 2026 10:51

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

✅ No blocking issues noticed

No blocking findings were identified.

Test suggestions

  • Verify the default environment sets CHECKOV_PARALLELIZATION_TYPE to none when it is unset.
  • Verify an existing CHECKOV_PARALLELIZATION_TYPE value is preserved.
  • Verify Checkov is invoked with the configured environment containing the parallelization setting.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the default environment sets CHECKOV_PARALLELIZATION_TYPE to none when it is unset.
2. Verify an existing CHECKOV_PARALLELIZATION_TYPE value is preserved.
3. Verify Checkov is invoked with the configured environment containing the parallelization setting.

TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback

@lolgab
lolgab enabled auto-merge (squash) December 3, 2026 10:51
@lolgab
lolgab merged commit c80d54f into master Dec 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants