[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3323) stats (and back-monitor) counters wrap when



> I noted that counters in back-monitor, which reflect values incremented by
> frontend when performing operations, do wrap when the max value is
> reached, and
> get negative values.  E.g., from my torture test (~20 hours of 50
> concurrent
> reads and writes over a 10000 entries DB, ~2500000 ops):
>
>     # ldapsearch -LLL -b 'cn=monitor' '(monitorCounter=*)'
>     dn: cn=Bytes,cn=Statistics,cn=Monitor
>     monitorCounter: -2083887046
>
>     dn: cn=PDU,cn=Statistics,cn=Monitor
>     monitorCounter: 170793975
>
>     ...
>
> One mandatory fix is to use unsigned counters, to avoid at least the
> negative
> values.
> A short term solution (which only defers the problem) would be to use long
> long
> where available, or to separate values into major and minor, and compose
> the
> value in string form.
> An ultimate solution would be to use an arbitrary precision math library.

OK, the problem is rather that the LDAP integer syntax has been used
for the counters, so illegal values (i.e. beyond maxInt) are being
stored in the attribute.  The quick fix is to avoid setting the counters
to values larger than maxInt.  However, the problem of setting very large
counter still exists.

Maybe we better move this discussion to -devel.

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497