Set Process Name

664 views
Skip to first unread message

Donovan Hide

unread,
Sep 3, 2012, 9:51:22 AM9/3/12
to golan...@googlegroups.com
Hi,

I'm using command.Start() in "os/exec" to launch multiple processes of
go executables to get around the 16GB memory limit issue:

http://code.google.com/p/go/issues/detail?id=2142

Each process manages its huge chunks of memory and communicates to a
master process using "net/rpc". It would be very useful to be able to
change the process name for reference in tools like top and Activity
Monitor on OS X. Is this something that could easily be exposed in the
syscall package?

There's an equivalent for Python, but it looks like there is a lot of
platform-specific bits hard-coded in:

https://github.com/dvarrazzo/py-setproctitle

Cheers,
Donovan.

Dave Cheney

unread,
Sep 3, 2012, 9:55:50 AM9/3/12
to Donovan Hide, golan...@googlegroups.com

Why not just increase the size of your runtime heap? The instructions are in issue 2142.

Donovan Hide

unread,
Sep 3, 2012, 10:11:38 AM9/3/12
to Dave Cheney, golan...@googlegroups.com
Hi Dave,

> Why not just increase the size of your runtime heap? The instructions are in
> issue 2142.

I've read the workaround, but the software is open source and it would
be a pain to force any users to recompile Go on their machines and
also, the use of RPC means that the system can be distributed over a
number of machines, which potentially makes the cost of using 32 GB
rather than 64GB machines on the likes of EC2 a bit more flexible.

I'm fairly sure that renaming processes would be useful in other use
cases too...

I see that the 16GB issue is flagged as a Go 1.1 milestone, is it
possible that this could be an environment variable flag in an earlier
release?

Cheers,
Donovan.

minux

unread,
Sep 3, 2012, 12:15:35 PM9/3/12
to Donovan Hide, golan...@googlegroups.com
it is high platform specific (and even OS version specific).

it makes sense to write a separate package for this, and i think it would
be useful.
as this requires real argc and argv on Linux/Mac OS X, and runtime doesn't
expose that, support this on Linux is a bit challenging.

i think you can file a issue for this, and see if Go team ack this (by either provide
the Setproctitle function in syscall/os or expose real argc/argv in runtime (unlikely))

Reply all
Reply to author
Forward
0 new messages