Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libp2p stream limit settting #399

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

songxiang93
Copy link

What type of PR is this?

/kind feature Add libp2p stream limit settting

对libp2p stream扩展为默认可配置项
libp2p的resourcemanger默认的对所有的protocol进行流的限制。
https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/limit_defaults.go
参考源码,libp2p对protocol协议的限制主要分为以下两种:
1、针对协议的入栈出栈的流个数的限制
2、针对协议的每一个peer入栈出栈的流个数进行限制
最终针对协议的最终流个数限制为:
基础流个数+scale的扩展流个数。scale的扩展会根据每GB内存大小进行额外的扩容。
将基础流个数作为可配置项,并且设置为默认值,防止在中继过程中,遇到流被重置的问题。实测默认情况下,4-5个网页会触发stream reset。

@kubeedge-bot kubeedge-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 6, 2022
@kubeedge-bot
Copy link
Collaborator

@songxiang93: The label(s) kind/add, kind/libp2p, kind/stream, kind/limit, kind/settting cannot be applied, because the repository doesn't have them

In response to this:

What type of PR is this?

/kind feature Add libp2p stream limit settting

对libp2p stream扩展为默认可配置项
libp2p的resourcemanger默认的对所有的protocol进行流的限制。
https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/limit_defaults.go
参考源码,libp2p对protocol协议的限制主要分为以下两种:
1、针对协议的入栈出栈的流个数的限制
2、针对协议的每一个peer入栈出栈的流个数进行限制
最终针对协议的最终流个数限制为:
基础流个数+scale的扩展流个数。scale的扩展会根据每GB内存大小进行额外的扩容。
将基础流个数作为可配置项,并且设置为默认值,防止在中继过程中,遇到流被重置的问题。实测默认情况下,4-5个网页会触发stream reset。

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubeedge-bot
Copy link
Collaborator

Welcome @songxiang93! It looks like this is your first PR to kubeedge/edgemesh 🎉

@kubeedge-bot kubeedge-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 6, 2022
@Poorunga Poorunga closed this Nov 7, 2022
@Poorunga Poorunga reopened this Nov 7, 2022
Signed-off-by: Song Xiang <sxiang@ruijie.com.cn>

Fix blank space problem

Signed-off-by: Song Xiang <sxiang@ruijie.com.cn>

Fix blank space problem

Signed-off-by: Song Xiang <sxiang@ruijie.com.cn>
@Poorunga
Copy link
Member

Poorunga commented Nov 7, 2022

/lgtm

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2022
@Poorunga
Copy link
Member

Poorunga commented Nov 7, 2022

/approve

@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Poorunga

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

The pull request process is described here

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

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 7, 2022
@kubeedge-bot kubeedge-bot merged commit ab98de7 into kubeedge:main Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants