Repository navigation
Closed
Labels
#g-supply-chainSupply Chain product group:loadtestIssue that requires a loadtestbugSomething isn't working as documented~old bugBug has been open over 180 days~software-ingestionIssue regarding ingesting software inventory from a host into Fleet.~vulnerability-management
Milestone
Description
Fleet version: 4.71.1, but probably goes back a ways
Web browser and operating system: n/a
💥 Actual behavior
The "OVAL analyze" step in vulns processing is taking many hours.
Some output from a loadtest env:
{
"cron": "vulnerabilities",
"elapsed": "8h35m29.646716954s",
"found new": 0,
"level": "debug",
"msg": "oval-analysis-done",
"platform": "Ubuntu 22.04.1 LTS",
"ts": "2025-08-12T10:41:08.827728475Z"
}Env details:
- 45k hosts, all Linux (Ubuntu 22.04)
- 42k software
- Default settings for Fleet server, RDS, and Redis
- Note: no dedicated vulns processing job
🛠️ To fix
- Investigate where in the processing job we could optimize code to get a speedup
Product designer: _________________________
🧑💻 Steps to reproduce
- Start a loadtest env as specified above
- Run vulns processing
- Note that the job takes hours to complete, if it completes at all
🕯️ More info (optional)
N/A
QA
Note: There is a non-deterministic CPE issue #39899 and another issue #39898 that may impact results.
Try in loadtest. And also:
Goal
Verify that the optimized branch produces identical CPE and CVE results as main.
Maybe @mostlikelee has a better QA flow, but this is what @getvictor did.
Steps
1. Create a test database clone
mysqldump --protocol=tcp -h 127.0.0.1 -P 3306 -u root -ptoor fleet > /tmp/fleet_dump.sql
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u root -ptoor -e "
DROP DATABASE IF EXISTS fleet_vuln_test;
CREATE DATABASE fleet_vuln_test;
GRANT ALL ON fleet_vuln_test.* TO 'fleet'@'%';
"
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u root -ptoor fleet_vuln_test < /tmp/fleet_dump.sql2. Clear vulnerability tables
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test -e "
TRUNCATE software_cpe;
TRUNCATE software_cve;
TRUNCATE operating_system_vulnerabilities;
"3. Build and run with main (baseline)
git worktree add /tmp/fleet-main main
cd /tmp/fleet-main && go build -o /tmp/fleet-main-bin ./cmd/fleet/
cd -
FLEET_MYSQL_DATABASE=fleet_vuln_test \
FLEET_VULNERABILITIES_DATABASES_PATH=/tmp/vulndbs \
FLEET_VULNERABILITIES_DISABLE_DATA_SYNC=true \
FLEET_LOGGING_TRACING_ENABLED=false \
FLEET_LOGGING_OTEL_LOGS_ENABLED=false \
/tmp/fleet-main-bin vuln_processing --devThis may take 30-60+ minutes on a large dataset.
4. Dump baseline results
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT software_id, cpe FROM software_cpe ORDER BY software_id, cpe" \
> /tmp/baseline_cpe.tsv
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT software_id, cve, source, IFNULL(resolved_in_version,'') FROM software_cve ORDER BY software_id, cve, source" \
> /tmp/baseline_cve.tsv
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT operating_system_id, cve, source FROM operating_system_vulnerabilities ORDER BY operating_system_id, cve, source" \
> /tmp/baseline_os_vuln.tsv5. Clear vulnerability tables again
Same as step 2.
6. Build and run with the branch (optimized)
# from the repo root on the feature branch
go build -o /tmp/fleet-branch-bin ./cmd/fleet/
FLEET_MYSQL_DATABASE=fleet_vuln_test \
FLEET_VULNERABILITIES_DATABASES_PATH=/tmp/vulndbs \
FLEET_VULNERABILITIES_DISABLE_DATA_SYNC=true \
FLEET_LOGGING_TRACING_ENABLED=false \
FLEET_LOGGING_OTEL_LOGS_ENABLED=false \
/tmp/fleet-branch-bin vuln_processing --dev7. Dump optimized results
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT software_id, cpe FROM software_cpe ORDER BY software_id, cpe" \
> /tmp/optimized_cpe.tsv
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT software_id, cve, source, IFNULL(resolved_in_version,'') FROM software_cve ORDER BY software_id, cve, source" \
> /tmp/optimized_cve.tsv
mysql --protocol=tcp -h 127.0.0.1 -P 3306 -u fleet -pinsecure fleet_vuln_test \
-e "SELECT operating_system_id, cve, source FROM operating_system_vulnerabilities ORDER BY operating_system_id, cve, source" \
> /tmp/optimized_os_vuln.tsv8. Compare
diff /tmp/baseline_cpe.tsv /tmp/optimized_cpe.tsv
diff /tmp/baseline_cve.tsv /tmp/optimized_cve.tsv
diff /tmp/baseline_os_vuln.tsv /tmp/optimized_os_vuln.tsvMetadata
Metadata
Assignees
Labels
#g-supply-chainSupply Chain product group:loadtestIssue that requires a loadtestbugSomething isn't working as documented~old bugBug has been open over 180 days~software-ingestionIssue regarding ingesting software inventory from a host into Fleet.~vulnerability-management
Type
Projects
- StatusShow more project fieldsDone
Activity
getvictor commentedon Oct 9, 2025
Timebox to 3. Hopefully, there is an obvious inefficiency.
getvictor commentedon Oct 31, 2025
I've seen vulnerabilities job take over 11 hours, but it seemed due to infra issues, which eventually resolved themselves. From recent load test:
14 remaining items
Vulnerabilities cron optimization (#39820)
[-]Linux vulnerability processing takes multiple hours at scale[/-][+]Vulnerability processing takes multiple hours at scale[/+]AndreyKizimenko commentedon Mar 5, 2026
QA notes
Migration loadtest
The first vuln run was scheduled on 4.81 the following ones were on 4.82
4.82 is ~65% faster
Baseline loadtest
fleet-release commentedon Mar 12, 2026
Vuln processing slow,
Optimized code, like wind flow,
Hours to minutes grow.