Page cache, writeback and reclaim Fast writes followed by a long stall The first minute of an import looks wonderfully fast. Then writes begin stalling in bursts. Alia follows a single buffered write through a dirty memory page to the device that still owes it a durable home. Dirty data grows from thirty-two to four hundred eighty mebibytes. Receiving a successful buffered write does not establish that those bytes have reached stable storage. During the burst, the importer is dirtying pages faster than writeback is cleaning them. A buffered write initially modifies a cached page. The page stays dirty until the kernel writes it to backing storage. Writer in context A fast producer can therefore appear faster than the device for a while. As dirty data accumulates the kernel starts writeback and may throttle writers. A successful buffered write alone does not establish persistence after a crash. A dirty page contains changes that have not reached backing storage. Background writeback drains these pages. Sustained dirtying faster than draining eventually feeds back into writer latency. Linux swappiness expresses a relative reclaim cost preference for swapping versus filesystem paging. The supported range extends to two hundred. Interpret it together with workload and swap-device behavior. A minor fault can be resolved without fetching data from backing storage. A major fault requires input and output. Count them per process and compare with observed storage latency. A producer writes one hundred units of data each second while the storage device can sustainably drain sixty. Initially memory accepts the difference and the application sees fast writes. Dirty data accumulates at about forty units per second while those simple rates hold. Once buffering or writeback limits apply, later writers can stall. Separate accepted bytes from written bytes A buffered write changes a cached file page and marks it dirty. Dirty data accumulates and writeback workers submit I O according to configured thresholds. When dirtying outruns drainage, the producing task may wait before dirtying more pages. Successful writeback makes pages eligible for clean reclaim. Application durability still depends on the filesystem and sync contract. Consider a file updated with a temporary file and a rename. Persisting the file contents and persisting the directory change are separate requirements under the application's chosen filesystem and crash model. A test that immediately reads the renamed path usually exercises cached state, not survival of a machine failure. Make the durability requirement explicit and validate the supported sequence on the storage system used by the service. Read the measurements Mark three moments for a small file update. The application hands bytes to the kernel, writeback submits device work, and the application receives whatever durability acknowledgment it requested. These times answer different questions. A successful buffered write alone does not guarantee the update will survive a machine crash. A dirty-data gauge is a stock, while bytes becoming dirty and bytes completing writeback are flows. Over an interval the stock grows when new dirty data outruns completion, subject to accounting details. Sampling only after a flush can show a low gauge immediately following the period that caused the latency spike. Find the slower side of the reservoir Would dropping every cached page solve the mismatch between the writer's arrival rate and the device's drain rate? Clean cache and dirty data have different costs. Dropping clean file cache may discard precisely the reads that should stay fast. Check dirty bytes, writeback and worker stalls together while pacing the bulk writer. A flat dirty backlog with isolated long sync calls can indicate device flush latency rather than excessive buffered production. Check the competing explanation A file mapping establishes an address range. Accessing an unmapped-in page can fault later. Shared writable mappings also need a defined persistence and synchronization contract. Readahead speculatively fetches subsequent file pages. Clearing caches on a shared production host distorts workload behavior. Use an isolated cold-start experiment when cache effects matter. Background reclaim attempts to maintain available memory. Under stronger pressure an allocating task can reclaim synchronously and lose execution time on the request path. Price the importer and the reader together After pacing, the dirty backlog in this case drops to fifty-six mebibytes. The page cache holds file-backed pages in RAM. A second read may avoid device I O entirely. A cold benchmark and a warmed benchmark measure different paths. Alia checks both the import finishing time and the intervals where customer writes stall. A fast return to the application only measured one boundary. Apply the diagnosis If a new flush policy improves peak throughput but creates longer pauses for foreground requests, compare dirty data and competing input and output at the same time. Bound the producer's rate or adjust batching in a test. Verify tail read latency and the required durability semantics before declaring that faster writes improved the system.