All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Jeff Layton <jlayton@kernel.org>, idryomov@gmail.com, zyan@redhat.com
Cc: sage@redhat.com, pdonnell@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH resend v5 08/11] ceph: periodically send perf metrics to MDS
Date: Fri, 7 Feb 2020 08:37:57 +0800	[thread overview]
Message-ID: <6c98cc89-a396-2047-b622-61442f2209f8@redhat.com> (raw)
In-Reply-To: <e78f9a17667240c8f0da02e3913444dec9e0911c.camel@kernel.org>

On 2020/2/6 23:21, Jeff Layton wrote:
> On Thu, 2020-02-06 at 20:26 +0800, Xiubo Li wrote:
>> On 2020/2/6 19:31, Jeff Layton wrote:
>>> On Thu, 2020-02-06 at 10:36 +0800, Xiubo Li wrote:
>>>> On 2020/2/6 5:43, Jeff Layton wrote:
>>>>> On Wed, 2020-01-29 at 03:27 -0500, xiubli@redhat.com wrote:
>>>> [...]
>>>>>> +
>>>>>> +static int sending_metrics_get(void *data, u64 *val)
>>>>>> +{
>>>>>> +	struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;
>>>>>> +	struct ceph_mds_client *mdsc = fsc->mdsc;
>>>>>> +
>>>>>> +	mutex_lock(&mdsc->mutex);
>>>>>> +	*val = (u64)mdsc->sending_metrics;
>>>>>> +	mutex_unlock(&mdsc->mutex);
>>>>>> +
>>>>>> +	return 0;
>>>>>> +}
>>>>>> +DEFINE_SIMPLE_ATTRIBUTE(sending_metrics_fops, sending_metrics_get,
>>>>>> +			sending_metrics_set, "%llu\n");
>>>>>> +
>>>>> I'd like to hear more about how we expect users to use this facility.
>>>>> This debugfs file doesn't seem consistent with the rest of the UI, and I
>>>>> imagine if the box reboots you'd have to (manually) re-enable it after
>>>>> mount, right? Maybe this should be a mount option instead?
>>>> A mount option means we must do the unmounting to disable it.
>>>>
>>> Technically, no. You could wire it up so that you could enable and
>>> disable it via -o remount. For example:
>>>
>>>       # mount -o remount,metrics=disabled
>> Yeah, this is cool.
>>
>>> Another option might be a module parameter if this is something that you
>>> really want to be global (and not per-mount or per-session).
>>>
>>>> I was thinking with the debugfs file we can do the debug or tuning even
>>>> in the product setups at any time, usually this should be disabled since
>>>> it will send it per second.
>>>>
>>> Meh, one frame per second doesn't seem like it'll add much overhead.
>> Okay.
>>> Also, why one update per second? Should that interval be tunable?
>> Per second just keep it the same with the fuse client.
>>
> Ok.
>
>>>> Or we could merge the "sending_metric" to "metrics" UI, just writing
>>>> "enable"/"disable" to enable/disable sending the metrics to ceph, and
>>>> just like the "reset" does to clean the metrics.
>>>>
>>>> Then the "/sys/kernel/debug/ceph/XXX.clientYYY/metrics" could be
>>>> writable with:
>>>>
>>>> "reset"  --> to clean and reset the metrics counters
>>>>
>>>> "enable" --> enable sending metrics to ceph cluster
>>>>
>>>> "disable" --> disable sending metrics to ceph cluster
>>>>
>>>> Will this be better ?
>>>>
>>> I guess it's not clear to me how you intend for this to be used.
>>>
>>> A debugfs switch means that this is being enabled and disabled on a per-
>>> session basis. Is the user supposed to turn this on for all, or just one
>>> session? How do they know?
>> Not for all, just per-superblock.
>>
> If it's per-superblock, then a debugfs-based switch seems particularly
> ill-suited for this, as that's really a per-session interface.
>
>>> Is this something we expect people to just turn on briefly when they are
>>> experiencing a problem, or is this something that we expect to be turned
>>> on and left on for long periods of time?
>> If this won't add much overhead even per second, let's keep sending the
>> metrics to ceph always and the mount option for this switch is not
>> needed any more.
>>
> Note that I don't really _know_ that it won't be a problem, just that it
> doesn't sound too bad. I think we probably will want some mechanism to
> enable/disable this until we have some experience with it in the field.
>
>> And there is already a switch to enable/disable showing the metrics in
>> the ceph side, if here add another switch per client, it will be also
>> yucky for admins .
>>
>> Let's make the update interval tunable and per second as default. Maybe
>> we should make this as a global UI for all clients ?
>>
> If you want a global setting for the interval that would take effect on
> all ceph mounts, then maybe a "metric_send_interval" module parameter
> would be best. Make it an unsigned int, and allow the admin to set it to
> 0 to turn off stats transmission in the client.
>
> We have a well-defined interface for setting module parameters on most
> distros (via /etc/modprobe.d/), so that would be better than monkeying
> around with debugfs here, IMO.
>
> As to the default, it might be best to have this default to 0 initially.
> Once we have more experience with it we could make it default to 1 in a
> later release.

Yeah, this makes sense.

Let's switch to the module parameter "metric_send_interval", at the same 
time this will also act as a switch.

0 means off, >0 will be the interval.

Thanks,

  reply	other threads:[~2020-02-07  0:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29  8:27 [PATCH resend v5 0/11] ceph: add perf metrics support xiubli
2020-01-29  8:27 ` [PATCH resend v5 01/11] ceph: add global dentry lease metric support xiubli
2020-01-29  8:27 ` [PATCH resend v5 02/11] ceph: add caps perf metric for each session xiubli
2020-01-29 14:21   ` Jeff Layton
2020-01-30  2:22     ` Xiubo Li
2020-01-30 19:00       ` Jeffrey Layton
2020-01-31  1:34         ` Xiubo Li
2020-01-31  9:02           ` Xiubo Li
2020-02-04 21:10             ` Jeff Layton
2020-02-05  0:58               ` Xiubo Li
2020-02-05  7:57               ` Xiubo Li
2020-01-29  8:27 ` [PATCH resend v5 03/11] ceph: move ceph_osdc_{read,write}pages to ceph.ko xiubli
2020-02-04 18:38   ` Jeff Layton
2020-01-29  8:27 ` [PATCH resend v5 04/11] ceph: add r_end_stamp for the osdc request xiubli
2020-02-05 19:14   ` Jeff Layton
2020-02-06  0:57     ` Xiubo Li
2020-01-29  8:27 ` [PATCH resend v5 05/11] ceph: add global read latency metric support xiubli
2020-02-05 20:15   ` Jeff Layton
2020-02-06  1:24     ` Xiubo Li
2020-01-29  8:27 ` [PATCH resend v5 06/11] ceph: add global write " xiubli
2020-01-29  8:27 ` [PATCH resend v5 07/11] ceph: add global metadata perf " xiubli
2020-01-29  8:27 ` [PATCH resend v5 08/11] ceph: periodically send perf metrics to MDS xiubli
2020-02-05 21:43   ` Jeff Layton
2020-02-06  2:36     ` Xiubo Li
2020-02-06 11:31       ` Jeff Layton
2020-02-06 12:26         ` Xiubo Li
2020-02-06 15:21           ` Jeff Layton
2020-02-07  0:37             ` Xiubo Li [this message]
2020-01-29  8:27 ` [PATCH resend v5 09/11] ceph: add CEPH_DEFINE_RW_FUNC helper support xiubli
2020-01-29  8:27 ` [PATCH resend v5 10/11] ceph: add reset metrics support xiubli
2020-01-29  8:27 ` [PATCH resend v5 11/11] ceph: send client provided metric flags in client metadata xiubli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c98cc89-a396-2047-b622-61442f2209f8@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=pdonnell@redhat.com \
    --cc=sage@redhat.com \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.