Skip to content

memory, config: reject connections when memory usage is high#1120

Open
djshow832 wants to merge 1 commit intopingcap:mainfrom
djshow832:reject_conn
Open

memory, config: reject connections when memory usage is high#1120
djshow832 wants to merge 1 commit intopingcap:mainfrom
djshow832:reject_conn

Conversation

@djshow832
Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #1119

Problem Summary:
TiProxy may OOM when the connection count is too large

What is changed and how it works:

  • Reject new connections when memory usage is too high
  • Report unhealthy on the status port when the memory usage is too high

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

- Reject connections and report unhealthy when the memory usage is too high

@ti-chi-bot ti-chi-bot bot requested a review from xhebox April 2, 2026 14:13
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xhebox for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot requested a review from YangKeao April 2, 2026 14:13
@ti-chi-bot ti-chi-bot bot added the size/XL label Apr 2, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 26 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@30d5b3f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/manager/memory/memory.go 62.06% 15 Missing and 7 partials ⚠️
pkg/proxy/proxy.go 83.33% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1120   +/-   ##
=======================================
  Coverage        ?   67.17%           
=======================================
  Files           ?      144           
  Lines           ?    15158           
  Branches        ?        0           
=======================================
  Hits            ?    10183           
  Misses          ?     4276           
  Partials        ?      699           
Flag Coverage Δ
unit 67.17% <71.42%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@djshow832
Copy link
Copy Markdown
Collaborator Author

@codex review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject new connections when the memory usage is high

2 participants