Skip to content

Commit 659ce3a

Browse files
committed
feat: Added online server worker config support in operator
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent d6c0b2d commit 659ce3a

File tree

9 files changed

+1851
-0
lines changed

9 files changed

+1851
-0
lines changed

infra/feast-operator/api/v1/featurestore_types.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,44 @@ type ServerConfigs struct {
523523
// required by the Feast components. Ensure that each volume mount has a corresponding
524524
// volume definition in the Volumes field.
525525
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
526+
// WorkerConfigs defines the worker configuration for the Feast server.
527+
// These options are primarily used for production deployments to optimize performance.
528+
WorkerConfigs *WorkerConfigs `json:"workerConfigs,omitempty"`
529+
}
530+
531+
// WorkerConfigs defines the worker configuration for Feast servers.
532+
// These settings control gunicorn worker processes for production deployments.
533+
type WorkerConfigs struct {
534+
// Workers is the number of worker processes. Use -1 to auto-calculate based on CPU cores (2 * CPU + 1).
535+
// Defaults to 1 if not specified.
536+
// +kubebuilder:validation:Minimum=-1
537+
// +optional
538+
Workers *int32 `json:"workers,omitempty"`
539+
// WorkerConnections is the maximum number of simultaneous clients per worker process.
540+
// Defaults to 1000.
541+
// +kubebuilder:validation:Minimum=1
542+
// +optional
543+
WorkerConnections *int32 `json:"workerConnections,omitempty"`
544+
// MaxRequests is the maximum number of requests a worker will process before restarting.
545+
// This helps prevent memory leaks. Defaults to 1000.
546+
// +kubebuilder:validation:Minimum=0
547+
// +optional
548+
MaxRequests *int32 `json:"maxRequests,omitempty"`
549+
// MaxRequestsJitter is the maximum jitter to add to max-requests to prevent
550+
// thundering herd effect on worker restart. Defaults to 50.
551+
// +kubebuilder:validation:Minimum=0
552+
// +optional
553+
MaxRequestsJitter *int32 `json:"maxRequestsJitter,omitempty"`
554+
// KeepAliveTimeout is the timeout for keep-alive connections in seconds.
555+
// Defaults to 30.
556+
// +kubebuilder:validation:Minimum=1
557+
// +optional
558+
KeepAliveTimeout *int32 `json:"keepAliveTimeout,omitempty"`
559+
// RegistryTTLSeconds is the number of seconds after which the registry is refreshed.
560+
// Higher values reduce refresh overhead but increase staleness. Defaults to 60.
561+
// +kubebuilder:validation:Minimum=0
562+
// +optional
563+
RegistryTTLSeconds *int32 `json:"registryTTLSeconds,omitempty"`
526564
}
527565

528566
// RegistryServerConfigs creates a registry server for the feast service, with specified container configurations.

infra/feast-operator/api/v1/zz_generated.deepcopy.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/feast-operator/api/v1alpha1/featurestore_types.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,44 @@ type ServerConfigs struct {
523523
// required by the Feast components. Ensure that each volume mount has a corresponding
524524
// volume definition in the Volumes field.
525525
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
526+
// WorkerConfigs defines the worker configuration for the Feast server.
527+
// These options are primarily used for production deployments to optimize performance.
528+
WorkerConfigs *WorkerConfigs `json:"workerConfigs,omitempty"`
529+
}
530+
531+
// WorkerConfigs defines the worker configuration for Feast servers.
532+
// These settings control gunicorn worker processes for production deployments.
533+
type WorkerConfigs struct {
534+
// Workers is the number of worker processes. Use -1 to auto-calculate based on CPU cores (2 * CPU + 1).
535+
// Defaults to 1 if not specified.
536+
// +kubebuilder:validation:Minimum=-1
537+
// +optional
538+
Workers *int32 `json:"workers,omitempty"`
539+
// WorkerConnections is the maximum number of simultaneous clients per worker process.
540+
// Defaults to 1000.
541+
// +kubebuilder:validation:Minimum=1
542+
// +optional
543+
WorkerConnections *int32 `json:"workerConnections,omitempty"`
544+
// MaxRequests is the maximum number of requests a worker will process before restarting.
545+
// This helps prevent memory leaks. Defaults to 1000.
546+
// +kubebuilder:validation:Minimum=0
547+
// +optional
548+
MaxRequests *int32 `json:"maxRequests,omitempty"`
549+
// MaxRequestsJitter is the maximum jitter to add to max-requests to prevent
550+
// thundering herd effect on worker restart. Defaults to 50.
551+
// +kubebuilder:validation:Minimum=0
552+
// +optional
553+
MaxRequestsJitter *int32 `json:"maxRequestsJitter,omitempty"`
554+
// KeepAliveTimeout is the timeout for keep-alive connections in seconds.
555+
// Defaults to 30.
556+
// +kubebuilder:validation:Minimum=1
557+
// +optional
558+
KeepAliveTimeout *int32 `json:"keepAliveTimeout,omitempty"`
559+
// RegistryTTLSeconds is the number of seconds after which the registry is refreshed.
560+
// Higher values reduce refresh overhead but increase staleness. Defaults to 60.
561+
// +kubebuilder:validation:Minimum=0
562+
// +optional
563+
RegistryTTLSeconds *int32 `json:"registryTTLSeconds,omitempty"`
526564
}
527565

528566
// RegistryServerConfigs creates a registry server for the feast service, with specified container configurations.

infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)