Pangolin performance via Newt #512
Replies: 37 comments 73 replies
|
Is nobody else experiencing this problem ? |
|
I'm having the same issue. Maybe the problem is with Traefik( or gerbil ??)since the issue persists even locally. Some people have fixed it by switching VPS. Temporarily, I solved it by enabling the Cloudflare Proxy, which tripled my upload speed. |
|
I’m also experiencing a severe performance issue with my Pangolin/Newt/Gerbil setup, and I can’t understand why. It works flawlessly for serving low-bandwidth workloads (websites) — it's great, and I love it. My setup is as follows:
What I’ve tried to identify the root cause:Suspected CPU bottleneck (WireGuard overhead)I initially suspected that Newt and/or Gerbil/Traefik were CPU-bound due to WireGuard overhead. Suspected bandwidth bottleneckI ran
Everything seems to have a decent internet connection. Suspected network throughput between componentsI deployed
So everything seems to have proper link speed internally despite the abstraction layers (VMs, Docker, VPS). When monitoring Given the above, it doesn’t appear to be a CPU, RAM, or bandwidth issue — which leaves us with either the Newt/Gerbil/Traefik codebase or their configuration. Let me know if you need more details or logs — I’d be happy to help debug this further. |
|
btw. i would like to share my workaround until we have this. It´s simple. Basically let every service/ressource have it´s own newt tunnel/sites. |
|
I've been pulling my hair out over this until I found this discussion. I had no problems at all for several months, but only with low-bandwidth services. Recently I added my photo library to the setup, and then realized I'm not able to stream any videos reliably. The behavior I see is consistently the following: with larger files, the initial transfer speed is high for a few seconds (meaning a few megabytes), and then it rapidly drops to unacceptable levels (around 10 kb/s!). After a quite long time (1-2 minutes) it equally rapidly starts to pick up speed again and then keeps saturating my line until the transfer is complete (several mb/s). If I interrupt the transfer and restart, it starts all over again with the same behavior. During the time it's only dripping, the load on the VPS is non-existent. Once it picks up speed again I see Traefik at ~25% CPU. I did extensive testing to check for bandwidth and speeds all along the setup, and I'm able to saturate my public line to and from the VPS (Strato Germany) no matter what (raw transfer through SCP, with or without Docker etc.). I'm also able to max out the local GBit network when I access the services only locally. It doesn't sound like the exact symptoms you describe, but similar in that I cannot find any issues at any stage of the setup, but when I add Newt to the equation it reproducible shows this behavior. |
|
I migrated my Pangolin instance from the default SQLite database (pangolin:1.12.2) to a PostgreSQL backend (pangolin:postgresql-1.12.2). It was definitely worth trying, and the performance boost for the UI and static pages is appreciated. |
|
This discussion seems to be one of the most active ones, yet I haven’t seen this issue being addressed. I used to really like Pangolin, but it’s time for me to move on from the project. Thank you very much for everything so far. I wish the project and everyone involved all the best — and as they say, paths always cross again. |
|
After struggling with inconsistent throughput over Newt, I switched to a Basic WireGuard Site. Setup was pretty painless and immediately fixed the “bursty stall/buffering” behavior for long-lived streams. ProblemPersistent connections would stall in bursts over Newt tunnels (CPU wasn’t pegged). Shorter/lower-bitrate flows were ok which strongly pointed to PMTU/fragmentation (TCP bursts + long stalls). FixUse a Basic WireGuard Site and route traffic over kernel WireGuard. Key points:
Solution1) Create a Basic WireGuard Site in Pangolin
Note: the server-side WG interface may live inside the docker exec -it gerbil ip -br addr # should show wg0 with e.g. 100.89.x.x/242) Point the resource upstream to the WG peer IP (NOT the LAN IP)In Pangolin, set the resource Target/Upstream to: 3) On the WG peer gateway: DNAT only what you need to {TARGET_IP}:{PORT}Put the following in /etc/wireguard/wg0.conf on the WG peer (replace {TARGET_IP}, {PORT}, and your LAN interface name if it’s not eth0): [Interface]
Address = <WG_PEER_IP_CIDR>
PrivateKey = ...
MTU = 1280
# Forward <PORT> from WG -> target
PostUp = sysctl -w net.ipv4.ip_forward=1
PostUp = iptables -t nat -A PREROUTING -i %i -p tcp --dport <PORT> -j DNAT --to-destination <TARGET_IP>:<PORT>
PostUp = iptables -t nat -A POSTROUTING -o eth0 -p tcp -d <TARGET_IP> --dport <PORT> -j MASQUERADE
PostUp = iptables -A FORWARD -i %i -o eth0 -p tcp -d <TARGET_IP> --dport <PORT> -j ACCEPT
PostUp = iptables -A FORWARD -i eth0 -o %i -p tcp -s <TARGET_IP> --sport <PORT> -j ACCEPT
# MSS clamp (prevents PMTU blackholes / burst-stall behavior)
PostUp = iptables -t mangle -A FORWARD -i %i -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
PostUp = iptables -t mangle -A FORWARD -o %i -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
PostDown = iptables -t nat -D PREROUTING -i %i -p tcp --dport <PORT> -j DNAT --to-destination <TARGET_IP>:<PORT>
PostDown = iptables -t nat -D POSTROUTING -o eth0 -p tcp -d <TARGET_IP> --dport <PORT> -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -o eth0 -p tcp -d <TARGET_IP> --dport <PORT> -j ACCEPT
PostDown = iptables -D FORWARD -i eth0 -o %i -p tcp -s <TARGET_IP> --sport <PORT> -j ACCEPT
PostDown = iptables -t mangle -D FORWARD -i %i -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
PostDown = iptables -t mangle -D FORWARD -o %i -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu4) Persist across rebootssystemctl enable --now wg-quick@wg0 Quick sanity checks |
|
Same issue here. |
|
Yeah, I’ve been running into the same issue with large file streams. I also tried replacing Newt with a plain WireGuard connection, but unfortunately the speeds still dropped quite a bit. For now, I’ve had to switch to a different tool for the affected applications. Really hoping this gets improved at some point. Everything else works great, so it would be amazing to see this resolved. |
|
Same issue here. I understand there's likely no easy fix, bu it seems like a pretty critical issue. |
|
I've encountered same issue. Using a 2vCPU VPS with Pangolin installed and running on it. Newt, as a service on my Win11P box. Have nice 'elegant' solution that I can point to (plex.mydomain.com, overseer.mydomain.com, etc.) but Plex streaming is limited to 720p/4mbps through the Newt tunnel... I've had to switch out to Tailscale which isn't quite as elegant, as it requires something installed on my Plex users' machines. I too would really like to see this resolved as Pangolin is a super-neat solution otherwise. |
|
Same here. Streaming 4K over newt is impossible. Working ok on standard Wireguard. |
|
Racknerd 2vcpu streaming 4k was working but it took good minute to start switched to std WireGuard and its almost instant |
|
I'd love to see a straightforward set of instructions for having Pangolin on a VPS, and setting up a WG client at the Windows 11 end... I can't be the only one with this setup (currently with Newt, and struggling with the speed for streaming media). I'm using Tailscale now which does work but I'd like to make use of the VPS I'm paying for. Everyone says setting a WG tunnel up is the answer but I can't find anywhere that instructs exactly how to do it - I mean, like I'm an idiot and have no experience of WG. They either have Windows at both ends or a Linux distro where my Win 11 box is... Please? |
|
Not sure if anyone else has noticed a difference but since I updated Newt to v1.10.0 and Pangolin (self hosted on a VPS) to v.15.4 - things have markedly improved and I'm able to now stream directly from my media server at 1080p/12mbps (previously I couldn't achieve anything above 720p/4mbps, as many above have also mentioned). Perhaps someone else can join these dots as to which is having the desired effect, but I installed Newt using the newt_windows_installer.exe as opposed to the previous version I had, which was just the Newt.exe - (always been installed/set-up as a service on Win 11 Pro). This time around, I noticed the installer also installed wintun.dll, along with Newt.exe. Now, I do remember some mention of perhaps needing wintun.dll in the Pangolin/Newt docs but as Newt 'appeared' to be working ok, I didn't think any more about it at the time. Maybe it's the new version of Newt or maybe it's the inclusion of the wintun.dll into the Newt directory this time around but so far, it's working really well for me now and just what I wanted it to be. Thanks 🙏🏻 |
|
Hey all, I wanted to jump in as one of the newest members of the Pangolin team to keep communication clear on this issue. I know this has been open for a while, but a lack of active replies does not mean this discussion has been deprioritized. @oschwartz10612 has an active task to investigate and improve performance, and I've also opened follow-up tasks to improve Go-side performance over time. The performance work merged into dev so far includes: In Newt, we currently use two WireGuard netstack implementations: netstack and netstack2. The main tunnel to Gerbil is still using netstack, while child/downstream tunnels use netstack2, which contains the newer performance improvements. A full switch is not just a simple toggle. Even though the implementations are compatible, we still need proper test coverage before promoting this broadly, to avoid inconsistencies or regressions. |
|
@LaurenceJJones Just to clarify, this did not make it into 1.10.2 or 1.10.3, right? |
|
I tried a lot of things including Newt inside Docker, outside docker, a direct connection (ie DNS to open port without pangolin) and ultimately Pangolin + Wireguard Basic connecting to a Unifi Router. What's pretty clear is that VPS performance and also Host performance play a minor role. When using immich, I was getting top speeds with a direct connection and with wireguard basic. It goes up to 25MBsec and beyond, but it still starts pretty slow, i.e 600KBsec-3MBsec. That's apparently a TCP limitation and after about 20 seconds or so it should go through the roof. Wireguard basic gives me much better speeds than newt overall. So I'm happy it works and that I can keep using Pangolin that way. Interestingly, downloading a large file via Nextcloud will work with 15MBsec using both Newt and WG-Basic, but WG has less fluctuations. Here the difference is somehow minor compared to immich. I suspect Nextcloud Overhead but who knows... |
|
Food for thought...speed while using Pangolin in some situations may have little to do with Pangolin or newt. Some CGNAT's don't play well with UDP—especially when it comes to video streaming. WireGuard is always over UDP. In order to test if UDP behind a CGNAT is impacting speed, try accessing a resource behind an SSH reverse tunnel (which is always over TCP) and compare the speed to accessing the resource behind Pangolin. For example, Jellyfin over a reverse SSH tunnel: |
|
Hey, Edit: |
|
I moved my whole install from a Docker for Windows Setup to a Ubuntu VM on Proxmox Setup. Very comparable hardware, but now I'm getting much faster speeds with newt than with wireguard. It makes almost zero sense. I can now start downloading a file with 8MBsec and it goes up to 25MBsec and beyond quickly instead of starting with 600KBsec via Newt previously or 900KB via WG previously and taking 30secs before reaching better speeds. So NOW the experience is much better because the buffering is almost nothing at all. I suppose the TCP backend on linux machines is much better than on Windows. |
|
I'd just like to add my voice to this discussion as I've just discovered it. I wrote a decently detailed report in issue #2905 on when I started experiencing this issue and what I tried doing. Hopefully it helps even a tiny bit. I'm still having the issue unfortunately, and my experiences mirrors that of many here - decent initial burst of speed, but then almost immediately slows to a trickle - but I have learned from this discussion thread that I should try setting the site up as a wireguard connection instead of using Newt. I'll give that a try next. |
|
I am more and more convinced that we need Newt and Gerbil to use a native, kernel-spaced wireguard interface for us to have decent link speed. I think the bottleneck we are seeing is linked to the Docker + wireguard-go user-spaced implementation introducing too much context-switching. As mentioned in 2356, Newt has the USE_NATIVE_INTERFACE variable, but Gerbil does not. I haven't seen any improvement after activating USE_NATIVE_INTERFACE on Newt, so maybe the bottleneck is on Gerbil side ? |
|
It's really a bizarre issue... Happy to help out if anybody wants to know anything. |
|
I was having this issue on truenas, I converted newt to a custom app to run as root with USE_NATIVE_INTERFACE and got a 10x bandwidth improvement, from 2MB/s to 20MB/s. Truenas is using an old little intel C2750 cpu. I tried network_mode: host as well but that didn't help. |
|
In meanwhile I've done it all, sysctl optimizations, ethtool scripts, USE_NATIVE_INTERFACE=true with Newt. Finally I've come to the following (perhaps obvious) conclusion:
|
|
Yeah USE_NATIVE_INTERFACE is not really a supported option right now. It
only makes a interface on the host so you can address the peer by its peer
IP instead of the resources but it breaks everything else. We leave it
undocumented because it is not a full feature quite yet.
I agree I think we need to bump the specs on the website - will do.
|
@oschwartz10612 Are there any disadvantages when the user set up the routing by himself on the newt host like in https://github.com/orgs/fosrl/discussions/512#discussioncomment-17356826 ? |




Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
First of all, thanks for the great work on Pangolin – I really like how clean and straightforward it is to set up.
I’m currently testing Pangolin in a fairly performant setup:
• Home connection: 1 Gbit fiber
• VPS: 2.5 Gbit throughput
• Service behind Pangolin: Pingvin Share (self-hosted file sharing tool)
The problem I’m running into is related to throughput performance. When I upload a file to Pingvin through Pangolin, I only get about 4 MB/s (≈32 Mbit/s), and the speed occasionally drops even further. The same happens when I try to download the file back – it’s consistently low and doesn’t reflect the bandwidth I actually have on either side.
So now I’m wondering:
Where’s the bottleneck? Is it:
• A known limitation or default setting in Pangolin?
• Related to WireGuard performance under load?
• Possibly something in the configuration (like MTU size, buffer sizes, etc.)?
I’d really appreciate if someone could share similar experiences, tuning tips, or diagnostic steps I might try.
Thanks in advance!
Alex
All reactions