Linux流程退出需要太长

发布于 2025-02-02 06:47:43 字数 648 浏览 8 评论 0原文

这是我的问题,当我将kill命令发送到我的过程时,无论kill -9kill -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘亓 2025-02-09 06:47:43

建议检查是否有任何站立的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文