How Baidu Maps Optimizes Mobile Network Performance: Real-World Practices
This article outlines Baidu Maps' mobile network optimization strategies, covering the overall architecture, common wireless issues such as DNS failures and hijacking, and practical solutions like HTTP‑DNS, custom TCP/UDP HTTP, data compression, unified domain entry, and deployment tactics that significantly improve user search latency and engagement.
Why You Don’t Have to Follow Only Baidu Maps’ Tech Team
With the rise of mobile internet, wireless network performance optimization has become a crucial topic for mobile app developers. Baidu Maps’ mobile engine team, together with operations and CDN teams, has summarized practical experiences and achieved measurable results in app network performance.
1. Overall Architecture
The architecture distinguishes between Native and Hybrid clients.
Client side: both the system‑provided RESTful HTTP and a custom HTTP built on TCP/UDP are available. The custom HTTP can switch freely between long‑connection and short‑connection TCP channels, and Hybrid requests may also use the custom HTTP for higher efficiency.
Server side: separate servers handle TCP long connections and UDP communication; PHPUI acts as the business service adapter interfacing directly with clients.
2. Common Wireless Issues
DNS : high failure rate and slow resolution due to synchronous system calls and unstable third‑party DNS services; DNS hijacking incidents have also affected Baidu Maps.
Network Hijacking : breakpoint‑resume hijacking in public venues, fixed‑domain hijacking at ISP level, port blocking, and ISP cache‑induced hijacking.
Network Instability : base‑station handover, cell congestion, weak signal, all causing jitter.
Large Data Transfer : limited wireless bandwidth makes excessive payloads degrade user experience.
Cross‑Data‑Center Access : latency and reliability challenges when accessing services across different rooms.
3. Network Optimization Practices
3.1 HTTP‑DNS and Parallel DNS Resolution
Replace the blocking
gethostbyname()with the concurrent
getaddrinfo()to resolve multiple domains in parallel.
HTTP‑DNS uses a self‑built DNS service accessed via HTTP, delivering the optimal IP node instantly, eliminating local DNS hijacking and reducing latency.
3.2 Custom TCP‑Based HTTP
Implement a custom HTTP stack over TCP to control DNS resolution, connection establishment, read/write timeouts, retries, and adapt to network types (2G/3G/4G/Wi‑Fi) for maximum success rate.
Maintain an in‑memory DNS‑IP pool, refreshed periodically or on‑demand.
Detect breakpoint‑resume feasibility and switch to non‑resume mode when unavailable.
Handle network errors with immediate reconnection or delayed retries.
Use long TCP connections to reduce handshake overhead.
3.3 Custom UDP‑Based HTTP
UDP reduces handshake time; a lightweight reliability layer (similar to QUIC) called LIGHT protocol is added to ensure stable transmission, achieving roughly 30% performance gain.
3.4 Data Protocol Format
Three compression techniques are applied:
Standard gzip compression.
Custom protobuf format using nanopb.
Business‑specific compression tailored to payload characteristics.
3.5 Unified Domain Entry
A single service entry point improves link reuse, shortens DNS and connection time, and centralizes protocol handling.
3.6 Service Deployment
Deploy services across multiple data centers and ISPs with active‑active or active‑active‑active configurations, complemented by CDN acceleration to shorten path latency.
4. Frontier Directions in Network Technology
5. Optimization Results
The charts show that increased search latency leads to a sharp drop in user search intent and weekly active days, with a turning point around 1.2 seconds. Reducing latency boosts user willingness and activity.
6. Value of Network Optimization
Statistical analysis indicates that over 99 % of users can use the service normally, and more than 90 % experience positive incentives in network‑related features.
Baidu Maps Tech Team
Want to see the Baidu Maps team's technical insights, learn how top engineers tackle tough problems, or join the team? Follow the Baidu Maps Tech Team to get the answers you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.