-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ BUG ] Wireguard Chain speed problem #2850
Comments
I have the same problem. Wireguard over Vmes works very slowly (dialerProxy or proxySettings tag). OS Windows 10 x64 |
how did you chain wireguard to other outbound ? how do you specify the dialerProxy? |
|
@chise0713 That would be streamSettings -> sockopt ->dialerProxy. When I open official docs it says
Is this simply outdated? |
I don't know. I just opened this issue to tell devs that sing-box is doing chains with better performance. The doc statement is probably for when we use kernel wireguard. |
@X-Oracle did you move completely to sing-box or switch just the client? |
I use sing-box for Wireguard but only when chaining it. I use both of them wherever suited, but I prefer Xray as I'm more experienced in it. |
using sockopt even with direct tag, degrade speed to ~50KBps
i enable error log and find that only when sockopt is used , some "unknown type packet" generated wireguard-go/device/receive.go#L207 and also speed is sensitive to mtu do you have any idea ? |
@GFW-knocker |
As I said before. It has better performance in the sing-box. In theory, there could be a fix if somebody who understands both cores could investigate this. Wireguard chain is a rare situation and I don't think anybody with knowledge is interested in it. |
@Mfire2001 |
It is not a wireguard issue. If it was then a normal wireguard would be affected too. We must see how both For UDP, we can test with VLESS-quick and see if it behaves like wireguard as both are udp based protocol. |
It seems this issue can be worked around by setting the internal buffer size of dialerProxy to nothing, at top-level
the effect seems to be the same as: diff --git a/transport/internet/dialer.go b/transport/internet/dialer.go
index 989bfa0..5de136a 100644
--- a/transport/internet/dialer.go
+++ b/transport/internet/dialer.go
@@ -120,8 +120,8 @@ func redirect(ctx context.Context, dst net.Destination, obt string) net.Conn {
Tag: obt,
})) // add another outbound in session ctx
if h != nil {
- ur, uw := pipe.New(pipe.OptionsFromContext(ctx)...)
- dr, dw := pipe.New(pipe.OptionsFromContext(ctx)...)
+ ur, uw := pipe.New(pipe.WithSizeLimit(0))
+ dr, dw := pipe.New(pipe.WithSizeLimit(0))
go h.Dispatch(ctx, &transport.Link{Reader: ur, Writer: dw})
nc := cnc.NewConnection( please confirm. I don't think it's an appropriate fix though. |
@mmmray although i guess dialer proxy accumulate multiple udp packet into buffer is it safe to use |
I think it may hurt other configs that use dialerProxy, I haven't looked into a proper fix yet. It's probably a good idea to test it a bit with things like fragment and other common scenarios that may use dialerProxy. |
@mmmray I see you at least mentioned |
@X-Oracle @GFW-knocker please test #3570, I think it fixes this issue but I have not done a thorough speedtest. |
@mmmray |
#3570 has been merged so this should also be fixed now |
unlike sing-box, speed is very slow when chaing wireguard-outbound (using
dialerProxy
) to another outboundin xray-core, unlike sing-box (usingdetour
).The text was updated successfully, but these errors were encountered: