Skip to contentSkip to conversation

Improving latency and ordering of the backfilling workload

DISCUSSION Loic Dachary 4 participants 9 messages Dec 15, 2014 – Dec 18, 2014

lore
Share & tools
lore
#0 lore raw

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

* ordering:

* when dequeuing a pending local reservation, chose one that contains a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)
* when sending a remote reservation request, set the priority to reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

* if there are N pending remote reservations, reject a remote reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#1 lore raw
Quoted 10 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do. It would be very easy to piggyback some load information on the heartbeat messages which we should already be exchanging with anyone we would backfill with.

If we go down that path, there are a bunch of patches in the wip-read-hole series that lay useful groundwork. Getting that branch into shape is the next big item after I finish the current batch of pull requests.

Quoted 20 lines

* when sending a remote reservation request, set the priority to
reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation
request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

* if there are N pending remote reservations, reject a remote
reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
#2 lore raw

Hi Sage,

Quoted 6 lines · Sage Weil
Quoted 5 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

Quoted 8 lines
Quoted 5 lines

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

It would be very easy to

Quoted 7 lines

piggyback some load information on the heartbeat messages which we should already be exchanging with anyone we would backfill with.

If we go down that path, there are a bunch of patches in the wip-read-hole series that lay useful groundwork. Getting that branch into shape is the next big item after I finish the current batch of pull requests.

Would you mind telling me which of https://github.com/ceph/ceph/commits/wip-read-hole commits are relevant ? I assume https://github.com/ceph/ceph/commit/ee72f699e236371a5b8651cd900013a2bd2227fb is to some extent.

Cheers

Quoted 21 lines
Quoted 20 lines

* when sending a remote reservation request, set the priority to
reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation
request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

* if there are N pending remote reservations, reject a remote
reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#3 lore raw
Quoted 15 lines · Loic Dachary

Hi Sage,

Quoted 12 lines · Sage Weil
Quoted 10 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

Quoted 8 lines
Quoted 2 lines

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

Including that information could help, yeah, but the main thing is that any estimate of "the busiest OSD" based on local information is going to be weak if it's only based on info reservation requests. Unless that information is refreshed periodically by the requesting OSD (I think we also discussed that a bit last week).

Quoted 9 lines

It would be very easy to

Quoted 7 lines

piggyback some load information on the heartbeat messages which we should already be exchanging with anyone we would backfill with.

If we go down that path, there are a bunch of patches in the wip-read-hole series that lay useful groundwork. Getting that branch into shape is the next big item after I finish the current batch of pull requests.

Quoted 5 lines

Would you mind telling me which of
https://github.com/ceph/ceph/commits/wip-read-hole commits are relevant ? I assume
https://github.com/ceph/ceph/commit/ee72f699e236371a5b8651cd900013a2bd2227fb
is to some extent.

Yeah that's the one. There's a later patch that give each PG a handy reference to that struct for the acting set (for quick access), though in this case not all backfill peers will be in acting.

Note that there is also a osd_peer_stat_t struct in MOSDPing that is currently unused cruft. We could replace/supplement that with whatever information we thing would be helpful.

If we go down that path at least.. I think ahve reservers refresh their reservation periodically with updated priorities would also work.

sage

Quoted 29 lines

Cheers

Quoted 21 lines
Quoted 20 lines

* when sending a remote reservation request, set the priority to
reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation
request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

* if there are N pending remote reservations, reject a remote
reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
#8 lore raw
In reply to Sage Weil

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sage Weil
Sent: Monday, December 15, 2014 10:15 PM
To: Loic Dachary
Cc: Samuel Just; Ceph Development
Subject: Re: Improving latency and ordering of the backfilling workload

Quoted 11 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of
http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

* ordering:

* when dequeuing a pending local reservation, chose one that
contains a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do. It would be very easy to piggyback some load information on the heartbeat messages which we should already be exchanging with anyone we would backfill with.

If we go down that path, there are a bunch of patches in the wip-read-hole series that lay useful groundwork. Getting that branch into shape is the next big item after I finish the current batch of pull requests.

Quoted 10 lines

* when sending a remote reservation request, set the priority to
reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation
request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

Quoted 10 lines

* if there are N pending remote reservations, reject a remote
reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

--
Lo?c Dachary, Artisan Logiciel Libre

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).

#4 lore raw
In reply to Sage Weil
Quoted 25 lines · Sage Weil
Quoted 15 lines · Loic Dachary

Hi Sage,

Quoted 12 lines · Sage Weil
Quoted 10 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

Quoted 8 lines
Quoted 2 lines

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

Quoted 3 lines

Including that information could help, yeah, but the main thing is that any estimate of "the busiest OSD" based on local information is going to be weak if it's only based on info reservation requests.

What other information would be relevant in addition to the number of PGs that need to backfill and their size (objects & bytes) ?

Quoted 3 lines

Unless that
information is refreshed periodically by the requesting OSD (I think we also discussed that a bit last week).

I tried to take that into account by proposing to calculate the priority when the reservation is dequeued from the waiting list instead of when it is added to the waiting list. When the local reservation is dequeued, it gets one of the osd_max_backfill slots in the AsyncReserver and will then get work to do : the delay between calculating the priority and actual backfilling is minimum. The delay actually is the latency between when the remote reservation is sent and when it comes back successfully. By adding the priority to the remote reservation request, we make the peer OSD aware of the local priority and compare it with the priority of the other OSDs asking for a remote reservation. The peer OSD will be grant us a remote reservation quickly if we are the OSD declaring to have most work to do.

I sense you have something else in mind in terms of algorithm and/or data sources. Hopefully this explanation will allow you to see what I'm missing and guide me ;-)

Quoted 59 lines
Quoted 10 lines

It would be very easy to

Quoted 7 lines

piggyback some load information on the heartbeat messages which we should already be exchanging with anyone we would backfill with.

If we go down that path, there are a bunch of patches in the wip-read-hole series that lay useful groundwork. Getting that branch into shape is the next big item after I finish the current batch of pull requests.

Quoted 5 lines

Would you mind telling me which of
https://github.com/ceph/ceph/commits/wip-read-hole commits are relevant ? I assume
https://github.com/ceph/ceph/commit/ee72f699e236371a5b8651cd900013a2bd2227fb
is to some extent.

Yeah that's the one. There's a later patch that give each PG a handy reference to that struct for the acting set (for quick access), though in this case not all backfill peers will be in acting.

Note that there is also a osd_peer_stat_t struct in MOSDPing that is currently unused cruft. We could replace/supplement that with whatever information we thing would be helpful.

If we go down that path at least.. I think ahve reservers refresh their reservation periodically with updated priorities would also work.

sage

Quoted 29 lines

Cheers

Quoted 21 lines
Quoted 20 lines

* when sending a remote reservation request, set the priority to
reflect the total number of pending PG (absolute workload) and the number local pending PG for the destination OSD (workload queued locally for the remote OSD)
* on the receiving side, the priority of the remote reservation
request makes sure the busiest OSD gets a remote reservation before the others

* reducing latency:

* if there are N pending remote reservations, reject a remote
reservation request instead of queuing it so that the local reservation can be used instead of waiting.

Cheers

Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
Signature · 1 line
Lo?c Dachary, Artisan Logiciel Libre
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#5 lore raw
Quoted 26 lines · Loic Dachary
Quoted 25 lines · Sage Weil
Quoted 23 lines · Loic Dachary

Hi Sage,

Quoted 6 lines · Sage Weil
Quoted 5 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

Quoted 8 lines
Quoted 5 lines

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

Quoted 6 lines
Quoted 3 lines

Including that information could help, yeah, but the main thing is that any estimate of "the busiest OSD" based on local information is going to be weak if it's only based on info reservation requests.

What other information would be relevant in addition to the number of PGs that need to backfill and their size (objects & bytes) ?

Maybe the background client workload? If an OSD is more heavily loaded than others than it should probably start it's recovery sooner as its rate of progress will be a bit lower.

Quoted 17 lines
Quoted 3 lines

Unless that
information is refreshed periodically by the requesting OSD (I think we also discussed that a bit last week).

I tried to take that into account by proposing to calculate the priority when the reservation is dequeued from the waiting list instead of when it is added to the waiting list. When the local reservation is dequeued, it gets one of the osd_max_backfill slots in the AsyncReserver and will then get work to do : the delay between calculating the priority and actual backfilling is minimum. The delay actually is the latency between when the remote reservation is sent and when it comes back successfully. By adding the priority to the remote reservation request, we make the peer OSD aware of the local priority and compare it with the priority of the other OSDs asking for a remote reservation. The peer OSD will be grant us a remote reservation quickly if we are the OSD declaring to have most work to do.

Quoted 3 lines

I sense you have something else in mind in terms of algorithm and/or data sources. Hopefully this explanation will allow you to see what I'm missing and guide me ;-)

Oh, I see. That sounds very reasonable. I suspect even with this approach though it will help to periodically refresh that reservation, though, as the remote OSD may have lots of people contending for recovery. Whoever is not first in line will be there for a while and their priority will likely be less than accurate by the time the next item is dequeued there?

Sorry if my drive-by suggestions aren't helping; I'm only half following this discussion!

sage

#6 lore raw
Quoted 59 lines · Sage Weil
Quoted 26 lines · Loic Dachary
Quoted 25 lines · Sage Weil
Quoted 23 lines · Loic Dachary

Hi Sage,

Quoted 6 lines · Sage Weil
Quoted 5 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

Quoted 8 lines
Quoted 5 lines

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

Quoted 6 lines
Quoted 3 lines

Including that information could help, yeah, but the main thing is that any estimate of "the busiest OSD" based on local information is going to be weak if it's only based on info reservation requests.

What other information would be relevant in addition to the number of PGs that need to backfill and their size (objects & bytes) ?

Maybe the background client workload? If an OSD is more heavily loaded than others than it should probably start it's recovery sooner as its rate of progress will be a bit lower.

Quoted 17 lines
Quoted 3 lines

Unless that
information is refreshed periodically by the requesting OSD (I think we also discussed that a bit last week).

I tried to take that into account by proposing to calculate the priority when the reservation is dequeued from the waiting list instead of when it is added to the waiting list. When the local reservation is dequeued, it gets one of the osd_max_backfill slots in the AsyncReserver and will then get work to do : the delay between calculating the priority and actual backfilling is minimum. The delay actually is the latency between when the remote reservation is sent and when it comes back successfully. By adding the priority to the remote reservation request, we make the peer OSD aware of the local priority and compare it with the priority of the other OSDs asking for a remote reservation. The peer OSD will be grant us a remote reservation quickly if we are the OSD declaring to have most work to do.

Quoted 3 lines

I sense you have something else in mind in terms of algorithm and/or data sources. Hopefully this explanation will allow you to see what I'm missing and guide me ;-)

Quoted 6 lines

Oh, I see. That sounds very reasonable. I suspect even with this approach though it will help to periodically refresh that reservation, though, as the remote OSD may have lots of people contending for recovery. Whoever is not first in line will be there for a while and their priority will likely be less than accurate by the time the next item is dequeued there?

The priority is attached to each reservation and is relative to one PG reservation request. The remote reservation priority will be reconsidered each time a new PG asks for a remote reservation (because it will use the priority queues of the AsyncReserver). If we want to revise the priority during the backfilling of a given PG that already has a local+remote slot allocated to it, it means we should periodically consider cancelling an on going backfill operation to give a chance to an other, maybe busier, OSD.

Am I following ?

Quoted 3 lines

Sorry if my drive-by suggestions aren't helping; I'm only half following this discussion!

It's helping a lot !

Quoted 2 lines

sage

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#7 lore raw

I think the concern is that the priority information might be obsolete by the time it gets the remote reservation. We might need to refresh the reservation periodically if, for example, the number of pgs requiring backfill on a particular osd is increasing.
-Sam

Quoted 77 lines · Loic Dachary
Quoted 59 lines · Sage Weil
Quoted 26 lines · Loic Dachary
Quoted 25 lines · Sage Weil
Quoted 23 lines · Loic Dachary

Hi Sage,

Quoted 6 lines · Sage Weil
Quoted 5 lines · Loic Dachary

Hi Sam,

Here is what could be done (in the context of http://tracker.ceph.com/issues/9566
), please let me know if that makes sense:

Quoted 8 lines
Quoted 5 lines

* ordering:

* when dequeuing a pending local reservation, chose one that contains
a PG that belongs to the busiest OSD (i.e. the OSD for which there are more PGs waiting for a local reservation than any other)

I'm worried the reservation count won't be an accurate enough proxy for the amount of work the remote OSD has to do.

Are you thinking about taking into account the number and size of objects in a given PGs ? The length of the local reservation queue accurately reflects the number of PGs that need work (because the length of the reservation queue is not bounded). But it does not reflect the content of the PGs at all, indeed.

Quoted 6 lines
Quoted 3 lines

Including that information could help, yeah, but the main thing is that any estimate of "the busiest OSD" based on local information is going to be weak if it's only based on info reservation requests.

What other information would be relevant in addition to the number of PGs that need to backfill and their size (objects & bytes) ?

Maybe the background client workload? If an OSD is more heavily loaded than others than it should probably start it's recovery sooner as its rate of progress will be a bit lower.

Quoted 17 lines
Quoted 3 lines

Unless that
information is refreshed periodically by the requesting OSD (I think we also discussed that a bit last week).

I tried to take that into account by proposing to calculate the priority when the reservation is dequeued from the waiting list instead of when it is added to the waiting list. When the local reservation is dequeued, it gets one of the osd_max_backfill slots in the AsyncReserver and will then get work to do : the delay between calculating the priority and actual backfilling is minimum. The delay actually is the latency between when the remote reservation is sent and when it comes back successfully. By adding the priority to the remote reservation request, we make the peer OSD aware of the local priority and compare it with the priority of the other OSDs asking for a remote reservation. The peer OSD will be grant us a remote reservation quickly if we are the OSD declaring to have most work to do.

Quoted 3 lines

I sense you have something else in mind in terms of algorithm and/or data sources. Hopefully this explanation will allow you to see what I'm missing and guide me ;-)

Quoted 6 lines

Oh, I see. That sounds very reasonable. I suspect even with this approach though it will help to periodically refresh that reservation, though, as the remote OSD may have lots of people contending for recovery. Whoever is not first in line will be there for a while and their priority will likely be less than accurate by the time the next item is dequeued there?

The priority is attached to each reservation and is relative to one PG reservation request. The remote reservation priority will be reconsidered each time a new PG asks for a remote reservation (because it will use the priority queues of the AsyncReserver). If we want to revise the priority during the backfilling of a given PG that already has a local+remote slot allocated to it, it means we should periodically consider cancelling an on going backfill operation to give a chance to an other, maybe busier, OSD.

Am I following ?

Quoted 3 lines

Sorry if my drive-by suggestions aren't helping; I'm only half following this discussion!

Quoted 8 lines

It's helping a lot !

Quoted 2 lines

sage

--
Loïc Dachary, Artisan Logiciel Libre

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html