简体   繁体   中英

linux process exiting takes too long

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM