Skip to content

perf: Reduce online serving hot-path overhead from metrics and audit logging - #6854

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:perf/online-serving-hot-path-overhead
Sep 22, 2026
Merged

ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:perf/online-serving-hot-path-overhead

Conversation

@ntkathole

@ntkathole ntkathole commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Reduces per-request overhead on the /get-online-features endpoint that was
introduced between v0.61.0 and v0.65.0. Users upgrading across this range
observed p99 latency increase from ~80 ms to ~200 ms with the same
worker/replica configuration.

Two root causes are addressed:

1. Count PRESENT statuses incrementally (utils.py)

track_feature_statuses() (added in #6280) scans the entire feat_statuses
matrix after it is already built:

# Before — O(n_features × output_len) re-scan
_present = sum(s == PRESENT for row in feat_statuses for s in row)

For a request with 25 features × 100 entities × 3 feature views, this
re-scans 7,500 status values. This PR counts PRESENT values during the
existing assignment loop, making the counting O(1) additional work:

# After — incremented during the existing loop
_present_count += 1

2. Skip audit overhead when audit_logging is disabled (feature_server.py)

_emit_online_audit() (added in #6340) runs in the finally block of every
online request. Even with audit_logging: false (the default), every request
still:

  • Calls time.monotonic() twice for audit timing
  • Calls get_security_manager() to resolve requestor identity
  • Calls _parse_feature_info() to re-parse the feature list

This PR adds an early-exit guard on feast_metrics._config.audit_logging so
that when audit logging is disabled, none of this work is performed.

@ntkathole
ntkathole requested a review from a team as a code owner September 22, 2026 05:03
…logging

Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
@ntkathole
ntkathole force-pushed the perf/online-serving-hot-path-overhead branch from af09314 to 63d9516 Compare September 22, 2026 05:06
@codecov-commenter

codecov-commenter commented Sep 22, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.62%. Comparing base (d9ea120) to head (63d9516).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6854   +/-   ##
=======================================
  Coverage   47.62%   47.62%           
=======================================
  Files         422      422           
  Lines       52352    52358    +6     
  Branches     7596     7599    +3     
=======================================
+ Hits        24931    24936    +5     
  Misses      25646    25646           
- Partials     1775     1776    +1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.96% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/feature_server.py 63.88% <100.00%> (+0.24%) ⬆️
sdk/python/feast/utils.py 78.41% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9ea120...63d9516. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntkathole
ntkathole merged commit 5ee7ee3 into feast-dev:master Sep 22, 2026
37 checks passed
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.

3 participants