Skip to content

fix(proxy): disable buffering for sandbox streams#295

Open
josh-cow wants to merge 1 commit into
TencentCloud:masterfrom
josh-cow:fix-cubeproxy-stream-buffering
Open

fix(proxy): disable buffering for sandbox streams#295
josh-cow wants to merge 1 commit into
TencentCloud:masterfrom
josh-cow:fix-cubeproxy-stream-buffering

Conversation

@josh-cow
Copy link
Copy Markdown

Patch for nginx config:

  • Adds proxy_buffering off;
  • Adds proxy_request_buffering off;
  • Applies to both HTTP and HTTPS CubeProxy sandbox locations in CubeProxy/nginx.conf

Interactive envd Connect streams (PTY) need chunks flushed immediately. With CubeProxy’s global proxy_buffering on, long-lived PTY streams can receive input but not deliver output
promptly.

Validated:

  • nginx -t inside the running cube-proxy container passed.
  • After reload, direct envd Process/Start returned 200 and streamed the start frame immediately.

@kinwin-ustc
Copy link
Copy Markdown
Collaborator

CubeSandbox is not just for envd, there are also scenarios where buffers are needed, and perhaps we need to clearly distinguish which requests require buffers and which are not

@staryxchen
Copy link
Copy Markdown
Collaborator

Thanks for the contribution @josh-cow. proxy_buffering and proxy_request_buffering are two global directives that proxy all sandbox traffic, not just envd streams. So I suggesting fixing this at the response level via setting X-Accel-Buffering: no from envd, or by adding a dedicated streaming-only location.

@josh-cow
Copy link
Copy Markdown
Author

Thanks for the contribution @josh-cow. proxy_buffering and proxy_request_buffering are two global directives that proxy all sandbox traffic, not just envd streams. So I suggesting fixing this at the response level via setting X-Accel-Buffering: no from envd, or by adding a dedicated streaming-only location.

@kinwin-ustc @staryxchen
Make sense. are you on the plan ? Or may I draft the changes? Thanks.

@kinwin-ustc
Copy link
Copy Markdown
Collaborator

I think you can continue to modify in this direction

@staryxchen
Copy link
Copy Markdown
Collaborator

Thanks for the contribution @josh-cow. proxy_buffering and proxy_request_buffering are two global directives that proxy all sandbox traffic, not just envd streams. So I suggesting fixing this at the response level via setting X-Accel-Buffering: no from envd, or by adding a dedicated streaming-only location.

@kinwin-ustc @staryxchen Make sense. are you on the plan ? Or may I draft the changes? Thanks.

Hi @josh-cow, I have raised an issue (e2b-dev/infra#2707) to envd, but haven’t received a response yet. So I think you can working on the Cube side (adding a dedicated streaming-only location) first to workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants