You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/post/hidden-cost-rootless-container-networking/index.adoc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ This post walks through the investigation that found the culprit.
22
22
23
23
== The gap
24
24
25
-
The benchmark is a REST/CRUD application backed by PostgreSQL. The app runs on the host, postgres in a rootless podman container. Each HTTP request executes 2 SQL queries (confirmed via https://www.postgresql.org/docs/current/pgstatstatements.html[pg_stat_statements]).
25
+
The benchmark is a REST/CRUD application backed by PostgreSQL. The app runs on the host, PostgreSQL in a rootless podman container. Each HTTP request executes 2 SQL queries (confirmed via https://www.postgresql.org/docs/current/pgstatstatements.html[pg_stat_statements]).
26
26
27
27
image::throughput-gap.svg[Throughput comparison: Local vs Perf-lab]
28
28
29
-
Spring delivers roughly the same throughput in both environments (~12-13K TPS). Quarkus swings from 15.5K to 24.5K -- it is being held back locally. **Something between the app and postgres is penalizing Quarkus specifically.**
29
+
Spring delivers roughly the same throughput in both environments (~12-13K TPS). Quarkus swings from 15.5K to 24.5K -- it is being held back locally. **Something between the app and PostgreSQL is penalizing Quarkus specifically.**
30
30
31
31
== mpstat: where is the CPU going?
32
32
@@ -73,10 +73,10 @@ Rootless podman on Fedora uses https://passt.top/passt/[pasta (passt)] to forwar
Every JDBC packet traverses two extra kernel/userspace boundary crossings plus a userspace copy in the pasta process. For a chatty protocol like JDBC with small, frequent packets, this is devastating.
@@ -104,7 +104,7 @@ In other words, **pasta was masking Quarkus's CPU efficiency advantage** -- the
104
104
105
105
== The fix
106
106
107
-
Run the postgres container with `--network=host` instead of port-mapping (`-p 5432:5432`). We added `DB_HOST_NETWORK=true` to the benchmark's https://github.com/quarkusio/spring-quarkus-perf-comparison/blob/main/scripts/infra.sh[infrastructure script].
107
+
Run the PostgreSQL container with `--network=host` instead of port-mapping (`-p 5432:5432`). We added `DB_HOST_NETWORK=true` to the benchmark's https://github.com/quarkusio/spring-quarkus-perf-comparison/blob/main/scripts/infra.sh[infrastructure script].
108
108
109
109
[cols="2,1,1,1", options="header"]
110
110
|===
@@ -140,7 +140,7 @@ image::diff-flamegraph.png[Differential flamegraph: default pasta vs host networ
140
140
141
141
Red means more CPU in the default (pasta) run; blue means more CPU with host networking. The red stacks that dominated the first flamegraph — `_raw_spin_unlock_irqrestore`, `nft_do_chain`, `tcp_clean_rtx_queue` — have disappeared.
142
142
143
-
**With `--network=host`, the app and postgres share the same network namespace; packets never leave the kernel.**
143
+
**With `--network=host`, the app and PostgreSQL share the same network namespace; packets never leave the kernel.**
0 commit comments