-
Notifications
You must be signed in to change notification settings - Fork 222
Make queue strategy configurable and default to Fifo #463
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
Changes from all commits
075b8a8
01e9145
ddaab1a
3d15710
9b6b6c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,6 +292,9 @@ pub struct General { | |
#[serde(default = "General::default_server_lifetime")] | ||
pub server_lifetime: u64, | ||
|
||
#[serde(default = "General::default_server_round_robin")] // False | ||
pub server_round_robin: bool, | ||
|
||
#[serde(default = "General::default_worker_threads")] | ||
pub worker_threads: usize, | ||
|
||
|
@@ -352,7 +355,7 @@ impl General { | |
} | ||
|
||
pub fn default_idle_timeout() -> u64 { | ||
60000 // 1 minute | ||
600000 // 10 minutes | ||
} | ||
|
||
pub fn default_shutdown_timeout() -> u64 { | ||
|
@@ -390,6 +393,10 @@ impl General { | |
pub fn default_prometheus_exporter_port() -> i16 { | ||
9930 | ||
} | ||
|
||
pub fn default_server_round_robin() -> bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This brings us back to original PgCat behavior before the bb8 queuing strategy change, is that correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, using a queue instead of stack as the default. Once we figure out if this is causing connection thrashing we can switch the default and match pgbouncer |
||
true | ||
} | ||
} | ||
|
||
impl Default for General { | ||
|
@@ -424,7 +431,8 @@ impl Default for General { | |
auth_query: None, | ||
auth_query_user: None, | ||
auth_query_password: None, | ||
server_lifetime: 1000 * 3600 * 24, // 24 hours, | ||
server_lifetime: Self::default_server_lifetime(), | ||
server_round_robin: false, | ||
validate_config: true, | ||
} | ||
} | ||
|
@@ -983,6 +991,7 @@ impl Config { | |
"Default max server lifetime: {}ms", | ||
self.general.server_lifetime | ||
); | ||
info!("Sever round robin: {}", self.general.server_round_robin); | ||
match self.general.tls_certificate.clone() { | ||
Some(tls_certificate) => { | ||
info!("TLS certificate: {}", tls_certificate); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change defaults unnecessarily. People are getting used to them, and it's much easier to change the config when a change is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid point.
I'm mainly changing this to match the pgbouncer default, but if we want to keep it as 1 minute then I can revert