Engineer in Tokyo

TIL: August 25, 2025 - Weekly Reading: Kubernetes swap, and beating Dijkstra's algorithm

Kubernetes

  • Tuning Linux Swap for Kubernetes: A Deep DiveAjay Sundar Karuppasamy

    With the new NodeSwap feature becoming stable in Kubernetes 1.34, using Linux swap in Kubernetes clusters becomes more viable as a way to deal with memory management. Starting with Kubernetes 1.34, pods will be able to use swap memory without enabling unstable features.

    Swap limits and usage are configured automatically by Kubernetes and set by the container runtime via the cgroups v2 (cgroups v1 is not supported) memory.swap.max parameter. Pods need to have the Burstable memory QoS class (BestEffort and Guaranteed pods cannot use swap) and the limit is calculated proportionate to the memory request and total swap space available on the node.

Programming

  • Breaking the Sorting Barrier for Directed Single-Source Shortest PathsRan Duan, Jiayi Mao, Xiao Mao, Xinkai Shu, Longhui Yin

    A faster alternative to Dijkstra’s algorithm has been developed by a team of researchers at Tsinghua University, led by Professor Duan Ran. The new algorithm improves the time complexity of finding the shortest path in a graph from O(m + n log n) (where n = nodes, m = edges) to O(m * log^(2/3) n).

    Dijkstra’s algorithm, used a priority queue to rank all unexplored nodes by their distances. The new algorithm, avoids this sorting by using the Bellman-Ford algorithm and the recursive partial ordering method previously developed by Duan and others.