Comments (4)
Thanks for the feedback.
Using the sample app, and the following command on an ADB root shell:
for fd in /proc/$(pidof com.google.samples.cronet.okhttptransport)/fd/*; do readlink "$fd"; done | sort
FD counts:
- Sample app start: 84
- After sending requests using pure OkHttp: 88
- After initializing Cronet: 104
- After sending requests using Cronet: 106
4 additional FDs when sending requests using pure OkHttp:
+/dev/ashmem
+pipe:[93397]
+pipe:[93397]
+socket:[93392]
20 additional FDs when initializing Cronet:
+/data/app/com.google.android.gms-44whme714CrlclOYAuJT3w==/base.apk
+/data/user_de/0/com.google.android.gms/app_chimera/m/00000001/CronetDynamite.apk
+/data/user_de/0/com.google.android.gms/app_chimera/m/00000001/CronetDynamite.apk
+/dev/ashmem
+/dev/urandom
+anon_inode:[eventfd]
+anon_inode:[eventfd]
+anon_inode:[eventpoll]
+anon_inode:[eventpoll]
+anon_inode:[eventpoll]
+anon_inode:[timerfd]
+anon_inode:[timerfd]
+pipe:[95093]
+pipe:[95093]
+pipe:[95353]
+pipe:[95353]
+socket:[95091]
+socket:[95092]
+socket:[95351]
+socket:[95352]
2 additional FDs when sending requests through Cronet:
+socket:[96661]
+socket:[98600]
So using Cronet results in 18 additional FDs being used, compared to pure OkHttp.
I also looked at the number of FDs being opened per contacted destination domain, but I couldn't find a clear regression between pure OkHttp and Cronet-backed OkHttp in that regard - they both seem to use 1 to 2 FD per destination domain.
To clarify, is it the 20 FDs fixed cost from Cronet initialization that's bothering you or are you observing behavior that isn't covered in the above?
from cronet-transport-for-okhttp.
I think it depends on the number of requests per app.
In case of an enterpise app with tens of requests being executed, we're hitting the process limit of opened FDs and OS kills the app.
We're not doing anything extra here - just using OkHttp vanilla vs using it with the Cronet interceptor (as basic as it can get).
from cronet-transport-for-okhttp.
I've tried issuing 1k concurrent OkHttp requests to the top 1k websites as indicated by this list: https://gist.github.com/bejaneps/ba8d8eed85b0c289a05c750b3d825f61. Like Etienne, I haven't experienced any issues with the setup and the number of open descriptors looks roughly consistent as the requests re being processed, with the exception of Cronet being a bit more aggressive with keeping them open towards the end. This was using the default Pixel 6 emulator with Android 13.
If you can reliably reproduce the issue in a sandbox setup repro steps would be much appreciated.
from cronet-transport-for-okhttp.
@Danstahrg can you please share the sample app code for that 1k requests test?
from cronet-transport-for-okhttp.
Related Issues (20)
- Redirected URL HOT 2
- adding it as an OkHttp interceptor, breaks okhttp3.Authenticator HOT 3
- java.lang.IllegalStateException: There is no read or rewind or length check in progress CronetUploadDataStream HOT 5
- Could not find VERSION HOT 3
- ByteArrayOutputStream size cant be negative HOT 1
- Can you upgrade to Okhttp 4? HOT 1
- Consider removing the Guava dependency
- Add a parallel version using android.net.http.HttpEngine
- Requests are resolved through HTTP2 HOT 6
- Option for symbolicated traces HOT 1
- Occasional exceptions occur when sending network requests
- Q: IPC call when using Play Services Cronet provider? HOT 2
- ANRs when loading Cronet Provider HOT 1
- Contribution instructions HOT 2
- setURLStreamHandlerFactory is incompatible with Firebase HOT 3
- Samples should be a working gradle project HOT 1
- After use this core, on firebase monitor dashboard, network request spend more time ...
- Secure DNS support
- Questions about header HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cronet-transport-for-okhttp.