Linxr | Part 8 — Fixing Network Latency & SLIRP Terminal Slowness

작성자

카테고리:

← 피드로
DEV Community · Ai2th · 2026-08-05 개발(SW)

In earlier parts of our series, we covered SSH terminals, Docker integration, and storage passthrough. Today in Part 8, we share the deep network engineering required to fix terminal latency and optimize SLIRP user-mode networking in QEMU on Android.

The Symptom: Terminal Typing Lag

During initial testing, typing commands in the SSH terminal tab felt slightly delayed. Keystrokes would buffer for 100–300ms before rendering on screen.

When investigating with tcpdump and socket trace tools, we discovered the root cause:

  1. QEMU SLIRP User-Mode Stack: SLIRP runs entirely in user-space inside the Android process sandbox (no TAP/TUN devices without root).
  2. Nagle’s Algorithm & Socket Buffering: Small SSH keystroke packets (1 byte) were being delayed by socket buffering mechanisms looking to coalesce small TCP frames.

The Fix: TCP_NODELAY & Virtio-Net Tuning

To eliminate typing latency:

  • Disabling Nagle’s Algorithm: Forced TCP_NODELAY on local SSH port forwards (port 2222) and local proxy bridges.
  • Virtio-Net MTU Configuration: Tuned guest network interface MTU to 1500 with checksum offloading disabled to reduce guest-to-host packet fragmentation.

The result? Keystroke response times dropped from 250ms to under 15ms, delivering a desktop-grade shell experience on phone screens.

Download & Links

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다