Skip to content

Run dpplint with two replicas and 16 threads each - #27

Merged
fabianekc merged 1 commit into
mainfrom
deployment-threads-replicas
Oct 19, 2026
Merged

fabianekc merged 1 commit into
mainfrom
deployment-threads-replicas

Conversation

@fabianekc

Copy link
Copy Markdown
Member

Summary

With one replica and 3 threads, three checks against a passport host that does not answer kept the service busy for up to 35 s: /up and every other request waited until they ended.

  • Two replicas, 16 threads each (RAILS_MAX_THREADS=16): up to 32 checks run at the same time. Rolling updates start the new replica before the old one stops (maxUnavailable: 0, maxSurge: 1).
  • Readiness (/version, every 5 s, 2 s timeout, out after two failures): a replica whose threads are all busy is taken out of the ingress until it answers again.
  • Liveness checks only that the port is open (TCP), so a busy replica is not restarted. Requests that wait for a thread do not count against it; a process that stops listening still does.
  • Memory request 512 Mi (was 384 Mi): 16 parallel checks with SOyA validation used about 480 MiB in a test, mostly the SOyA web-cli. The limit stays at 1 GiB; CPU stays at a 100m request without limit.
  • Replicas keep no state of their own (no sessions, cookies or shared files; caches live for one check only), so either replica can answer any request.

Tests

  • kubeconform -strict against Kubernetes 1.30: deployment, service and ingress valid.
  • In a container with 16 threads and 20 checks against a host that does not answer: /version with a 2 s timeout failed until the checks ended (34.7 s); a TCP connection to the port succeeded on every one of 45 probes.
  • 16 parallel checks of a passport whose host answers JSON at once and leaves other requests hanging: about 480 MiB in the container (baseline about 130 MiB).

Two replicas with RAILS_MAX_THREADS=16 let 32 checks run at the same time,
so a few checks against a host that does not answer no longer hold up the
service. Rolling updates keep both replicas available (maxUnavailable 0).

A replica whose threads are all busy fails its readiness probe (/version,
every 5 s with a 2 s timeout, after two failures) and is taken out of the
ingress until it answers again. The liveness probe now only checks that the
port is open, so a busy replica is not restarted.

The memory request follows what 16 parallel checks use (about 480 MiB
measured); the limit stays at 1 GiB.
@fabianekc
fabianekc merged commit 7bdee9e into main Oct 19, 2026
2 checks passed
@fabianekc
fabianekc deleted the deployment-threads-replicas branch October 19, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant