What's new

cstats size limit?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Rowbby

Occasional Visitor
Is there a limit on the size cstats can grow to? I just noticed my cstats file has shrunk for the first time, going from 24.3 KB earlier this month to 23.2 KB today and it looks like I've lost some client stats older than 2 months.

Not a big deal, just curious. I'm on 270.26 (upgrading later today).

Thanks!
 
Is there a limit on the size cstats can grow to? I just noticed my cstats file has shrunk for the first time, going from 24.3 KB earlier this month to 23.2 KB today and it looks like I've lost some client stats older than 2 months.

Not a big deal, just curious. I'm on 270.26 (upgrading later today).

Thanks!

I don't remember there being any automated cleanup of older data, but I could be wrong.

The filesize itself is misleading because this is a compressed file.
 
I don't remember there being any automated cleanup of older data, but I could be wrong.

The filesize itself is misleading because this is a compressed file.

Ok thanks. Are cstats files created with older versions compatible with 372.31? After upgrading from 270.26 to 372.31, my old rstats all seem to be there, but a ton of info from cstats is missing (max 4 clients of the 10 or 15 that were originally recorded).

Could this have something to do with the amount of work that was done with cstats since 270.26 or is it always good practice to just reset them with a new release?

Thanks again.
 
Ok thanks. Are cstats files created with older versions compatible with 372.31? After upgrading from 270.26 to 372.31, my old rstats all seem to be there, but a ton of info from cstats is missing (max 4 clients of the 10 or 15 that were originally recorded).

Could this have something to do with the amount of work that was done with cstats since 270.26 or is it always good practice to just reset them with a new release?

Thanks again.

There shouldn't be any compatibility issues with older datafiles. Note however that I fixed tons of bugs related to cstats in the past few versions, so it's probably best to start over, as previous stats might not be anywhere accurate. This was a special situation however, where I dedicated time in fixing as many issues I could track down in cstats. I don't expect to ever have to go through this again :)
 
I don't remember there being any automated cleanup of older data, but I could be wrong.

The filesize itself is misleading because this is a compressed file.

I did some testing and it looks like there's a 62 day limit for daily statistics and a 25 month limit for monthly statistics for both rstats and cstats. Anything older than that will be purged (or at least not displayed).

Can anyone who's had traffic monitor running for a while confirm that?

Thanks.
 
I checked the code, and those limits are indeed correct:

Code:
#define MAX_NDAILY              62
#define MAX_NMONTHLY    25

I didn't notice them in cstats because they were moved to a separate header file in that case.

I think those limits are reasonable, unless there's a lot of user request for longer periods. I prefer not to make them grow too much (especially the daily ones) to ensure optimum performance.
 
Good to know. Just curious, what are the performance concerns? (e.g. is it holding more stats in memory, loading/saving the larger files?)
 
Good to know. Just curious, what are the performance concerns? (e.g. is it holding more stats in memory, loading/saving the larger files?)

The data is held in RAM (in addition to some temporary files created in /tmp). I do not know for sure what other side effects it could have - I didn't write that code, and don't really feel like spending too much time analysing it either since it's working fine as it is.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top