Skip to content

[feat][proxy] Support proxy limit maximum connections per IP - #17167

Merged
Technoboy- merged 19 commits into
apache:masterfrom
mattisonchao:support_proxy_max_connection_per_ip
Aug 29, 2022
Merged

Technoboy- merged 19 commits into
apache:masterfrom
mattisonchao:support_proxy_max_connection_per_ip

Conversation

@mattisonchao

Copy link
Copy Markdown
Member

Motivation

Pulsar has the brokerMaxConnectionsPerIp configuration at the
broker, we can use it to limit the maximum connections per IP.

The original motivation and PR here: #10754

IMO, we can also apply it to pulsar-proxy, because when a large
number of proxy accesses under the same IP (maybe due to some wrong
operations) will cause the proxy to accept too much wrong traffic and
cause service unstable.

Discussion link: https://lists.apache.org/thread/co00zx8ns3ksbccxs82lfh624rx1sht6

Modifications

  • Reuse ConnectionController for proxy part.
  • Move ConnectionController to broker-common module.
  • Add proxy configuration maxConcurrentInboundConnectionsPerIp
  • Send ServerError.NotAllowedError command to prevent client reconnecting.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@mattisonchao
mattisonchao marked this pull request as ready for review August 19, 2022 01:33
@mattisonchao mattisonchao self-assigned this Aug 19, 2022
@mattisonchao mattisonchao added this to the 2.12.0 milestone Aug 19, 2022

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Technoboy- Technoboy- added type/feature The PR added a new feature or issue requested a new feature area/proxy labels Aug 24, 2022

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicoloboschi nicoloboschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Technoboy-
Technoboy- merged commit ce522cd into apache:master Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/proxy type/feature The PR added a new feature or issue requested a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants