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

运行一段时间后性能开始降低 #34

Open
hhxsv5 opened this issue Mar 15, 2017 · 6 comments
Open

运行一段时间后性能开始降低 #34

hhxsv5 opened this issue Mar 15, 2017 · 6 comments

Comments

@hhxsv5
Copy link
Contributor

hhxsv5 commented Mar 15, 2017

Hi garveen,
最近升级laravoole后,发现运行一段时间后,性能开始降低,耗时从最初的60ms增加的2s,每次restart后才恢复正常,但好景不长。

laravoole 5.1, swoole 1.9.6

一张请求耗时图,其中接近18点时进行了restart。
image

我首先考虑到的是内存问题,然后分别在restart后和出问题时得到了内存占用情况。
刚开始运行时的内存占用:
1

性能降低时的内存占用:
2

确实内存增量很大,然后开始检查业务代码有没有内存泄漏隐患,但没发现
swoole内存管理

所以考虑是不是laravoole这层有问题,比如在clean中需要unset清理一些大数组、容器、实例。

请协助一起看看。

谢谢!

@garveen
Copy link
Owner

garveen commented Mar 15, 2017

你跑的是哪个模式,以及业务代码用了哪几个facade?
临时性的方案,可以用max_request自动重启

@hhxsv5
Copy link
Contributor Author

hhxsv5 commented Mar 15, 2017

SwooleFastCGI,Facade:太多了,大部分都在用。

max_request默认就是2000哇
'max_request' => env('LARAVOOLE_MAX_REQUEST', 2000),

@hhxsv5
Copy link
Contributor Author

hhxsv5 commented Mar 15, 2017

貌似Response里面header和cookie有问题呢,无限追加,没有清理。

@hhxsv5
Copy link
Contributor Author

hhxsv5 commented Mar 16, 2017

回滚版本到0.2.8后,未出现这问题。
可能0.3.1的改动有关。

@garveen
Copy link
Owner

garveen commented Mar 16, 2017

我自行测试未能重现,\Laravoole\Response在SwooleFastCGI下不会创建实例,我自己跑循环请求fastcgi也没问题
你说的header和cookie是从哪获得的,整个系统里面和这俩相关的类太多了

@hhxsv5
Copy link
Contributor Author

hhxsv5 commented Mar 16, 2017

应该是手动处理max_request带来的问题

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