Skip to content

feat: set keepalive for pgcat server itself #402

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 2 commits into from
Apr 12, 2023
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
4 changes: 2 additions & 2 deletions CONFIG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PgCat Configurations
# PgCat Configurations
## `general` Section

### host
Expand Down Expand Up @@ -127,7 +127,7 @@ path: general.tcp_keepalives_idle
default: 5
```

Number of seconds of connection idleness to wait before sending a keepalive packet to the server.
Number of seconds of connection idleness to wait before sending a keepalive packet to the server and client.

### tcp_keepalives_count
```
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ mod stats;
mod tls;

use crate::config::{get_config, reload_config, VERSION};
use crate::messages::configure_socket;
use crate::pool::{ClientServerMap, ConnectionPool};
use crate::prometheus::start_metric_server;
use crate::stats::{Collector, Reporter, REPORTER};
Expand Down Expand Up @@ -289,6 +290,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let tls_certificate = get_config().general.tls_certificate.clone();

configure_socket(&socket);

tokio::task::spawn(async move {
let start = chrono::offset::Utc::now().naive_utc();

Expand Down