Mehdi Akiki

Posts tagged "linux"

  • Published on

    Investigation · Part 14 of 20 · What survives a crash

    SQLite WAL Mode: Fewer fsyncs, a Different Promise

    In WAL mode, a SQLite commit with synchronous=FULL is one frame and one fdatasync, and with NORMAL it is no sync at all. I followed both with strace on my laptop, measured them, and quote what the documentation promises after an application crash and after a power loss.
  • Published on

    Investigation · Part 14 of 20 · From source to a running process

    What fork Really Copies: Copy-on-Write Measured

    fork of a process with 2 GiB of touched memory took 16 ms here, because it copies page tables and not memory. I measured the copies that come later when the child writes, what reading costs, what happens to huge pages, and why posix_spawn stays under a millisecond.
  • Published on

    Investigation · Part 13 of 20 · What survives a crash

    How SQLite Commits a Transaction, Followed With strace

    One INSERT in SQLite's default rollback journal mode makes four sync calls on my laptop. I followed every write with strace, compared FULL, EXTRA, NORMAL and OFF, and found the one directory sync that FULL leaves out, as the SQLite documentation says.
  • Published on

    Investigation · Part 13 of 20 · From source to a running process

    Why the First Touch of Memory Is Slow: Demand Paging Measured

    Mapping 1 GiB takes no time, the first write to each page costs about a microsecond, and the second write 16 nanoseconds. I measured faults with and without huge pages, MAP_POPULATE, calloc and Rust vectors, and twice the compiler removed the work I wanted to measure.
  • Published on

    Investigation · Part 12 of 20 · What survives a crash

    When fsync Fails: What PostgreSQL Learned in 2018

    My program got EIO from fdatasync, called it again and got ok. In 2018 PostgreSQL learned why that second ok can be a lie on Linux. I tell the documented story, then inject fsync errors into my store with an LD_PRELOAD shim, and I say what the shim cannot show.