Skip to content

Tunnel Node behind NGINX(and also directly) is very slow #950

@behnamgolds

Description

@behnamgolds

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions