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

slide win: too many packs问题 #384

Open
teddywarm opened this issue Mar 15, 2021 · 5 comments
Open

slide win: too many packs问题 #384

teddywarm opened this issue Mar 15, 2021 · 5 comments

Comments

@teddywarm
Copy link

我将一个超大音视频文件放在nginx,并且设定limit rate 为10m,让online server回源拉取音视频数据,同时将数据拷贝到target server,但是一段时间后tcpcopy进程与测试机上服务的连接被tcpcopy进程reset,重新启动服务后在短时间内又被tcpcopy进程reset,同时tcpcopy日志中打印了这个slide win: too many packs问题,请不吝赐教这个问题应该怎么解决。

@wangbin579
Copy link
Member

too many packs,代表这个session缓存了太多数据包,跟不上线上处理的节奏。

TCPCopy更适合于请求小的场景,那种大文件上传类似的应用,很容易发生slide win: too many packs,从而引起内存暴增和出现抓包丢包(需要利用其它高效抓包机制)等一系列问题。

解决方案可能有如下:
1、修改源代码

static inline int
overwhelm(tc_sess_t *s, const char *m, int max_hold_packs, int size)
中的
if (size < max_hold_packs && size <= MAX_SLIDE_WIN_THRESH) {
这一行

以后这种需求多了,会参数化。

2、查看网卡是否可以超过1500大小传输,如果可以设置-M参数,加大单个数据包传递大小。

@wangbin579
Copy link
Member

测试机器和线上机器不能相隔太远,否则速度会更加不匹配

@teddywarm
Copy link
Author

测试机器和线上机器不能相隔太远,否则速度会更加不匹配

你好,我在源码中已经将static inline int
overwhelm(tc_sess_t *s, const char *m, int max_hold_packs, int size)这个函数隔离,直接返回NOT_YET_OBSOLETE。这样的话不会报slide win: too many packs这个问题。我在将下载速度调整到2000kb/s,tcpcopy进程占用的cpu只有1,但是我将速度调整到3000kb/s以上后,tcpcopy占用cpu就达到100。请问cpu主要被使用在tcpcopy进程哪个地方?怎么去降低tcpcopy对cpu的负载。

@teddywarm
Copy link
Author

测试机器和线上机器不能相隔太远,否则速度会更加不匹配

你好,我在源码中已经将static inline int
overwhelm(tc_sess_t *s, const char *m, int max_hold_packs, int size)这个函数隔离,直接返回NOT_YET_OBSOLETE。这样的话不会报slide win: too many packs这个问题。我在将下载速度调整到2000kb/s,tcpcopy进程占用的cpu只有1,但是我将速度调整到3000kb/s以上后,tcpcopy占用cpu就达到100。请问cpu主要被使用在tcpcopy进程哪个地方?怎么去降低tcpcopy对cpu的负载。

麻烦bin上机器不能相隔太远,否则速度会更加不匹配

你好,我在源码中已经将static inline int
overwhelm(tc_sess_t *s, const char *m, int max_hold_packs, int size)这个函数隔离,直接返回NOT_YET_OBSOLETE。这样的话不会报slide win: too many packs这个问题。我在将下载速度调整到2000kb/s,tcpcopy进程占用的cpu只有1,但是我将速度调整到3000kb/s以上后,tcpcopy占用cpu就达到100。请问cpu主要被使用在tcpcopy进程哪个地方?怎么去降低tcpcopy对cpu的负载。

麻烦斌哥指点一下

@wangbin579
Copy link
Member

wangbin579 commented Mar 18, 2021

目前tcpcopy是单线程的,主要处理处理两种数据包:到线上服务器的数据包和测试服务器返回的数据包。如果线上服务器数据包过多,会造成tcpcopy忙于抓包,进而导致处理失衡。

至于cpu出现有1和100,没有具体更多信息,无法分析。

还有,千万别去复制性能测试的数据包,那数据包时间间隔太短,会导致tcpcopy跟不上性能测试的节奏

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

No branches or pull requests

2 participants