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

异常包的处理,导致cpu占用率达到100% #10

Closed
someonebw opened this issue May 12, 2017 · 5 comments
Closed

异常包的处理,导致cpu占用率达到100% #10

someonebw opened this issue May 12, 2017 · 5 comments

Comments

@someonebw
Copy link

someonebw commented May 12, 2017

异常包体如下:
导致异常包体.txt

#测试版本:1.5.0.7---1.5.0.10
#通过burp进行发包。
#正常处理请求回复时间在30ms左右,这条处理异常的情况,时间达到了60s+
#截图如下:
qq 20170512095021

@someonebw
Copy link
Author

nginx 的worker进程,cpu占用100%的时候,通过工具,抓取的信息如下:
#./ngx-sample-lua-bt
#########
[root@localhost openresty-systemtap-toolkit]# more tmp_ok.bt
C:ngx_http_lua_ngx_re_find
optl:remath
access_all.lua:1
56414
C:ngx_http_lua_ngx_req_read_body
optl:get_posts
access_all.lua:1
1
[root@localhost openresty-systemtap-toolkit]# history |grep sample
#########
生成的火焰图如下:
qq 20170512110042

最后定位到是
optl.lua
里面的
#local function remath(_str,_re_str,_options)
导致的。

remath函数最后的
qq 20170512110408

qq 20170512110433

@starjun
Copy link
Owner

starjun commented May 12, 2017

3Q , 测试复现该问题,发现目前仅在单核、CPU比较差时会出现,暂时就升级服务器配置吧,后续可能会对ngx.re.find执行时长进行限制。

@starjun starjun closed this as completed May 12, 2017
@someonebw
Copy link
Author

行吧。
机器配置:
[root@localhost logs]# cat /proc/cpuinfo |grep 'model name'
model name : Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
model name : Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
model name : Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
model name : Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz

@starjun
Copy link
Owner

starjun commented May 12, 2017

线上服务器测试都正常,配置在搞些吧,哈
没问题的虚机:
model name : Intel(R) Xeon(R) CPU E5-26xx v3
model name : Intel(R) Xeon(R) CPU E5-26xx v3
model name : Intel(R) Xeon(R) CPU E5-26xx v3
model name : Intel(R) Xeon(R) CPU E5-26xx v3

有问题的阿里云:
model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz

@someonebw
Copy link
Author

是不是openresty的问题哦,还挑cpu?

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