Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High speed scan on Ubuntu/Debian #172

Merged
merged 1 commit into from
Sep 12, 2016
Merged

High speed scan on Ubuntu/Debian #172

merged 1 commit into from
Sep 12, 2016

Conversation

kotakanbe
Copy link
Member

@kotakanbe kotakanbe commented Sep 9, 2016

Add -cache-dbpath option to scan subcommand.
The default path of -cache-dbpath is $PWD/cache.db

Changelog cache

Vuls parses changelogs of updatable packages in the case of a target server is Ubuntu/Debian.
To get the changelog, Vuls issue apt-get changelog for each updatable packages.
Scan speed on Ubuntu/Debian was slow because apt-get changelog is slow.
So I decided to use boltdb for caching changelogs of updatable packages.
botldb: https://github.com/boltdb/bolt

apt-get policy

apt-get policy is a slow operation.
Previously Vuls issues apt-cache policy for each updatable package.
Now Vuls issues the command only once.

Scan time

20 TIMES FASTER on Ubuntu16.04

On Ubuntu 16.04 server that has 95 updatable packages.
Before ... 3min10s
After(1st) ... 1min50s (without local cache)
After(2nd) ... 10s (with local cache)

4 TIMES FASTER on Debian8

On Debian8 server that has 34 updatable packages.
Before ... 5min
After(1st) ... 3m40s (without local cache)
After (2nd) ... 1m20s (with local cahce)

@kotakanbe kotakanbe force-pushed the ubuntu_bakusoku branch 7 times, most recently from 6ce6d39 to f2a126c Compare September 12, 2016 12:09
@kotakanbe kotakanbe changed the title [WIP]High speed scan using local cache of changelog on Ubuntu/Debian [WIP]High speed scan on Ubuntu/Debian Sep 12, 2016
@kotakanbe kotakanbe changed the title [WIP]High speed scan on Ubuntu/Debian High speed scan on Ubuntu/Debian Sep 12, 2016
@kotakanbe kotakanbe merged commit a2a6973 into master Sep 12, 2016
@kotakanbe kotakanbe deleted the ubuntu_bakusoku branch September 15, 2016 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant