Repository navigation
Description
Hi,
I'v setup the tunnel node on my VPS(France) , I have nginx with letsencrypt certificate in place and it is working and receives requests as expected, but it is very slow (below 30 Kilobytes/s) compared to my other apps_script and cloudflare worker setup.
I was checking the logs of my nginx setup today(/var/log/nginx/error.log) where I see lots of warnings like this:
[warn] 6736#6736: *813 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/5/04/0000000045 while reading upstream, client: 34.116.28.165, server: fwd.mydomain.com, request: "POST /tunnel/batch HTTP/1.1", upstream: "http://127.0.0.1:8080/tunnel/batch", host: "fwd.mydomain.com"
and in my mhrv-rs(version 1.9.18) I see error logs like this:
ERROR batch failed (script AKfycbx-): got the v1.8.0 decoy/placeholder body — could be (1) AUTH_KEY mismatch between mhrv-rs config and Code.gs (run a direct curl probe against the deployment to verify), (2) Apps Script execution timeout or per-100s quota tear (try lowering parallel_concurrency in config), (3) Apps Script internal hiccup (transient, retry next batch), or (4) ISP-side response truncation (#313 pattern, try a different google_ip). To distinguish (1) from the rest: set DIAGNOSTIC_MODE=true at the top of Code.gs + redeploy as new version — only AUTH_KEY mismatch returns this body in diagnostic mode.
I also tried the set up without nginx and on the default 8080 port (my.vps.ip.address:8080). I don't think it is related to nginx since using the tunnel node directly gives the same results, but I thought maybe there is something useful in the nginx log above .
I have three seperate Code.gs deployments(different accounts) in place all with the same config, I double checked the AUTH_KEY, and they all match my config.js file. And I do not know about another google_ip that works (just the one that nslookup returns) . But I don't think it is related to the google_ip or google sni either, since my apps_script and cloudflare setups use the same ip and sni. My guess is there is something wrong between the Code.gs and my vps.
Some rare occasions I see a spike in loading speed around 2 or 3 Mgabytes/Sec but quickly it slumps below 30 Kilobytes/s .
Do you know what the problem is and how to solve it?
Activity
ehsan272727 commentedon May 9, 2026
I also did the VPS method fo Full tunnel mode and it just doesn't work
behnamgolds commentedon May 9, 2026
@ehsan272727 create a new issue and provide more info (logs, versions, etc..) .
There is a big green button at the top right corner of this page.
therealaleph commentedon May 9, 2026
Reviewed via Anthropic Claude.
@behnamgolds — useful data point. Two separate things in your report:
1. nginx
proxy_bufferingwarning (the temp-file write):That warning is informational, not the root cause of the 30 KB/s. It means the tunnel-node response exceeded
proxy_buffer_size(default 4-8 KB depending on platform) so nginx spilled to disk. For a relay where every batch can be up to 32 MiB (after v1.9.16'sBATCH_RESPONSE_BUDGET), that's expected. To eliminate it, increase nginx's buffer config for this server block:The two
proxy_*_buffering offdirectives are the important ones — without them, nginx sits on the entire batch before forwarding, defeating the point of streaming.2. The v1.8.0 decoy/placeholder body (the one you got even WITHOUT nginx):
This is the actual perf killer. Code.gs returns this body when its
UrlFetchApp.fetch(TUNNEL_SERVER_URL)call throws an exception — timeout, connection refused, response too large, etc. mhrv-rs's error message lists 4 possible causes:Given your specific setup (nginx, France VPS, 30 KB/s, 3 deployments), the likely cause is response-size: Apps Script
UrlFetchApphas a hard 50 MiB response body cap. If your tunnel-node returns a batch larger than 50 MiB,UrlFetchAppthrows, Code.gs'stry/catchsends the decoy. v1.9.16 added a 32 MiB total-batch budget on the tunnel-node side specifically to prevent this; if you're on v1.9.18 + recenttunnel-node:latestDocker image, that should hold.Diagnostic steps that would narrow it down:
Direct curl probe against your deployment (not via mhrv-rs):
{"results":[{"r":"pong"}]}→ AUTH_KEY is fine and Code.gs ↔ tunnel-node is reachable. The slowness is somewhere in the streaming.TUNNEL_SERVER_URLconstant).Watch tunnel-node logs while running mhrv-rs:
When the slowdown / decoy error fires in mhrv-rs, what's tunnel-node's log line at the same moment? Is it returning a successful batch JSON (size?) or erroring?
Pull
tunnel-node:latestagain — you might be on an older image. v1.9.16+ has theBATCH_RESPONSE_BUDGETfix for updating steam on full mode #863:France VPS routing: Apps Script runs on Google's network. If your tunnel-node is in France and Apps Script's regional edge (often US/EU) routes to it through congested transit, you'll see slow batches. The مشکل حالت فول تانل vps از نسخه ۱.۹.۱۵ به بعد #924 thread has a hypothesis that nginx-as-reverse-proxy interacts badly with h2 inner connections in v1.9.15+ — could be relevant here even on the without-nginx case if there's some intermediate Cloudflare / OVH / Hetzner network policy.
Pinning #924 as the canonical Full Tunnel slowness tracker. Could you post:
docker inspect mhrv-tunnel | grep -i imageLeaving open as one of the canonical Full Tunnel slowness reports. Thanks for the detailed nginx logs — exactly what we needed.
Stazzical commentedon May 10, 2026
would adding an option to disable H2 connections be helpful somehow to see if that's the cause of slowness?
mirbaagheri commentedon May 10, 2026
#1038 @therealaleph
behnamgolds commentedon May 11, 2026
Sorry for the delay, since script.google.com is not available directly and I wanted to rule out the problems related to using a proxy , had to go somewhere that script.google.com is reachable.
I tested the curl command, but it gives http Code 302 (moved Temporarily) :
My guess is something has changed google side, like flagging my scripts as suspocious since I opened this issue. My other configs (plain Code.gs and CFW) do not work either.
behnamgolds commentedon May 11, 2026
I opened this link provided in the output above in my browser:
the result:
behnamgolds commentedon May 11, 2026
And I forgot to say , nothing reaches nginx/tunnel-node right now, but I dont think it is relevant right now.
behnamgolds commentedon May 11, 2026
In the mean time I ignored the curl since it is not working as expected, I changed the nginx conf as you suggested (I had http2 mode on too so I changed it to off). I don't use docker, just downloaded the lates release 1.9.21 for the client and compliled the tunne-node again.
this is my nginx.conf:
No warinns related to nginx about writing buffer to disk appears anymore. but the slowness is still there.
this is some lines of nginx access.log :
This is a chunk of the tunnel-node log(removed the first part of each lines and kept the interesting parts):
The interesting part in the log is
closed by clientwhile I tried to open httpbin