Skip to content

Allow setting the number of runtime workers to be used. #258

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.

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
merged 1 commit into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pgcat.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ log_client_disconnections = false
# Reload config automatically if it changes.
autoreload = false

# Number of worker threads the Runtime will use (4 by default).
worker_threads = 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
worker_threads = 5
worker_threads = 4


# TLS
# tls_certificate = "server.cert"
# tls_private_key = "server.key"
Expand Down
8 changes: 8 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ pub struct General {
#[serde(default = "General::default_ban_time")]
pub ban_time: i64,

#[serde(default = "General::default_worker_threads")]
pub worker_threads: usize,

#[serde(default)] // False
pub autoreload: bool,

Expand Down Expand Up @@ -212,6 +215,10 @@ impl General {
pub fn default_ban_time() -> i64 {
60
}

pub fn default_worker_threads() -> usize {
4
}
}

impl Default for General {
Expand All @@ -226,6 +233,7 @@ impl Default for General {
healthcheck_timeout: Self::default_healthcheck_timeout(),
healthcheck_delay: Self::default_healthcheck_delay(),
ban_time: Self::default_ban_time(),
worker_threads: Self::default_worker_threads(),
log_client_connections: false,
log_client_disconnections: false,
autoreload: false,
Expand Down
Loading