Comments (3)
The problem seems to be exacerbated by quic-go's heavy internal use of goroutines, interacting poorly with the Go runtime's thread scheduling on iOS.
Can you elaborate what you mean by heavy use? We only have one Go routine per connection, plus one for the send queue (https://github.com/quic-go/quic-go/blob/master/connection.go#L515).
You could try driving the send queue from the connection's Go routine, this should be a very simple change.
from quic-go.
Thank you for your response. I apologize for any confusion caused by my previous explanation. Upon further investigation, I realized that the issue isn't related to the heavy use of goroutines within quic-go.
To clarify, the problem appears to be with the use of even a single goroutine causing significant packet delay on iOS. Here are the details of my findings:
Testing with a Regular UDP Connection:
I set up a basic UDP connection and sent 1000-byte packets every 20 milliseconds.
When running this setup without using any goroutines, the network traffic is handled correctly with no significant delays.
However, when I wrapped the UDP connection inside a single goroutine, I observed significant packet delays.
Implications for quic-go:
Given that quic-go uses a single goroutine per connection plus one for the send queue, this behavior likely affects quic-go as well, since it involves goroutine handling.
Build Environment:
I used the following build command for iOS:
GOOS=ios GOARCH=arm64 CGO_ENABLED=1 CC=$(go env GOROOT)/misc/ios/clangwrap.sh go build -ldflags -w -v -tags ios -o "IOS.a" -buildmode=c-archive
It seems the interaction between the Go runtime's thread scheduling and goroutines on iOS is the root cause of the delay, as extensively discussed in this Go issue.
I appreciate your suggestion to drive the send queue from the connection's goroutine and will look into implementing this change to see if it mitigates the issue.
Thank you for your attention and assistance with this matter.
from quic-go.
If this is actually due to golang/go#65889, I fear there's not a lot we can do here. It seems like the only way to resolve the issue would be to avoid using Go routines altogether.
from quic-go.
Related Issues (20)
- Datagram no recent network activity error HOT 3
- bug: unable to connect to quiche servers HOT 5
- In some cases I have turned off Stream on the server side, but OpenStreamSync on the client side is still blocked HOT 6
- pass a context to ConnContext context, cancel it when the connection is closed
- Slow transfer speed HOT 10
- Wrong ACK numbers? HOT 1
- gquic branch usage HOT 1
- Go 1.21
- server incorrectly allows 0-RTT with reduced limits when using tls.Config.GetConfigForClient
- introduce a minimum step size of Path MTU Discovery
- Allow applications to specify MaxPacketBufferSize HOT 8
- add more metrics
- http3: RoundTripper is caching dialErr since v0.43.0 HOT 1
- Cancel retransmission of data when sending with quic Client HOT 1
- implement BBRv3 HOT 3
- use `net.ErrClosed` for the server and the connection HOT 3
- [Suggestion] multi-staging build in quic-go example Dockerfile HOT 1
- Go 1.23 support HOT 1
- OpenStream errors asks users to use deprecated net.Error.Temporary
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 quic-go.