On Tue, 22 Oct 2013, Pavel Levshin wrote:
22.10.2013 13:37, David Lang:
I think that if you just document that setting global variables is racy,
and as such it's not suitable for accruate counting, only for changing
rsyslog behavior without a restart you should be good on the expectations
front. the current documentation leans heavily on the counting aspect of
things, but that can be changed. remove any suggestion of future atomic
opertations and emphisise that atomic operations are not possible.
I think they are not suitable for counting at all. Only some particular cases
may be possible, but I cannot visualize one currently.
I think you are correct here
even the load balancing hack works 'well enough' once you accept that you
are balancing per batch rather than per message (even if you did balance
per message, you really have no idea how expensive a particulare message is
going to be, so you are not really balancing the work precisely, you are
only doing so statistically, and balancing per batch rather than per
message is just as valid statistically)
No, it will not work in general. Suppose you have a batch of 256 and 8
actions to select. 256 divides by 8, so you will put all you load on just one
server. Selecting "right" numbers is hard.
actualy it will, you see 256 is the max batch size, rsyslog will grab _up_to_
256 messages for the batch, so if you incrament per message you will seldom be
incrimenting by 256 (unless your system is always running behind)
but if I am understanding things correctly, putting set $/counter = $/counter
+1; in your config will end up incrimenting counter by 1 per batch, not by the
number of messages in the batch, with the race condition that two different
threads may end up racing and ending up with $/counter only going up by 1 when
it should go up by 2.
So it really will end up working pretty well in practice :-)
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.