LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

Set process title to indicate whether it's a master or a worker #54

Closed wereHamster closed 13 years ago

wereHamster commented 13 years ago

I'd like to know which process is the master and which are the workers. This tiny commits sets process.title in the Master constructor to change the process name as it appears in ps.

tj commented 13 years ago

Cool ill merge on monday, although you can tell by the pgid

tj commented 13 years ago

pretty sure process.title doesn't even work on osx :(

wereHamster commented 13 years ago

On 3/16/11 12:13 AM, visionmedia wrote:

pretty sure process.title doesn't even work on osx :( Almost. It only affects the process name as displayed in the activity monitory, but not ps.

tj commented 13 years ago

nor top / htop :(

wereHamster commented 13 years ago

On 3/16/11 12:23 AM, visionmedia wrote:

nor top / htop :(

Feel free to ignore the pull request then..

tj commented 13 years ago

we should at support for it as .set('title', 'whatever') and maybe append ' - worker N' etc, defaulting to "cluster" I suppose. sucks that it doesnt work on osx

3rd-Eden commented 13 years ago

I never had any issues with using process.title on Mac OSX ( using Mac OSX 10.6 & node 0.4.x )

tj commented 13 years ago

hm, I dont see it in top, htop, or ps

3rd-Eden commented 13 years ago

It does show up in the "Activity Monitor" On Apr 5, 2011, at 10:08 PM, visionmedia wrote:

hm, I dont see it in top, htop, or ps

Reply to this email directly or view it on GitHub: https://github.com/LearnBoost/cluster/pull/54#issuecomment-960933

tj commented 13 years ago

oh, pff, who uses that

3rd-Eden commented 13 years ago

Ok you have a point there but also Instruments.app shows the process.title. Which is useful for debugging your node apps, searching for memory leaks, adding dtrace probes etc.

On Apr 5, 2011, at 10:32 PM, visionmedia wrote:

oh, pff, who uses that

Reply to this email directly or view it on GitHub: https://github.com/LearnBoost/cluster/pull/54#issuecomment-961030

tj commented 13 years ago

im not against the title setting at all, I was just hoping to try it out first and couldnt get it to work haha, I'll add it

tj commented 13 years ago

Added title and worker title settings. Closed by 739bd6df4ba09f420a0a991402c97500fdb50678

tj commented 13 years ago

Activity Monitor did work, sucks that htop and friends dont

3rd-Eden commented 13 years ago

Yeh that is annoying, but at least the process will be easier to identify now, instead of guessing which node process is what.

tj commented 13 years ago

yeah totally, its pretty easy for me usually since you can see N children under the one master node, but if you have several clusters running that would get a bit messy