GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add HTTP connection pooling for remote online store client by ntkathole · Pull Request #5895 · feast-dev/feast

feat: Add HTTP connection pooling for remote online store client #5895

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.

Sign up for GitHub

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

Merged
franciscojavierarceo merged 1 commit into feast-dev:master from ntkathole:connection_pooling
Jan 26, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat: Add HTTP connection pooling for remote online store client #5895

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
208f00a
feat: Add HTTP connection pooling for remote online store client
ntkathole Jan 23, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

124 changes: 123 additions & 1 deletion 124 docs/reference/online-stores/remote.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Description

This remote online store will let you interact with remote feature server. At this moment this only supports the read operation. You can use this online store and able retrieve online features `store.get_online_features` from remote feature server.
This remote online store lets you interact with a remote feature server. You can use this online store to retrieve online features via `store.get_online_features()` from a remote feature server.

## Examples

Expand All @@ -25,6 +25,128 @@ auth:

`cert` is an optional configuration to the public certificate path when the online server starts in TLS(SSL) mode. This may be needed if the online server is started with a self-signed certificate, typically this file ends with `*.crt`, `*.cer`, or `*.pem`.

## Connection Pooling Configuration

The remote online store uses HTTP connection pooling to improve performance by reusing TCP/TLS connections across multiple requests. This significantly reduces latency by avoiding the overhead of establishing new connections for each request.

### Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `connection_pool_size` | int | 50 | Maximum number of connections to keep in the pool. Increase for high-concurrency workloads. |
| `connection_idle_timeout` | int | 300 | Maximum time in seconds a session can be idle before being closed. Set to `0` to disable idle timeout. |
| `connection_retries` | int | 3 | Number of retries for failed requests with exponential backoff. |

### Example with Connection Pooling

{% code title="feature_store.yaml" %}
```yaml
project: my-local-project
registry: /remote/data/registry.db
provider: local
online_store:
type: remote
path: http://feast-feature-server:80

# Connection pooling configuration (optional)
connection_pool_size: 50 # Max connections in pool
connection_idle_timeout: 300 # Idle timeout in seconds (0 to disable)
connection_retries: 3 # Retry count with exponential backoff

entity_key_serialization_version: 3
auth:
type: no_auth
```
{% endcode %}

### Use Cases

**High-throughput workloads:**
```yaml
online_store:
type: remote
path: http://feast-server:80
connection_pool_size: 100 # More connections for high concurrency
connection_idle_timeout: 600 # 10 minutes idle timeout
connection_retries: 5 # More retries for resilience
```

**Long-running services:**
```yaml
online_store:
type: remote
path: http://feast-server:80
connection_idle_timeout: 0 # Never auto-close session
```

**Resource-constrained environments:**
```yaml
online_store:
type: remote
path: http://feast-server:80
connection_pool_size: 10 # Fewer connections to reduce memory
connection_idle_timeout: 60 # 1 minute timeout
```

### Performance Benefits

Connection pooling provides significant latency improvements:

- **Without pooling**: Each request requires a new TCP connection (~10-50ms) and TLS handshake (~30-100ms)
- **With pooling**: Subsequent requests reuse existing connections, eliminating connection overhead

This is especially beneficial for:
- High-frequency feature retrieval in real-time inference pipelines
- Batch processing with many sequential `get_online_features()` calls
- Services with authentication enabled (reduces token refresh overhead)

### Session Cleanup

The HTTP session is automatically managed with idle timeout, but you can also explicitly close it when your application is shutting down or when you want to release resources.

#### Using FeatureStore context manager (recommended)

The recommended way to ensure proper cleanup is to use the `FeatureStore` as a context manager:

```python
from feast import FeatureStore

# Session is automatically closed when exiting the context
with FeatureStore(repo_path=".") as store:
features = store.get_online_features(
features=["driver_hourly_stats:conv_rate"],
entity_rows=[{"driver_id": 1001}]
)
```

#### Explicit cleanup

You can also explicitly close the session by calling `close()` on the `FeatureStore`:

```python
from feast import FeatureStore

store = FeatureStore(repo_path=".")
try:
features = store.get_online_features(
features=["driver_hourly_stats:conv_rate"],
entity_rows=[{"driver_id": 1001}]
)
finally:
store.close() # Closes HTTP session and releases resources
```

#### Direct session management

For advanced use cases, you can directly manage the HTTP session via `HttpSessionManager`:

```python
from feast.permissions.client.http_auth_requests_wrapper import HttpSessionManager

# Close the cached HTTP session
HttpSessionManager.close_session()
```

## How to configure Authentication and Authorization
Please refer the [page](./../../../docs/getting-started/concepts/permission.md) for more details on how to configure authentication and authorization.

27 changes: 27 additions & 0 deletions 27 sdk/python/feast/infra/online_stores/remote.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from feast import Entity, FeatureView, RepoConfig
from feast.infra.online_stores.helpers import _to_naive_utc
from feast.infra.online_stores.online_store import OnlineStore
from feast.permissions.client.http_auth_requests_wrapper import HttpSessionManager
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import FeastConfigBaseModel
Expand Down Expand Up @@ -51,6 +52,18 @@ class RemoteOnlineStoreConfig(FeastConfigBaseModel):
""" str: Path to the public certificate when the online server starts in TLS(SSL) mode. This may be needed if the online server started with a self-signed certificate, typically this file ends with `*.crt`, `*.cer`, or `*.pem`.
If type is 'remote', then this configuration is needed to connect to remote online server in TLS mode. """

# Connection pooling configuration
connection_pool_size: int = 50
""" int: Maximum number of connections to keep in the pool (default 50).
Increase for high-concurrency workloads. """

connection_idle_timeout: int = 300
""" int: Maximum time in seconds a session can be idle before being closed (default 300 = 5 minutes).
Set to 0 to disable idle timeout. """

connection_retries: int = 3
""" int: Number of retries for failed requests with exponential backoff (default 3). """


class RemoteOnlineStore(OnlineStore):
"""
Expand Down Expand Up @@ -544,6 +557,20 @@ def teardown(
):
pass

async def close(self) -> None:
"""
Close the HTTP session and release connection pool resources.

This method is called automatically when FeatureStore.close() is invoked.
It cleans up the cached HTTP session used for connection pooling.

Note: Since the session is shared globally, calling close() will affect
all RemoteOnlineStore instances in the same process. This is typically
fine for SDK usage where there's usually one FeatureStore per process.
"""
HttpSessionManager.close_session()
logger.debug("RemoteOnlineStore HTTP session closed")


@rest_error_handling_decorator
def get_remote_online_features(
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.