Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 System Services

WWDC22 · 19 min · System Services

Reduce networking delays for a more responsive app

Find out how network latency can affect your apps when trying to get full benefit out of modern network throughput rates. Learn about changes you can make in your app and on your server to boost responsiveness, and prepare your app for improvements coming to the Internet that will offer even lower end-to-end delays.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 7 snippets

Enable connection migration on URLSessionConfiguration for HTTP/3 swift · at 6:21 ↗
let configuration = URLSessionConfiguration.default
configuration.multipathServiceType = .handover
Enable connection migration on NWParameters for QUIC swift · at 6:29 ↗
let parameters = NWParameters.quic(alpn: ["myproto"])
parameters.multipathServiceType = .handover
Opt-in to QUIC datagrams swift · at 7:08 ↗
// Only one datagram flow can be created per connection
let options = NWProtocolQUIC.Options()
options.isDatagram = true
options.maxDatagramFrameSize = 65535
Network quality tool in MacOS bash · at 8:12 ↗
networkQuality -s -C https://myserver.example.com/config
Recommended configuration for Apache Traffic Server markdown · at 10:59 ↗
% cat /opt/ats/etc/trafficserver/records.config

# Set not-sent low-water mark trigger threshold to 128 kilobytes
CONFIG proxy.config.net.sock_notsent_lowat INT 131072

# Set Socket Options flag to the sum of the options we want
# TCP_NODELAY(1) + TCP_FASTOPEN(8) + TCP_NOTSENT_LOWAT(64) = 73
CONFIG proxy.config.net.sock_option_flag_in INT 73

...

# Enable Dynamic TLS record sizes
CONFIG proxy.config.ssl.max_record_size INT -1

...

# Reduce low-water mark and buffer block size for HTTP/2
CONFIG proxy.config.http2.default_buffer_water_mark INT  32768
CONFIG proxy.config.http2.write_buffer_block_size   INT 262144
Responsiveness tests markdown · at 12:52 ↗
https://www.waveform.com/tools/bufferbloat
https://github.com/network-quality/goresponsiveness
https://www.speedtest.net/
Enable L4S for QUIC on Mac bash · at 17:12 ↗
defaults write -g network_enable_l4s -bool true

Resources