Skip to content
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

osd: delay populating in-memory PG log hashmaps #6425

Merged
merged 1 commit into from Jan 15, 2016

Conversation

branch-predictor
Copy link
Contributor

When booting up OSD, it loads all PGs and their respective logs. To speed
up processing later, these logs are accompanied by separate unordered_maps
which are also populated during PG load.
Delay that until we actually need to access it, so we don't occupy too much
memory right from start - and when we need it, populate just the map that
we want to use, not all 3 of them at once.
Additionally, removed adding all PGs to interim set, because it is actually
unnecessary and code executed during that loop could be moved to other loop.

On my 4-node dev cluster with 98 osds and 52667 objects, combined RSS memory usage for all nodes during cluster bootup looks like this:

1

Also, there's a tangible difference when rebalancing:

2

(at the beginning, OSDs on one of nodes are being SIGTERMed one by one, after a while recovery kicks in, when it stabilizes, I turn OSDs back online).

Signed-off-by: Piotr Dałek piotr.dalek@ts.fujitsu.com

@branch-predictor
Copy link
Contributor Author

This is a rebased and improved version of #5855 with some of code moved out of it into separate PRs and with some other suggested changes.

@@ -599,7 +599,8 @@ class coll_t {
}
return false;
}

spg_t* get_pgid() { return &pgid; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this change because is_pg(spg_t *) validates that the collection is TYPE_PG and if so fills in the spg_t passed by pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, reverting this one.

@dzafman
Copy link
Contributor

dzafman commented Oct 29, 2015

The white space and code cleanup changes should be in its own commit for clarity and backporting.

@liewegas
Copy link
Member

It seems like we should skip the work in index(pg_log_entry_t& e) if the index flag(s) aren't set, since before we can ever look at it we'll see the missing flag, call index(), and throw it all out anyway

@liewegas liewegas self-assigned this Nov 13, 2015
@branch-predictor
Copy link
Contributor Author

Right, I'll change it.

@branch-predictor branch-predictor changed the title osd/PGLog: delay populating PG log hashmaps DNM: osd/PGLog: delay populating PG log hashmaps Dec 7, 2015
@branch-predictor
Copy link
Contributor Author

Please do not merge until #6801 is merged.

@branch-predictor branch-predictor changed the title DNM: osd/PGLog: delay populating PG log hashmaps osd/PGLog: delay populating PG log hashmaps Jan 11, 2016
@branch-predictor
Copy link
Contributor Author

Went through teuthology-openstack: http://149.202.167.15:8081/ubuntu-2016-01-07_13:38:00-rados-bp-delayed-pglog-index-v2---basic-openstack/
All failures are related to teuthology-openstack.
@Sage: ping

When booting up OSD, it loads all PGs and their respective logs. To speed
up processing later, these logs are accompanied by separate unordered_maps
which are also populated during PG load.
Delay that until we actually need to access it, so we don't occupy too much
memory right from start - and when we need it, populate just the map that
we want to use, not all 3 of them at once.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
@liewegas
Copy link
Member

Thanks! I'll include this in the next batch of PRs. :)

@branch-predictor
Copy link
Contributor Author

Thanks!

liewegas added a commit that referenced this pull request Jan 15, 2016
osd: delay populating in-memory PG log hashmaps

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit c5a3c2b into ceph:master Jan 15, 2016
@branch-predictor
Copy link
Contributor Author

\o/

@liewegas
Copy link
Member

liewegas commented Jan 15, 2016 via email

@branch-predictor branch-predictor deleted the bp-delayed-pglog-index-v2 branch February 1, 2016 07:28
@ghost ghost changed the title osd/PGLog: delay populating PG log hashmaps osd: delay populating in-memory PG log hashmaps Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants