Systems and Networking
Notes on Systems and Networking. Linux, containers, storage and the wire.. Daily learning notes on Linux resource limits, network namespaces, durability…
- מה TCP שומר כשהחיבור שקט? — שני שרתים יכולים להישאר מחוברים שעה בלי לשלוח דבר. מה הקרנל שומר בכל צד, מי באמת מאזין, ואיך רואים את זה בפעולה עם Python, ss ו־tcpdump?
- Why the old address lives on after you change the DNS record — Lowering TTL does not shorten an already-cached answer. Negative caches, stale serving and existing connections complicate migrations.
- One transaction, two different snapshots — Atomicity does not freeze concurrent data. Read Committed and Repeatable Read choose snapshots at different boundaries.
- You forked a process. Did you copy all its memory? — Fork can share private physical pages until writes separate them. Count distinct dirtied pages and distinguish RSS from PSS.
- A bigger queue does not make the service faster — Bounded queues must slow admission, not just collect waiting tasks. Little's Law relates average work, throughput and residence time.
- Root in a container: which powers remain? — UID, capabilities, no_new_privs and read-only filesystems protect different boundaries. Ordinary writable data remains writable.
- The request timed out. Was the order created? — A timeout leaves the outcome unknown. Safe retries need stable operation keys, unique constraints and atomic effect records.
- The order was saved. The event disappeared. — Save business state and publication intent together. A relay can recover after crashes, but duplicate delivery still needs handling.
- Exit code 137: the container that ran out of memory — A container that dies with no error in its own logs was often killed from outside. Its memory limit is separate from the machine's.
- Why the old address lives on after you change the DNS record — A DNS change is not a switch, it is a countdown. Every resolver keeps the old answer until its time runs out, and some keep it longer.
- Why is the container slow when the server is almost idle? — A CPU limit is a time budget per window. Spend it early with parallel workers and the container waits, even with free cores.
- Why localhost in a container is not your machine — 127.0.0.1 belongs to a network namespace. A process in a different one is looking at a different loopback.
- You sent two messages and received one and a half — TCP is an ordered stream of bytes. Message boundaries are your protocol's job, usually a length prefix and a buffer.
- The write succeeded. Will it survive a crash? — Reading data back proves nothing about durability. Only a successful fsync, or a WAL flush, makes the storage commit to it.