envoyproxy / envoyproxy/envoy

Possible optimization opportunity: set EVENT_BASE_FLAG_NOLOCK

Open
#5,703 9 comments 0 reactions 0 assignees View on GitHub
area/perf help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

Possible optimization opportunity: set EVENT_BASE_FLAG_NOLOCK

*Description*:
While looking for potential accuracy and throughput improvements for Nighthawk [1] (a load generator/benchmarking tool based on Envoy's libraries), observational data suggested that
configuring libevent with EVENT_BASE_FLAG_NOLOCK would yield around 5% added troughput and about 1us lower reported latencies in the benchmarking client in max rps test runs.

Subsequently maxing out rps on an Envoy instance with the same patch applied [2] (which probably breaks a few things in its current form!) yields another improvement compared to a non-patched Envoy, which while not as pronounced as it was in Nighthawk, may still be worth exploring further, hence me filing this issue. If an audit of event usage would show this is low hanging fruit, incorporating a proper version of this patch may be little work and yield a quick win.

*Links*:
- [1] https://github.com/envoyproxy/envoy-perf/pull/31
- [2] Experimental hacky patch (leaks the libevent config, but that is not important for testing): https://gist.github.com/oschaaf/0b511c3036a5d21f046415f78ea88804

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by auditing Envoy's libevent event-base setup and event usage for safe application of EVENT_BASE_FLAG_NOLOCK, then compare max-RPS throughput and reported latency against the existing configuration; done means a validated, non-leaking implementation or evidence that the flag is unsafe.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.