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

[ruby] <defunct> #75

Closed
wellington1993 opened this issue Jul 5, 2019 · 3 comments
Closed

[ruby] <defunct> #75

wellington1993 opened this issue Jul 5, 2019 · 3 comments

Comments

@wellington1993
Copy link

Hi,

I like that project but I've got a problem with defunct processes.
After the kill action from gem, the killed ruby processes, still are presents in the process list with pid and with defunct state.

Without clean of that processes can be a problem.
Images:

puma-defunct-5-htop
puma-defunct-4-config
puma-defunct-3-pstree
puma-defunct-2
puma-defunct-1

Thanks!

@wellington1993
Copy link
Author

I have 214 defunct processes now.
Isn't a big problem because the '/proc/sys/kernel/pid_max' value is 32768.

But if the processes still defuncting maybe will be a problem in the future.

I'm search and apparently the best way to free the defunct process is killing the parent process.
But I don't know a secure way to do this in production environment.

Thanks!

@schneems
Copy link
Member

schneems commented Jul 5, 2019

Can you manually send a SIGTERM to those processes and have them shut down?

It seems like the issue is there is something preventing the process from shutting down which would likely be a problem in your app code instead of with puma or puma worker killer.

Try running a plain puma process with a “hello world” rack app and see if it still happens. Also make sure puma and PWK are upgraded to the latest.

For the processes that are still alive there might be ways to get them to output where they are stuck. Maybe a tool like rbtrace.

@wellington1993
Copy link
Author

Thanks @schneems

I will try rbtrace.
Probably my app code and maybe related with threads use.

Closing this issue for now.

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