Skip to content

Commit

Permalink
node: re-tune maxconns and fly limits
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 20, 2023
1 parent 0579ed3 commit 4bad1fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ swap_size_mb = 152

[services.concurrency]
type = "connections"
hard_limit = 375
soft_limit = 300
hard_limit = 775
soft_limit = 600

[[services.tcp_checks]]
# super aggressive interval and timeout because
Expand Down Expand Up @@ -61,8 +61,8 @@ swap_size_mb = 152

[services.concurrency]
type = "connections"
hard_limit = 375
soft_limit = 300
hard_limit = 775
soft_limit = 600

[[services.tcp_checks]]
# super aggressive interval and timeout because
Expand Down
8 changes: 4 additions & 4 deletions src/commons/envutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ export function isCleartext() {

// sysctl get net.ipv4.tcp_syn_backlog
export function tcpBacklog() {
if (!envManager) return 300;
if (!envManager) return 600; // same as fly.service soft_limit

return envManager.get("TCP_BACKLOG") || 300;
return envManager.get("TCP_BACKLOG") || 600;
}

// don't forget to update the fly.toml too
export function maxconns() {
if (!envManager) return 500;
if (!envManager) return 1000; // 25% higher than fly.service hard_limit

return envManager.get("MAXCONNS") || 500;
return envManager.get("MAXCONNS") || 1000;
}

export function minconns() {
Expand Down

0 comments on commit 4bad1fa

Please sign in to comment.