Engineering Notes
Independent technical documentation for operators building dependable internet services.
Reliable service design
Resilient systems begin with clear ownership, explicit failure modes, and measurements that explain what users experience. A good runbook records assumptions, safe rollback steps, and the smallest useful diagnostic command.
Network performance
Long-distance connections benefit from appropriate congestion control, sufficient socket buffers, and careful validation under realistic latency. Configuration should be changed incrementally and verified at the kernel, service, and application layers.
Operational observability
Logs should answer what happened, when it happened, and which component was responsible. Metrics and health checks are most useful when they are tied to an action an operator can take.
Security fundamentals
Expose only the ports that are required, keep administrative interfaces private, rotate credentials, and preserve a tested rollback path. Documentation is part of the security boundary.
Measure request latency
From the network where a delay occurs, record DNS, connection, TLS and first-byte times for the same resource. Curl reports cumulative times from the start of the request. Subtract adjacent milestones to estimate the cost of each stage.
curl -sS -o /dev/null -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} first_byte=%{time_starttransfer} total=%{time_total}\n' https://example.org/Repeat the measurement at a fixed interval. Record the timestamp, destination address and response status alongside the timings. A fast error page can otherwise look like an improvement.
Estimate socket capacity
Multiply the target transfer rate in bytes per second by the round-trip time in seconds. At 1 Gbit/s and an 80 ms round trip, about 10 MB of data must be in flight to keep the path busy. Buffer limits apply per socket and interact with memory pressure and receiver flow control.
ss -tin
free -hInspect an established connection during a sustained transfer. Compare retransmissions, congestion window and RTT over time. Record these measurements at both ends before changing kernel settings.
Triage a failed HTTPS request
- Resolve the hostname and compare each returned address with the published endpoints.
- Check the TCP handshake from the affected client network. A timeout before the handshake points to a different stage than an HTTP error.
- Check certificate names and expiry using the original hostname. Keep certificate verification enabled during the test.
- Correlate an HTTP error with the origin service log using the timestamp and request method. Remove credentials and session identifiers before sharing a trace.