mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / 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, other threads:[~2019-10-10  8:50 UTC | newest]

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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).