mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
* Add enable/disable methods
@ 2019-10-08 22:11 Sam Saffron
  2019-10-10  8:41 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Saffron @ 2019-10-08 22:11 UTC (permalink / raw)
  To: mwrap-public

Howdy,

In our use case we would like to profile one of N unicorn workers
after a certain timeframe.

Would you be open to adding

`Mwrap.enable` : start profiling memory allocations
`Mwrap.disable` : disable all profiling of memory allocations, making
them as close as possible to a no-op.

and an env var for starting disabled

`MWRAP_OPTIONS=disabled`


An additional convenience method here for the entire workflow would be:

`mwrap so_path` that returns the path to the module that needs
preloading, this makes it slightly easier to configure production
environments.

Thoughts?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add enable/disable methods
  2019-10-08 22:11 Add enable/disable methods Sam Saffron
@ 2019-10-10  8:41 ` Eric Wong
  2019-10-10  8:49   ` Sam Saffron
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2019-10-10  8:41 UTC (permalink / raw)
  To: Sam Saffron; +Cc: mwrap-public

Sam Saffron <sam.saffron@gmail.com> wrote:
> Howdy,
> 
> In our use case we would like to profile one of N unicorn workers
> after a certain timeframe.
> 
> Would you be open to adding
> 
> `Mwrap.enable` : start profiling memory allocations
> `Mwrap.disable` : disable all profiling of memory allocations, making
> them as close as possible to a no-op.
> 
> and an env var for starting disabled
> 
> `MWRAP_OPTIONS=disabled`

Would still have to pay the extra size + tracking overhead
even in no-op mode; since post-enable free() can operate on
pre-enable malloc() results.

> 
> An additional convenience method here for the entire workflow would be:
> 
> `mwrap so_path` that returns the path to the module that needs
> preloading, this makes it slightly easier to configure production
> environments.
> 
> Thoughts?

Should be doable.  Got a bunch of other stuff coming up into the
weekend; but should be able to find some time for it in a week
or two.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add enable/disable methods
  2019-10-10  8:41 ` Eric Wong
@ 2019-10-10  8:49   ` Sam Saffron
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Saffron @ 2019-10-10  8:49 UTC (permalink / raw)
  To: Eric Wong; +Cc: mwrap-public

> Would still have to pay the extra size + tracking overhead
> even in no-op mode; since post-enable free() can operate on
> pre-enable malloc() results.

Oh I forgot about that, how about allowing it to start in 'disabled
mode' via env and then only allowing a `Mwrap.enable` once. (with no
.disable method)

That helps a lot with the profiling of unicorn workers cause the
master and multiple workers can be left in "almost zero impact" mode
and you can simply nuke the worker you were profiling once done.

On Thu, Oct 10, 2019 at 7:41 PM Eric Wong <e@80x24.org> wrote:
>
> Sam Saffron <sam.saffron@gmail.com> wrote:
> > Howdy,
> >
> > In our use case we would like to profile one of N unicorn workers
> > after a certain timeframe.
> >
> > Would you be open to adding
> >
> > `Mwrap.enable` : start profiling memory allocations
> > `Mwrap.disable` : disable all profiling of memory allocations, making
> > them as close as possible to a no-op.
> >
> > and an env var for starting disabled
> >
> > `MWRAP_OPTIONS=disabled`
>
> Would still have to pay the extra size + tracking overhead
> even in no-op mode; since post-enable free() can operate on
> pre-enable malloc() results.
>
> >
> > An additional convenience method here for the entire workflow would be:
> >
> > `mwrap so_path` that returns the path to the module that needs
> > preloading, this makes it slightly easier to configure production
> > environments.
> >
> > Thoughts?
>
> Should be doable.  Got a bunch of other stuff coming up into the
> weekend; but should be able to find some time for it in a week
> or two.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 22:11 Add enable/disable methods Sam Saffron
2019-10-10  8:41 ` Eric Wong
2019-10-10  8:49   ` Sam Saffron

mwrap user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://80x24.org/mwrap-public/0 mwrap-public/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 mwrap-public mwrap-public/ https://80x24.org/mwrap-public \
		mwrap-public@80x24.org
	public-inbox-index mwrap-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.mwrap
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.mwrap

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git