Yes, that is the right way to do it.

We should put in work at some point to make it thread-local counters. It'll
be a bigger code-change though.

The current interface that dyn-stats and statsobj(static counters) expose
allow us to ship the change transparently.

It's one of those things that I eventually want to do. But it doesn't hurt
that bad right now(in benchmarks or production), so not very urgent.
On Mar 25, 2016 7:19 AM, "Peter Portante" <[email protected]>
wrote:

> On Thu, Mar 24, 2016 at 9:43 PM, David Lang <[email protected]> wrote:
>
> > it looks like adding dyn_stats calls makes a small, but noticable
> > difference in my throughput. The documentation for dyn_stats says that it
> > tries to get a lock, but if it can't it doesn't wait and retry, instead
> it
> > just throws away the update.
> >
> > This makes me thing that the dyn_stats stuff (and probably pstats as
> well)
> > is built on the wrong model.
> >
> > Instead of having a master variable that gets updated from multiple
> > threads, requiring a lock, we should have thread-local variables that can
> > be updated without locks, and when pstats runs, it pulls the data
> (flagging
> > it to be cleared if appropriate).
> >
> > This adds more overhead when spitting out the stats, but it reduces the
> > overhead in the much more common fast path while we are processing
> messages.
>
>
> FWIW, that seems like a good approach.  -peter
>
>
> >
> >
> > David Lang
> > _______________________________________________
> > rsyslog mailing list
> > http://lists.adiscon.net/mailman/listinfo/rsyslog
> > http://www.rsyslog.com/professional-services/
> > What's up with rsyslog? Follow https://twitter.com/rgerhards
> > NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> > of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> > DON'T LIKE THAT.
> >
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> DON'T LIKE THAT.
>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to