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

fuzz: H1 capture fuzz test performance improvements. #10281

Merged
merged 1 commit into from
Mar 8, 2020

Commits on Mar 6, 2020

  1. fuzz: H1 capture fuzz test performance improvements.

    The main contribution in this patch is a "persistent" mode for
    h1_capture_[direct_response_]fuzz_test. Based on profiling observations, we were spending 30-40% of
    time rebuilding the Envoy server on each run. This is avoided by having fuzzer variants that makes
    the integration test proxy static.
    
    There is a downside of this approach, since different fuzz invocations may interfere with each
    other. Ideally we would snapshot/fork for each fuzz invocation, but Envoy doesn't like forking once
    events/dispatchers are up. So, for now we have two builds of the fuzzer, where we trade fuzz engine
    efficacy for fuzz target performance. Some form of VM snapshotting would be ideal.
    
    The persistent mode takes the H1 replay tests to O(10 exec/s) from O(1 exec/s). This is still not
    great. Doing some perf analysis, it seems that we're spending the bulk of time in ASAN. Running
    the fuzzers without ASAN gives O(100 exec/s), which seems reasonable for a LPM-style integration test.
    It's future work why ASAN is so expensive, ASAN advertises itself as generally a 2x slowdown. There
    is also some secondary effect from the cost of mocks used in the integration test TCP client (mock
    watermark buffer), this speaks to our general mocking performance problem in fuzzing.
    
    In addition to the above, this patch has an optimization for the direct response fuzzer (don't
    initiate upstream connections) and a --config=plain-fuzz mode for peformance work without
    confounding ASAN.
    
    Risk level: Low
    Testing: Manual bazel runs of the fuzzers, observing exec/s.
    
    Signed-off-by: Harvey Tuch <htuch@google.com>
    htuch committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    f1ea7ee View commit details
    Browse the repository at this point in the history