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

Support setting the process name #89

Closed
nichtich opened this issue Oct 16, 2013 · 3 comments
Closed

Support setting the process name #89

nichtich opened this issue Oct 16, 2013 · 3 comments

Comments

@nichtich
Copy link

Starman::Server sets the process name to "starman master" and "starman worker". If multiple instances of starman run parallel on multiple ports this is confusing. It would help to be able to assign a process name to an instance of starman. How about a launcher option --name?

@miyagawa
Copy link
Owner

Starman::Server sets the process name to "starman master" and "starman worker". If multiple instances of starman run parallel on multiple ports this is confusing.

I fail to see how setting (actually, sort of prepending) names is more confusing that doing nothing at all, since otherwise you can't even figure out which process is the master/worker.

Starman keeps the original argument in the process names, so if you have two clusters, with --port 8080 and --port 8081, you'll see (scroll to the right):

✗ ps auxww | grep starman
miyagawa       73693   0.0  0.1  2437476   2688 s007  S+    9:56AM   0:00.00 starman worker /Users/miyagawa/dev/Plack/eg/dot-psgi/Hello.psgi --port 8080    
miyagawa       73692   0.0  0.1  2437476   2688 s007  S+    9:56AM   0:00.00 starman worker /Users/miyagawa/dev/Plack/eg/dot-psgi/Hello.psgi --port 8080    
miyagawa       73644   0.0  0.1  2437476   2740 s010  S+    9:56AM   0:00.00 starman worker /Users/miyagawa/dev/Plack/eg/dot-psgi/Hello.psgi --port 8081    
miyagawa       73643   0.0  0.1  2437476   2740 s010  S+    9:56AM   0:00.00 starman worker /Users/miyagawa/dev/Plack/eg/dot-psgi/Hello.psgi --port 8081    

I don't think they're confusing.

@nichtich
Copy link
Author

On Linux the legacy process name, set with prctl(2) on assignment to $0 since Perl 5.14, is truncated to 16 bytes, so only 10 characters left if you include the word "master" or "worker". Sure one can toggle on display of full command line in tools like ps (option x) and top (press c) but it would be more convenient to quickly distinguish starman instances by process name instead of first scanning for the process ID or for the full command line (your comment "scroll to the right" shows the problem). e.g. to restart an application named "hello":

killall -HUP hello-master

@miyagawa
Copy link
Owner

(your comment "scroll to the right" shows the problem).

That's just because i use the full output and the page width is short. I won't casually kill a process by just skimming the ps output anyway, since it's error prone (like you suggested, but see below)

e.g. to restart an application named "hello": killall -HUP hello-master

I would rather use a pid file option. (--pid and -D)

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