How OkCredit Android App Boosted Network Performance by 30%
Article Summary
OkCredit serves millions in India's Tier-2/3 cities where flaky networks are the norm. Their Android team just cut network call times by 30% with some clever client-side optimizations.
Most engineers think network performance is purely a backend problem. OkCredit's Android team proved otherwise by instrumenting every step of their network calls (DNS, connection pooling, TLS handshakes) and optimizing what they found. They shared their full playbook.
Key Takeaways
- 70% improvement in connection acquisition by fixing OkHttp pooling across modules
- Used EventListener to instrument 7 network call stages in production on sampled users
- Single OkHttp instance and optimized keepAlive settings enabled connection reuse
- Avoided I/O in interceptors (like token retrieval) that blocked network threads
- Auto-retry logic and single API host reduced DNS lookup overhead
Client-side optimizations delivered 30% faster network calls overall, with connection time dropping 70%.
About This Article
OkCredit's Android app had separate OkHttp instances running in each module, which meant connection pools couldn't be shared across the application.
Shrey Garg's team merged everything into a single OkHttp instance and adjusted the ConnectionPool settings (maxIdleConnections and keepAliveDuration) to match what the servers expected.
Connection acquisition time fell by 70% because the pooled connections eliminated the need to repeat DNS lookups, TLS handshakes, and connection setup on follow-up requests.