Linux流程退出需要太长
这是我的问题,当我将kill
命令发送到我的过程时,无论kill -9
或kill -term
,我的过程步骤都进入Zombie (已删除)需要父亲进程来调用waitpid
以获取退出状态的统计数据。但是大约需要5-7秒,这太长了。
$ ps -ef | grep store
web_ser+ 2793 1 30 May24 ? 1-12:13:45 [my_test] <defunct>
web_ser+ 45462 33954 0 20:22 pts/0 00:00:00 grep --color=auto store
但是,当我使用pstack
打印父亲过程时,它仍然在waitpid
中封锁:
$ pstack 46046
#0 0x00007ffa2d078dbc in waitpid () from /lib64/libc.so.6
#1 0x00000000004012c3 in main ()
我不知道为什么要退出这么多时间,此过程使用70克记忆,也许是因为回收记忆,但我不知道找到问题,有人可以给出一些想法吗?
Here is my problem, when I send kill
command to my process, no matter kill -9
or kill -TERM
, my process steps into zombie(defunct) stats which needs the father process to call waitpid
to catch the exit status. But it takes about 5-7 seconds which is too long.
$ ps -ef | grep store
web_ser+ 2793 1 30 May24 ? 1-12:13:45 [my_test] <defunct>
web_ser+ 45462 33954 0 20:22 pts/0 00:00:00 grep --color=auto store
However, when I use pstack
to print the father process, its still block in waitpid
:
$ pstack 46046
#0 0x00007ffa2d078dbc in waitpid () from /lib64/libc.so.6
#1 0x00000000004012c3 in main ()
I don't known why it cost so many time to exit, this process uses about 70G memory, maybe it is because of the memory reclaim, but I've no idea to find the problem, could anyone give some ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
建议检查是否有任何站立的NFS/共享折扣连接需要在两端终止。
更一般而言,检查需要清除的任何网络依赖项。
另外,请检查应用程序使用的任何特殊设备驱动程序(GPU/Graphic Card/USB设备/蓝牙设备/WiFi适配器/打印机...)。一些低质量的设备驱动程序需要时间脱离接触。
Suggesting to check if there are any standing NFS/shared-folder connection that need to be terminated on both ends.
In more general, check for any network dependencies that need to be cleared.
Also, check for any special device drivers used by the application (GPU/Graphic Card/USB device/BlueTooth device/Wifi adapter/ printer...) . Some low quality device drivers need time to disengage.