Title: Redis online store: HGETALL for wide reads, and an opt-in GIL-free client (valkey-glide) for get_online_features · Issue #6856 · feast-dev/feast · GitHub
Open Graph Title: Redis online store: HGETALL for wide reads, and an opt-in GIL-free client (valkey-glide) for get_online_features · Issue #6856 · feast-dev/feast
X Title: Redis online store: HGETALL for wide reads, and an opt-in GIL-free client (valkey-glide) for get_online_features · Issue #6856 · feast-dev/feast
Description: Is your feature request related to a problem? Please describe. The Python get_online_features path against the Redis online store is slow for wide reads, and the cost is on the client, not the server. Our shape is 4 FeatureViews, ~90 fie...
Open Graph Description: Is your feature request related to a problem? Please describe. The Python get_online_features path against the Redis online store is slow for wide reads, and the cost is on the client, not the serv...
X Description: Is your feature request related to a problem? Please describe. The Python get_online_features path against the Redis online store is slow for wide reads, and the cost is on the client, not the serv...
Opengraph URL: https://github.com/feast-dev/feast/issues/6856
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Redis online store: HGETALL for wide reads, and an opt-in GIL-free client (valkey-glide) for get_online_features","articleBody":"**Is your feature request related to a problem? Please describe.**\n\nThe Python `get_online_features` path against the Redis online store is slow for wide reads, and the cost is on the client, not the server. Our shape is 4 FeatureViews, ~90 fields, 350 to 500 entities per call, served from a FastAPI process that does other work at the same time.\n\nTwo separate problems show up:\n\n1. **HMGET on listpack-encoded hashes scans once per requested field.** Redis and Valkey keep a hash as a listpack up to `hash-max-listpack-entries` (default 128 on Redis 7 and Valkey 8). Our hashes have ~120 fields, so every HMGET of ~90 fields does ~90 linear scans. Measured on Valkey 8 with `INFO commandstats`, same 500 keys:\n\n | command | server time per command | server time per 500-entity read |\n |---|---|---|\n | HMGET, 94 named fields | 25.8 us | 12.9 ms |\n | HGETALL (123 fields) | 5.6 us | 2.8 ms |\n\n HGETALL returns about a third more bytes and is still 4.6x cheaper for the server. This is the optimization #3337 asked for in 2022 (the Java server switches to HGETALL above 50 features); that issue was closed by the stale bot without a change.\n\n2. **The Python client work holds the GIL in thousands of short bursts per read.** redis-py packs every command, hiredis parses every reply, and each socket receive releases and reacquires the GIL. Then the SDK turns every `ValueProto` blob into a Python object. In a process with other threads running Python, every one of those reacquires waits out the switch interval, so the read time depends on how busy the rest of the process is.\n\n Same machine, same data, Feast 0.66 (which already has the single-pipeline read from #6337), 500 entities, ~90 fields across 4 views, p50 of 40 runs:\n\n | read path | alone | while another thread runs pure-Python work |\n |---|---|---|\n | `get_online_features` (redis-py + hiredis) | 140 ms | 946 ms |\n | same field plan, one HGETALL per entity through valkey-glide (Rust core), decode in Python | 43 ms | 160 ms |\n\n The 6x gap under contention is the part that matters in production. It does not show up in a single-threaded benchmark.\n\n**Describe the solution you'd like**\n\nTwo changes to `RedisOnlineStore`, independent of each other:\n\n1. In `_read_features_per_fv` / the batched `get_online_features`, issue HGETALL instead of HMGET when the number of requested hash fields crosses a threshold (the Java server uses 50), and pick the requested fields out of the reply. Everything else stays the same: same `_redis_key`, same `_mmh3` field names, same `_ts:\u003cview>` presence check.\n\n2. An opt-in client for the Redis online store that runs the pipeline off the GIL. [valkey-glide](https://github.com/valkey-io/valkey-glide) (`valkey-glide-sync` on PyPI) is an official Valkey client with a Rust core; a non-atomic `Batch` is one FFI call, so the whole fetch runs with the GIL released and returns once. It speaks RESP to Redis and Valkey and supports TLS and cluster mode. A `connection_string`-compatible `client: glide` option on `RedisOnlineStoreConfig` would keep `feature_store.yaml` as the single place the store is configured.\n\n**Describe alternatives you've considered**\n\n- The Go feature server. It needs the file registry (we use the SQL registry) and a separate Python transformation service for on-demand views, and the Python wheel does not ship the Go library.\n- `get_online_features_async`. Same Python parsing on the same GIL; measured within a few percent of the sync path.\n- Lowering `hash-max-listpack-entries` on the server so hashes become hashtables. That does remove most of the HMGET cost (7.4 ms to 1.1 ms server time in our test) but costs ~40% more memory and is an operator-side change; HGETALL gets most of the same win from the client.\n- Reading `OnlineResponse.proto` directly instead of `to_dict()`. Worth about 20%, but the redis-py fetch is still the part that stalls under contention.\n\nWe have both changes running in a fork of the read path and are happy to contribute either as a PR if there is interest in the direction.\n\n**Additional context**\n\nRelated: #3337 (HGETALL request, closed stale), #4711 and #6337 (single pipeline across feature views, merged; the numbers above are with that in place), #3649 (registry `from_proto` overhead, a separate cost).\n","author":{"url":"https://github.com/chandlerok","@type":"Person","name":"chandlerok"},"datePublished":"2026-09-22T16:01:40Z","url":"https://github.com/feast-dev/feast/issues/6856"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5846f07b-19ba-5409-ff3d-43213920bbc9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6DC:3DB40C:2E0B43:3F5003:6AFE9816 |
| html-safe-nonce | 2935583ea588c21c96dd4c23eb17fc41310b85bf6ae8dbb048cf8f644357d81b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkRDOjNEQjQwQzoyRTBCNDM6M0Y1MDAzOjZBRkU5ODE2IiwidmlzaXRvcl9pZCI6IjI2Mzc2MDAxNzkxNzEwMDY0ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1e35d9b264e7134b56537c4e1a9a559ba1fb997ff111a45655565c7fc8a63426 |
| hovercard-subject-tag | issue:5542055888 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6856/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c1ce8aadb8933fe85100b02621da0abb0920775be45c9dc5a5313e2caad2a718/feast-dev/feast/issues/6856 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1ce8aadb8933fe85100b02621da0abb0920775be45c9dc5a5313e2caad2a718/feast-dev/feast/issues/6856 |
| og:image:alt | Is your feature request related to a problem? Please describe. The Python get_online_features path against the Redis online store is slow for wide reads, and the cost is on the client, not the serv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chandlerok |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width