Puma: Add optional description in title

Created on 3 Nov 2017  路  3Comments  路  Source: puma/puma

We run more than a handful of puma processes and it would be great if the process title could be more descriptive.

Is there interest in a patch to add an optional title/keyword to the title method in the launcher so that one could specify it?

Currently ps returns something like:

puma 3.10.0 (tcp://0.0.0.0:1234) [20171031214925]

It would be great if one could do:

puma 3.10.0 (tcp://0.0.0.0:1234) [20171031214925] [proyect-foo]

https://github.com/puma/puma/blob/70f309b0260815ce5dec5faacf7e51cc742f0dd5/lib/puma/launcher.rb#L300

contrib-wanted feature

Most helpful comment

I think the 'tag' option will work here - it defaults to the current directory, but can be set as an option.

It's hard to tell, as my linux cuts off at 20 characters for this data, so I can't see it!

In the above example, the [20171031214925] is the default tag, which is the current directory

You could write this in the Puma config to continue to see the default tag value:

tag "project-foo #{File.basename(Dir.getwd)}"

Output:

puma 3.10.0 (tcp://0.0.0.0:1234) [proyect-foo 20171031214925]

All 3 comments

My use case is that people that look at some processes don't have a quick way of identifying which project a specific puma process belongs to.

Would this be a configuration option in the config file or command line? Locally, the app directory directory is a good choice for all my apps, which would be an easier change

I think the 'tag' option will work here - it defaults to the current directory, but can be set as an option.

It's hard to tell, as my linux cuts off at 20 characters for this data, so I can't see it!

In the above example, the [20171031214925] is the default tag, which is the current directory

You could write this in the Puma config to continue to see the default tag value:

tag "project-foo #{File.basename(Dir.getwd)}"

Output:

puma 3.10.0 (tcp://0.0.0.0:1234) [proyect-foo 20171031214925]
Was this page helpful?
0 / 5 - 0 ratings