-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Statistics on Write Queue length (to help on WriteQueueLimitHigh tuning) #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
/* Cache : Nb entry in cache tree */ | ||
vl.values[0].gauge = (gauge_t) uc_get_size(); | ||
sstrncpy (vl.type, "nb_values", sizeof (vl.type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nb_values
definition in types.db seems to be missing from this patch. Would it be possible to add it, or even better: reuse an existing type (cache_size
seems appropriate here) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nb_values
comes from another (unmerged yet) patch and I missed that it was not in this one. Sorry.
I agree with the fact that we can reuse one, and I like cache_size
too. Patch updated.
So I must say I'd absolutely love to have this feature in collectd ! I'm just a bit wary about the effect it might have on the performance as it touches core parts of the code. I'm not sure I understand how frequently Ideally @octo would give his opinion on this when he finds a moment :-) |
vl.values_len = 2; | ||
vl.time = 0; | ||
sstrncpy (vl.host, hostname_g, sizeof (vl.host)); | ||
sstrncpy (vl.plugin, "internal", sizeof (vl.plugin)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight preference to have "collectd" here instead of "internal".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
About performances... just like another plugin Its cost is the same as any plugin : prepare a queue_length derive-dropped cache_size I could implement it in my jsonrpc plugin because it works with copies of the internal cache tree and there is no additionnal performance cost there. The cost of this feature is a call to the new I hope it helps to clarify how my patch impacts core performances. Regards, |
|
||
if (check_drop_value ()) | ||
if (check_drop_value ()) { | ||
pthread_mutex_lock(&statistics_lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a potential contention point and only reached on busy servers. Please add a check for record_statistics
around the mutex.
…llectd'; no more lock when not recording internal stats
Hello, Commit b2d20f9 :
Regards |
I have a Collectd running in an overloaded server.
PR #640 (please merge it) prevents a thread bomb.
PR #280 (already merged in collectd-5.4.0) and PR #690 (recently created, please merge it) fix most problems.
However, I had no idea how to configure the
WriteQueueLimitHigh
andWriteQueueLimitLow
parameters introduced with PR #280. So I wrote this patch to have statistics on Write Queue and improve those parameters.Note : we have some internal statistics on the Read Queue from the network plugin. The Write Queue is an internal queue so I prefered not to use
network
(asp
in theh/p-pi/t-ti
notation) butinternal
. Some may think thatcollectd
sounds better thaninternal
. Choose the best.