Mehdi Akiki

Posts tagged "reliability"

  • Published on

    Investigation · Part 3 of 20 · What survives a crash

    How to Save a File Without Losing It: Write, fsync, Rename

    I killed a program 300 times while it saved a file. Writing in place left a cut file 233 times, without any power loss. A temp file, fsync and rename never did. Then I traced how sed, Python, cp, install and git save files.
  • Published on

    Investigation · Part 1 of 20 · What survives a crash

    Your Data Is Not on Disk When write() Returns

    When write returns, the kernel has your data, but the disk does not have it yet. I measured it on my laptop: 256 MiB sat in RAM until fsync, kill -9 lost nothing, and a power cut could lose everything for up to about 35 seconds.
  • Published on

    Investigation · Part 10 of 10 · Following a TCP connection

    What a Connection Pool Saves, and the Stale Connection It Gives You Back

    Reusing one connection made 1000 HTTPS requests 21 times faster, and with the stock Python server it first made them 60 times slower. I measured what a pool saves, what a stale connection returns, and which retry pays the same customer two times.
  • Published on

    Investigation · Part 7 of 10 · Following a TCP connection

    TIME_WAIT: Why a Closed Connection Stays Around

    My client and my server closed 500 connections, and the kernel kept 500 sockets for 60 more seconds. I measured which side keeps TIME_WAIT, why tcp_fin_timeout does not change it, how the client side runs out of local ports, and why a restarted server can fail to bind.
  • Published on

    Investigation · Part 5 of 10 · Following a TCP connection

    What a Full Socket Buffer Does to the Sender

    My sender wrote 2.6 MB to a peer that never read anything, and every send() said success. I looked where these bytes waited, what setsockopt really does to the buffer sizes, how a blocking sender is slowed down for free, and how an unbounded queue breaks this.