Atlaslog / Field Notes / Tiles
Field note · Tiles
Seven tile subdomains configured, still only six connections
Quick answer
`subdomains: '01234567'` is set, but the network panel still shows six active requests with everything else queued. Either the URL template lacks `{s}`, or all subdomains resolve to one host behind HTTP/1.1 where the limit still applies.
Symptom
- At most 6 requests sit in `Pending` while 40 or more rows are greyed out as `Queueing` during a drag
- Actual request URLs are `https://tile.example.com/{z}/{x}/{y}.png` with no `t0` to `t7` prefix
- First-screen tiles take 3 to 4 seconds, barely better than 5 to 6 seconds without subdomains
Checklist
- Check whether real request URLs contain a `t0` or `t3` prefix
- Group requests by domain in the network panel and count active hosts
- Run `nslookup t0.example.com` and `nslookup t1.example.com` to see whether they hit the same IP
- Check the response protocol and `server` header for HTTP/2
- Verify the URL template literally contains `{s}`
Fix
Enable HTTP/2 (`listen 443 ssl http2`) so the six-per-domain limit stops mattering, or point subdomains at different backends and use `https://t{s}.example.com/{z}/{x}/{y}.png`; cutting request count with `tileSize: 512, zoomOffset: -1` also helps.
Code
L.tileLayer('https://tile.example.com/{z}/{x}/{y}.png', {
subdomains: '01234567' // 配置了但未生效
});
L.tileLayer('https://t{s}.example.com/{z}/{x}/{y}.png', {
subdomains: '01234567'
});# Nginx:启用 HTTP/2 并给瓦片加长缓存
server {
listen 443 ssl http2;
server_name t0.example.com t1.example.com t2.example.com;
location / {
root /var/www/tiles;
expires 30d;
add_header Cache-Control "public, immutable";
}
}
# DNS:不同子域指向不同节点,避免单机排队
t0.example.com A 10.0.1.11
t1.example.com A 10.0.1.12
t2.example.com A 10.0.1.13
Watch out
- Adding `subdomains` without `{s}` in the template, so the option is silently ignored
- CNAME-ing every subdomain to one IP and expecting a speedup, which just moves the queue to the server
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). Seven tile subdomains configured, still only six connections. https://www.jingweizhi.com/en/cookbook/tile-subdomain-concurrency.html (accessed 2026-11-03).