RocksDB tuning
Hi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before rocksdb::DB::Open in RocksDBStore::do_open opt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks
Mana
Quoted 1 line
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).
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 38 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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).
--
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
To just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options =
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."
Regards,
Jianjian
Quoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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
--
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
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing through env->SetBackgroundThreads(). Am I missing anything ?
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuning
To just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options =
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."
Regards,
Jianjian
Quoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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
--
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
--
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).
Quoted 11 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningJianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?
It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148
Quoted 78 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options=
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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--
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
--
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).
Great, thanks..I was checking rocksdb tree..
Also, one thing I observed that rocksdb::GetOptionsFromString is expecting options to be separated by ';' and not by ',' like we are doing in bluestore_rocksdb_options.
https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288f3ae786f/util/options_test.cc#L601
https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288f3ae786f/util/options_helper.cc#L709
It seems none of the options we are passing is setting correctly in rocksdb ? I will add some print to verify.
Thanks & Regards
Somnath
-----Original Message-----
From: Jianjian Huo [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:50 PM
To: Somnath Roy; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuning
Quoted 9 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuning
Quoted 3 lines
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?
It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148
Quoted 83 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options=
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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--
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
--
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).
ugh, that might explain why increasing the rocksdb compaction threads and max concurrent compactions didn't help me at all today.
I'll try to take a look at:
rocksdb::DB::Open in RocksDBStore::do_open opt.IncreaseParallelism(16); opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks,
Mark
Quoted 118 lines · Somnath Roy
Great, thanks..I was checking rocksdb tree..
Also, one thing I observed thatrocksdb::GetOptionsFromStringis expecting options to be separated by ';' and not by ',' like we are doing inbluestore_rocksdb_options.https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288f3ae786f/util/options_test.cc#L601
https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288f3ae786f/util/options_helper.cc#L709It seems none of the options we are passing is setting correctly in rocksdb ? I will add some print to verify.
Thanks & Regards
Somnath-----Original Message-----
From: Jianjian Huo [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:50 PM
To: Somnath Roy; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 9 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 3 lines
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148Quoted 83 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options=
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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--
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
--
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).
Mark,
If you need, we can create a patch and send it you. Please let us know.
Mana
Quoted 5 lines · Mark Nelson
ugh, that might explain why increasing the rocksdb compaction threads and max concurrent compactions didn't help me at all today.
I'll try to take a look at:
Quoted 149 lines
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks,
MarkQuoted 142 lines · Somnath Roy
Great, thanks..I was checking rocksdb tree..
Also, one thing I observed thatrocksdb::GetOptionsFromStringis expecting options to be separated by ';' and not by ',' like we are doing inbluestore_rocksdb_options.https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288
f3ae786f/util/options_test.cc#L601https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c288
f3ae786f/util/options_helper.cc#L709It seems none of the options we are passing is setting correctly in rocksdb ?
I will add some print to verify.Thanks & Regards
Somnath-----Original Message-----
From: Jianjian Huo [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:50 PM
To: Somnath Roy; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 9 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 5 lines
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options.
It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148Quoted 96 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options= "...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 43 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 14 lines
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).
--
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--
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
--
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).
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).
Mark,
I think increasing compact_threads/flusher_threads should work as we are handling that from our code.
But, the option added in config file with bluestore_rocksdb_options is not setting probably (I will double check with some debug print). Here is what IncreaseParallelism does..
DBOptions* DBOptions::IncreaseParallelism(int total_threads) {
max_background_compactions = total_threads - 1;
max_background_flushes = 1;
env->SetBackgroundThreads(total_threads, Env::LOW);
env->SetBackgroundThreads(1, Env::HIGH);
return this;
}
We need to increase max*_background_compactions as well it seems. Only increasing threads is not sufficient. Additionally, I am seeing bunch of other compaction options, will try those as well and update. I think as Jianjian said, everything could be done through conf option if it is working properly. I will check and prepare a patch if options are not working properly.
Thanks & Regards
Somnath
-----Original Message-----
From: Mark Nelson [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 6:12 PM
To: Somnath Roy; Jianjian Huo; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
ugh, that might explain why increasing the rocksdb compaction threads and max concurrent compactions didn't help me at all today.
I'll try to take a look at:
rocksdb::DB::Open in RocksDBStore::do_open opt.IncreaseParallelism(16); opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks,
Mark
Quoted 121 lines · Somnath Roy
Great, thanks..I was checking rocksdb tree..
Also, one thing I observed thatrocksdb::GetOptionsFromStringis expecting options to be separated by ';' and not by ',' like we are doing inbluestore_rocksdb_options.https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c
288f3ae786f/util/options_test.cc#L601
https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c
288f3ae786f/util/options_helper.cc#L709It seems none of the options we are passing is setting correctly in rocksdb ? I will add some print to verify.
Thanks & Regards
Somnath-----Original Message-----
From: Jianjian Huo [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:50 PM
To: Somnath Roy; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 9 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 3 lines
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148Quoted 83 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options=
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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--
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
--
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).
Mark,
Options are setting properly with ',' , I must be missing something..Anyways...
Thanks & Regards
Somnath
-----Original Message-----
From: Somnath Roy
Sent: Wednesday, June 08, 2016 6:21 PM
To: 'Mark Nelson'; Jianjian Huo; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuning
Mark,
I think increasing compact_threads/flusher_threads should work as we are handling that from our code.
But, the option added in config file with bluestore_rocksdb_options is not setting probably (I will double check with some debug print). Here is what IncreaseParallelism does..
DBOptions* DBOptions::IncreaseParallelism(int total_threads) {
max_background_compactions = total_threads - 1;
max_background_flushes = 1;
env->SetBackgroundThreads(total_threads, Env::LOW);
env->SetBackgroundThreads(1, Env::HIGH);
return this;
}
We need to increase max*_background_compactions as well it seems. Only increasing threads is not sufficient. Additionally, I am seeing bunch of other compaction options, will try those as well and update. I think as Jianjian said, everything could be done through conf option if it is working properly. I will check and prepare a patch if options are not working properly.
Thanks & Regards
Somnath
-----Original Message-----
From: Mark Nelson [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 6:12 PM
To: Somnath Roy; Jianjian Huo; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
ugh, that might explain why increasing the rocksdb compaction threads and max concurrent compactions didn't help me at all today.
I'll try to take a look at:
rocksdb::DB::Open in RocksDBStore::do_open opt.IncreaseParallelism(16); opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks,
Mark
Quoted 121 lines · Somnath Roy
Great, thanks..I was checking rocksdb tree..
Also, one thing I observed thatrocksdb::GetOptionsFromStringis expecting options to be separated by ';' and not by ',' like we are doing inbluestore_rocksdb_options.https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c
288f3ae786f/util/options_test.cc#L601
https://github.com/facebook/rocksdb/blob/533cda90cec8588fe13832833cd2c
288f3ae786f/util/options_helper.cc#L709It seems none of the options we are passing is setting correctly in rocksdb ? I will add some print to verify.
Thanks & Regards
Somnath-----Original Message-----
From: Jianjian Huo [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:50 PM
To: Somnath Roy; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 9 lines · Jianjian Huo
-----Original Message-----
From: Somnath Roy [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 5:39 PM
To: Jianjian Huo; Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningQuoted 3 lines
Jianjian,
Couldn't find options like compaction_threads/flusher_threads in rocksdb tree. Max_* option can be done by options. It seems it is increasing throughenv->SetBackgroundThreads(). Am I missing anything ?It's handled by Ceph kv and then passed to rocksdb. See below
https://github.com/ceph/ceph/blob/master/src/kv/RocksDBStore.cc#L148Quoted 83 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jianjian Huo
Sent: Wednesday, June 08, 2016 5:31 PM
To: Allen Samuels; Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningTo just increase compaction and flusher threads, I think we can also configure rocksdb with below settings as well?
bluestore_rocksdb_options=
"...compaction_threads=, flusher_threads=, max_background_compactions=, max_background_flushes=..."Regards,
JianjianQuoted 41 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Allen Samuels
Sent: Wednesday, June 08, 2016 4:53 PM
To: Manavalan Krishnan; Mark Nelson; Ceph Development
Subject: RE: RocksDB tuningLet's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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). --
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--
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
--
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).
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's min_alloc_size commit for different media types was committed into master:
https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3efd187
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the min_alloc size (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the surface) to be due to metadata traffic during heavy small random writes.
Mark
Quoted 53 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 25 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 13 lines
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).
--
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--
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
Quoted 9 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3efd187
Quoted 6 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the surface) to be due to metadata traffic during heavy small random writes.
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 68 lines
Mark
Quoted 55 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 36 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 byQuoted 8 lines
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).
--
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.htmlQuoted 5 lines
--
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--
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
I think the behavior is not surprising.
Small random writes represent the largest ratio of metadata to data being written. Hence RocksDB compaction will be at a maximum.
It's well known that the write-amplification of LSM databases is quite high. What isn't discussed is that the read amplification for LSM databases is also high.
All of these issues stem from LSM being generally optimized for HDD.
ZetaScale is the answer to this problem when running on flash, I believe we're getting very close to generating pull requests for it.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 105 lines
-----Original Message-----
From: Mark Nelson [mailto:[email protected]]
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningQuoted 7 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
e3Quoted 10 lines
efd187
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 25 lines
Mark
Quoted 21 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 11 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused
by
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
PLEASE NOTE: The information contained in this electronic mail message is
intended only for the use of the designated recipient(s) named above. If theQuoted 8 lines
Quoted 8 lines
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 andall
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the
body of a message to [email protected] More majordomoinfo at
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
--
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--
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
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options = "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"
I will try to debug what is going on there..
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Quoted 10 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3
efd187
Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 63 lines
Mark
Quoted 54 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 36 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 byQuoted 8 lines
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).
--
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.htmlQuoted 5 lines
--
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
Quoted 4 lines
--
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
--
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).
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.
2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options = "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"
I will try to debug what is going on there..
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Quoted 10 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3
efd187
Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 61 lines
Mark
Quoted 52 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 34 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 shownQuoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
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.htmlQuoted 5 lines
--
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
Quoted 4 lines
--
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
--
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). --
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
You are doing random 4K writes to an rbd device. Right?
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 129 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 11 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 61 lines
Mark
Quoted 53 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 34 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 shownQuoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
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.htmlQuoted 5 lines
--
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.htmlQuoted 4 lines
--
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--
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). --
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
Yes Allen..
-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:09 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
You are doing random 4K writes to an rbd device. Right?
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 138 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 12 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e
3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 63 lines
Mark
Quoted 55 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 36 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 shownQuoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
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.htmlQuoted 5 lines
--
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.htmlQuoted 4 lines
--
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--
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). --
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
Yes we've seen this phenomenon with the zetascale work and it's been discussed before. Fundamental I believe that the legacy 4mb striping value size will need to be modified as well as some attention to efficient inode encoding.
Can you retry with 2mb stripe size? That should drop the inode size roughly in half.
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 151 lines · Somnath Roy
Yes Allen..
-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:09 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningYou are doing random 4K writes to an rbd device. Right?
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 136 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 12 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e
3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 57 lines
Mark
Quoted 54 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 43 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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).
--
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.htmlQuoted 8 lines
Quoted 4 lines
--
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--
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--
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). --
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
I think we didn't see this big inode size with old bluestore code during ZS integration..Also, the client throughput I am getting now is different than old code. Will try with 2mb stripe size and update..
Thanks & Regards
Somnath
-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:15 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Yes we've seen this phenomenon with the zetascale work and it's been discussed before. Fundamental I believe that the legacy 4mb striping value size will need to be modified as well as some attention to efficient inode encoding.
Can you retry with 2mb stripe size? That should drop the inode size roughly in half.
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 152 lines · Somnath Roy
Yes Allen..
-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:09 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningYou are doing random 4K writes to an rbd device. Right?
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 137 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 13 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
e
3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 57 lines
Mark
Quoted 54 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 43 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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).
--
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.htmlQuoted 8 lines
Quoted 4 lines
--
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--
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--
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). --
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
I believe that the old onode design extent map is quite inefficient in the encoding when you're doing 4KB overwrites.
I believe this can be significantly improved with a modest bit of -- low risk -- work.
I haven't pushed on it yet, because these data structures have been completely redone with the compression stuff.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 221 lines
-----Original Message-----
From: Somnath Roy
Sent: Thursday, June 09, 2016 10:06 PM
To: Allen Samuels <[email protected]>
Cc: Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningI think we didn't see this big inode size with old bluestore code during ZS integration..Also, the client throughput I am getting now is different than old code.
Will try with 2mb stripe size and update..Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:15 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningYes we've seen this phenomenon with the zetascale work and it's been discussed before. Fundamental I believe that the legacy 4mb striping value size will need to be modified as well as some attention to efficient inode encoding.
Can you retry with 2mb stripe size? That should drop the inode size roughly in half.
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 1 line
On Jun 9, 2016, at 7:11 PM, Somnath Roy <[email protected]>
Quoted 15 lines · wrote:
Yes Allen..
-----Original Message-----
From: Allen Samuels
Sent: Thursday, June 09, 2016 7:09 PM
To: Somnath Roy
Cc: Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningYou are doing random 4K writes to an rbd device. Right?
Sent from my iPhone. Please excuse all typos and autocorrects.
Quoted 1 line
On Jun 9, 2016, at 7:06 PM, Somnath Roy <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.
Quoted 2 lines
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 2 lines
Quoted 2 lines
This explains why so much data going to rocksdb I guess. Once
compaction kicks in iops I am getting is *30 times* slower.
Quoted 2 lines
Quoted 2 lines
I have 15 osds on 8TB drives and I have created 4TB rbd image
preconditioned with 1M. I was running 4K RW test.
Quoted 11 lines
Quoted 11 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 2 lines
Quoted 2 lines
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6 7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64, num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level _multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 8 lines
Quoted 8 lines
Quoted 8 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
e
3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Quoted 1 line
Quoted 1 line
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie
not leaked WAL data) during small random writes.
Quoted 17 lines
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 11 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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 orQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the
body of a message to [email protected] More majordomoinfo
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail message isintended 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).
Quoted 3 lines
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
Quoted 1 line
Quoted 10 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore csum type = none' and see if that is the entire reason or if something else is going on.
We may need to reconsider the way this is stored.
s
Quoted 125 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 10 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335e3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 61 lines
Mark
Quoted 52 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 34 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 shownQuoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
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.htmlQuoted 5 lines
--
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.htmlQuoted 4 lines
--
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--
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). --
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
--
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
Sure Sage, will do that..
Thanks & Regards
Somnath
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy
Cc: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuning
Quoted 10 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on and working as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.2016-06-09 15:49:24.710149 7f7732fe3700 20 bluestore(/var/lib/ceph/osd/ceph-0) onode #1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore csum type = none' and see if that is the entire reason or if something else is going on.
We may need to reconsider the way this is stored.
s
Quoted 133 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningMark,
As we discussed, it seems there is ~5X write amp on the system with 4K RW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
bluestore_rocksdb_options= "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=kCompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=67108864,max_background_compactions=31,level0_file_num_compaction_trigger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level_multiplier=8,compaction_threads=32,flusher_threads=8"I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 11 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
e3
efd187Quoted 7 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Sorry, this was worded poorly. Traffic due to compaction of metadata (ie not leaked WAL data) during small random writes.
Mark
Quoted 62 lines
Mark
Quoted 53 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 35 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_openopt.IncreaseParallelism(16);
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 shownQuoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
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.htmlQuoted 5 lines
--
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.htmlQuoted 4 lines
--
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--
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). --
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
--
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
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or 4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4 bytes of zeros at the top of each word that can be dropped.
(3) Encoded offsets and sizes are often exactly "1" block, clever choices of formatting can eliminate these entirely.
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 198 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 6 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore csum type = none' and see if that is the entire reason or if something else is going on.
We may need to reconsider the way this is stored.
s
Quoted 11 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 2 lines
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6 7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64, num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level _multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 6 lines
I will try to debug what is going on there..
Thanks & Regards
SomnathQuoted 15 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 7 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 12 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Quoted 1 line
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie
not leaked WAL data) during small random writes.
Quoted 32 lines
Mark
Quoted 29 lines
Mark
Quoted 25 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 orQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the
body of a message to [email protected] More majordomoinfo
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail message isintended 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).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 15 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or 4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
Quoted 7 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4 bytes of zeros at the top of each word that can be dropped.
(3) Encoded offsets and sizes are often exactly "1" block, clever choices of formatting can eliminate these entirely.IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it (80%) is the csum_data vector, which is a flat vector of u32 values that are presumably not very compressible.
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 212 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 189 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is writing to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 6 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore csum type = none' and see if that is the entire reason or if something else is going on.
We may need to reconsider the way this is stored.
s
Quoted 11 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 2 lines
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking of compaction so fast and degrading performance drastically) , it seems it is still writing WAL (?)..I used the following rocksdb option for faster background compaction as well hoping it can keep up with upcoming writes and writes won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6 7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64, num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level _multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 6 lines
I will try to debug what is going on there..
Thanks & Regards
SomnathQuoted 15 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 7 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had forgotten that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 12 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small random writes.Quoted 1 line
Sorry, this was worded poorly. Traffic due to compaction of metadata (ie
not leaked WAL data) during small random writes.
Quoted 32 lines
Mark
Quoted 29 lines
Mark
Quoted 25 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
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 orQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the
body of a message to [email protected] More majordomoinfo
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail message isintended 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).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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
Quoted 46 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 4 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(3) Encoded offsets and sizes are often exactly "1" block, clever choices of
formatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it (80%) is the
csum_datavector, which is a flat vector of
u32 values that are presumably not very compressible.
Quoted 6 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
Reduce the RBD stripe size from 4MB to something smaller.
Quoted 244 lines
sage
Quoted 22 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 6 lines
Quoted 6 lines
to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 10 lines
Quoted 10 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 4 lines
Quoted 4 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6
Quoted 1 line
Quoted 1 line
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,
Quoted 1 line
Quoted 1 line
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 14 lines
Quoted 14 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 18 lines
Quoted 18 lines
not leaked WAL data) during small random writes.
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 20 lines
Quoted 5 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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
Oh, and use 16-bit checksums :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 295 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 4 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(3) Encoded offsets and sizes are often exactly "1" block, clever choices of
formatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it (80%) is the
csum_datavector, which is a flat vector of
u32 values that are presumably not very compressible.We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 22 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 6 lines
Quoted 6 lines
to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 10 lines
Quoted 10 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 4 lines
Quoted 4 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6
Quoted 1 line
Quoted 1 line
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,
Quoted 1 line
Quoted 1 line
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 14 lines
Quoted 14 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 18 lines
Quoted 18 lines
not leaked WAL data) during small random writes.
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 20 lines
Quoted 5 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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
Quoted 1 line · Allen Samuels
Oh, and use 16-bit checksums :)
csum_type xxhash32, 0.576609s seconds, 4655.42 MB/sec csum_type xxhash64, 0.306633s seconds, 8754.29 MB/sec csum_type crc32c, 0.176754s seconds, 15187 MB/sec csum_type crc32c_16, 0.172195s seconds, 15589 MB/sec csum_type crc32c_8, 0.137655s seconds, 19500.6 MB/sec csum_type crc16, 8.32507s seconds, 322.442 MB/sec csum_type crc16_8, 8.29444s seconds, 323.633 MB/sec
on my dev box. See
https://github.com/ceph/ceph/pull/9632
(This is based on other stuff that's not merged; only the last few patches there are relevant).
I think we should drop the crc16 and just stick with low bits of crc32c, since it's way faster... I'm pretty sure even without the intel instructions.
sage
Language is imprecise. I agree with you completely. We should pick the fastest hash that we can find and truncate it accordingly.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 31 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 10:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 1 line · Allen Samuels
Oh, and use 16-bit checksums :)
csum_typexxhash32, 0.576609s seconds, 4655.42 MB/seccsum_typexxhash64, 0.306633s seconds, 8754.29 MB/seccsum_typecrc32c, 0.176754s seconds, 15187 MB/seccsum_typecrc32c_16, 0.172195s seconds, 15589 MB/seccsum_typecrc32c_8, 0.137655s seconds, 19500.6 MB/seccsum_typecrc16, 8.32507s seconds, 322.442 MB/seccsum_typecrc16_8, 8.29444s seconds, 323.633 MB/secon my dev box. See
https://github.com/ceph/ceph/pull/9632(This is based on other stuff that's not merged; only the last few patches there are relevant).
I think we should drop the crc16 and just stick with low bits of crc32c, since it's way faster... I'm pretty sure even without the intel instructions.
sage
Quoted 1 line · Allen Samuels
Oh, and use 16-bit checksums :)
Hey! :-)
Quoted 36 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 4 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 1 line
(3) Encoded offsets and sizes are often exactly "1" block, clever choices of
formatting can eliminate these entirely.
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it (80%) is the
csum_datavector, which is a flat vector of
u32 values that are presumably not very compressible.
I don't think that's what Somnath is seeing (obviously some data here will sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 251 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 22 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 6 lines
Quoted 6 lines
to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 10 lines
Quoted 10 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 4 lines
Quoted 4 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6
Quoted 1 line
Quoted 1 line
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,
Quoted 1 line
Quoted 1 line
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 14 lines
Quoted 14 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 18 lines
Quoted 18 lines
not leaked WAL data) during small random writes.
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 20 lines
Quoted 5 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs (Sage?) as it is still holding checksum of old data I wrote ?
bluestore_csum = false
bluestore_csum_type = none
Here is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >
For example, what last entry is saying that system (with 8 osds) is receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Now, after a min or so, the throughput goes down to barely 1K from FIO (and very bumpy) and here is the 'dstat' snippet at that time..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >
So, system is barely receiving anything (~2M) but still writing ~54M of data and reading 226M of data from disk.
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >
Not receiving anything from client but still writing 78M of data and 206M of read.
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Thanks & Regards
Somnath
-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuning
Quoted 43 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.
I don't think that's what Somnath is seeing (obviously some data here will sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 222 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 6 lines
Quoted 6 lines
to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 10 lines
Quoted 10 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 4 lines
Quoted 4 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6
Quoted 1 line
Quoted 1 line
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,
Quoted 1 line
Quoted 1 line
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 14 lines
Quoted 14 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 18 lines
Quoted 18 lines
not leaked WAL data) during small random writes.
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
Quoted 28 lines
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 20 lines
Quoted 5 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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).
Quoted 3 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs (Sage?) as it is still holding checksum of old data I wrote ?
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 359 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Now, after a min or so, the throughput goes down to barely 1K from FIO (and very bumpy) and here is the 'dstat' snippet at that time..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data and reading 226M of data from disk.
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M of read.
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 43 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 222 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 6 lines
Quoted 6 lines
to my environment ~7K !! See this debug print.
Quoted 2 lines
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 10 lines
Quoted 10 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 4 lines
Quoted 4 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 2 lines
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6
Quoted 1 line
Quoted 1 line
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64,
Quoted 1 line
Quoted 1 line
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 14 lines
Quoted 14 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 13 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 18 lines
Quoted 18 lines
not leaked WAL data) during small random writes.
Quoted 17 lines
Mark
Quoted 14 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 1 line
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
Quoted 28 lines
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 20 lines
Quoted 5 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
majordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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.htmlPLEASE 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).
Just modified store_test synthetic test case to simulate many random 4K writes to 4M object.
With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 349 lines · Sage Weil
Quoted 3 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs (Sage?) as it is still holding checksum of old data I wrote ?
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 326 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Now, after a min or so, the throughput goes down to barely 1K from FIO (and very bumpy) and here is the 'dstat' snippet at that time..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data and reading 226M of data from disk.
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M of read.
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 38 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 13 lines · Allen Samuels
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current code.
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 8 lines
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 224 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on read, etc. :/ I don't really have any good ideas here.
sage
Quoted 20 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andworking as expected. But, in the process, I found that onode size it is
writing
Quoted 10 lines
Quoted 10 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is 7518Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 1 line
Quoted 1 line
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 1 line
Quoted 1 line
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 2 lines
Quoted 2 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k CompactionStyleLevel,write_buffer_size=67108864,target_file_size_base=6 7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=64, num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 13 lines
Quoted 13 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 12 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 4 lines
Quoted 4 lines
Quoted 4 lines · Mark Nelson
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 16 lines
Quoted 16 lines
not leaked WAL data) during small random writes.
Quoted 15 lines
Mark
Quoted 13 lines
Mark
Quoted 10 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the future.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 19 lines
Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaQuoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 thisQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 10 lines
Quoted 10 lines
info
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
--
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--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 2 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 14 lines
Quoted 14 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
--
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.htmlPLEASE 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).
--
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
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 439 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 25 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 2 lines
Quoted 2 lines
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 9 lines
Quoted 9 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 11 lines
Quoted 11 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 2 lines
Quoted 2 lines
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 21 lines
Quoted 21 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 5 lines
Quoted 5 lines
Quoted 5 lines · Allen Samuels
Quoted 4 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
:/ I don't really have any good ideas here.
sage
Quoted 20 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 40 lines
Quoted 40 lines
Quoted 40 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 2 lines
Quoted 2 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 16 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be
sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 5 lines
Mark
Quoted 2 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 35 lines
Quoted 35 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 4 lines
info
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 14 lines
Quoted 14 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
--
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.htmlPLEASE 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).
Quoted 5 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
An update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte * 16 values = 10880
Branch's @github been updated with corresponding fixes.
Thanks,
Igor.
Quoted 443 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 426 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 25 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 8 lines
Quoted 8 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 10 lines
Quoted 10 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 1 line
Quoted 1 line
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 20 lines
Quoted 20 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 5 lines
Quoted 5 lines
Quoted 5 lines · Allen Samuels
Quoted 4 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
:/ I don't really have any good ideas here.
sage
Quoted 20 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 40 lines
Quoted 40 lines
Quoted 40 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 2 lines
Quoted 2 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 14 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningOn 06/09/2016 08:37 AM, Mark Nelson wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be
sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 5 lines
Mark
Quoted 2 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 49 lines
Quoted 49 lines
Quoted 49 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 35 lines
Quoted 35 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 4 lines
info
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 14 lines
Quoted 14 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 4 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
--
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.htmlPLEASE 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).
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
What's the assumption that suggests a limit of 64 blobs / 4MB ? Are you assuming a 64K blobsize?? That certainly won't be the case for flash.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 521 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 9:51 AM
To: Allen Samuels <[email protected]>; Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningAn update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte
* 16 values = 10880Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 1 line · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes
that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
Quoted 2 lines
So with optimal encoding, the checksum baggage shouldn't be more than
4KB per oNode.
Quoted 4 lines
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes
currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
Quoted 24 lines
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to
~13K
Quoted 48 lines
Quoted 48 lines
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 30 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
Quoted 1 line
Quoted 1 line
receiving 216M of data over network and in response to that it is writing
total
Quoted 3 lines
Quoted 3 lines
of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from
FIO
Quoted 9 lines
Quoted 9 lines
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 8 lines
Quoted 8 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of
data
Quoted 11 lines
Quoted 11 lines
and reading 226M of data from disk.
Quoted 10 lines
Quoted 10 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and
206M
Quoted 2 lines
Quoted 2 lines
of read.
Quoted 1 line
Quoted 1 line
Clearly, it is an effect of rocksdb compaction that stalling IO and even if
we
Quoted 10 lines
Quoted 10 lines
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 8 lines
Quoted 8 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; CephDevelopment
Quoted 26 lines
Quoted 26 lines
Quoted 12 lines
Quoted 12 lines
Subject: RE: RocksDB tuning
Quoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 5 lines
Quoted 5 lines
Quoted 5 lines · Allen Samuels
Quoted 4 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that
can
Quoted 10 lines
Quoted 10 lines
be dropped.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here
will
Quoted 4 lines
Quoted 4 lines
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely
much
Quoted 1 line
Quoted 1 line
more in the lextent and blob maps as you alluded to above). The encoding
of
Quoted 60 lines
Quoted 60 lines
just this information alone is larger than the checksum data.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
:/ I don't really have any good ideas here.
sage
Quoted 20 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfSomnath
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Roy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 2 lines
Quoted 2 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 4 lines
Quoted 4 lines
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 16 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and
verified
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
that explicitly changing the
min_allocsize (in fact all of them to be
sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy smallrandom
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
writes.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 5 lines
Mark
Quoted 2 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in
the
Quoted 11 lines
Quoted 11 lines
future.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 2 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel-
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
<ceph-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs
choppiness
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
caused by rocksdb compaction.
We need to add the following options in
src/kv/RocksDBStore.cc
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE NOTE: The information contained in this electronic
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 receivedQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
majordomo
Quoted 4 lines
Quoted 4 lines
info
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy
any
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
and
all
Quoted 4 lines
Quoted 4 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message toQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
More majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
PLEASE NOTE: The information contained in this electronic mail
message is
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 8 lines
Quoted 8 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
I was talking about my local environment where I ran the test case. I have min 64K for the blob here. Hence I assume max 64 blobs per 4M.
Quoted 517 lines · Allen Samuels
What's the assumption that suggests a limit of 64 blobs / 4MB ? Are you assuming a 64K blobsize?? That certainly won't be the case for flash.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 507 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 9:51 AM
To: Allen Samuels <[email protected]>; Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningAn update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte
* 16 values = 10880Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 1 line · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes
that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
Quoted 1 line
So with optimal encoding, the checksum baggage shouldn't be more than
4KB per oNode.
Quoted 3 lines
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes
currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
Quoted 23 lines
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to
~13K
Quoted 47 lines
Quoted 47 lines
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 30 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
Quoted 1 line
Quoted 1 line
receiving 216M of data over network and in response to that it is writing
total
Quoted 3 lines
Quoted 3 lines
of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from
FIO
Quoted 9 lines
Quoted 9 lines
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 8 lines
Quoted 8 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of
data
Quoted 11 lines
Quoted 11 lines
and reading 226M of data from disk.
Quoted 10 lines
Quoted 10 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and
206M
Quoted 2 lines
Quoted 2 lines
of read.
Quoted 1 line
Quoted 1 line
Clearly, it is an effect of rocksdb compaction that stalling IO and even if
we
Quoted 10 lines
Quoted 10 lines
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 8 lines
Quoted 8 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; CephDevelopment
Quoted 26 lines
Quoted 26 lines
Quoted 12 lines
Quoted 12 lines
Subject: RE: RocksDB tuning
Quoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 5 lines
Quoted 5 lines
Quoted 5 lines · Allen Samuels
Quoted 4 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that
can
Quoted 10 lines
Quoted 10 lines
be dropped.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 3 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here
will
Quoted 4 lines
Quoted 4 lines
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely
much
Quoted 1 line
Quoted 1 line
more in the lextent and blob maps as you alluded to above). The encoding
of
Quoted 60 lines
Quoted 60 lines
just this information alone is larger than the checksum data.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
:/ I don't really have any good ideas here.
sage
Quoted 20 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfSomnath
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Roy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 2 lines
Quoted 2 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 3 lines
Quoted 3 lines
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 14 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningOn 06/09/2016 08:37 AM, Mark Nelson wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and
verified
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
that explicitly changing the
min_allocsize (in fact all of them to be
sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the
surface) to be due to metadata traffic during heavy smallrandom
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
writes.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 5 lines
Mark
Quoted 2 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in
the
Quoted 10 lines
Quoted 10 lines
future.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 2 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel-
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
<ceph-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs
choppiness
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
caused by rocksdb compaction.
We need to add the following options in
src/kv/RocksDBStore.cc
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
before rocksdb::DB::Open in RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks
ManaPLEASE NOTE: The information contained in this electronic
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 receivedQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] MoreQuoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
majordomo
Quoted 4 lines
Quoted 4 lines
info
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy
any
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
and
all
Quoted 4 lines
Quoted 4 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message toQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
More majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
PLEASE NOTE: The information contained in this electronic mail
message is
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above. If
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 7 lines
Quoted 7 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
Quoted 10 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Tuesday, June 14, 2016 4:12 AM
To: Allen Samuels <[email protected]>; Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuning
Quoted 2 lines
I was talking about my local environment where I ran the test case. I have min 64K for the blob here. Hence I assume max 64 blobs per 4M.
Yes, so for a 4K min_alloc_size environment (i.e., flash) the max oNode size is MUCH MUCH larger than what you're seeing.
An oNode diet is in our future.
Not a surprise -- this was always going to happen. Metadata efficiency is always a key metric for a storage system.
It will pay to optimize the encode size of the oNode so that reads and writes are optimized. It will pay to optimize the in-memory size of the oNode so that we can improve oNode cache efficiency.
Fortunately both of these can be done without disturbing the code and algorithms that have been written.
Quoted 572 lines · Allen Samuels
Quoted 1 line
What's the assumption that suggests a limit of 64 blobs / 4MB ? Are you
assuming a 64K blobsize?? That certainly won't be the case for flash.
Quoted 22 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 13 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 9:51 AM
To: Allen Samuels <[email protected]>; Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningAn update:
I found that my previous results were invalid - SyntheticWorkloadState
had
Quoted 11 lines
Quoted 11 lines
an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some
issues in
Quoted 3 lines
Quoted 3 lines
the write path...
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4
byte
Quoted 9 lines
Quoted 9 lines
* 16 values = 10880
Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 1 line · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12
bytes
Quoted 2 lines
Quoted 2 lines
that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
Quoted 1 line
So with optimal encoding, the checksum baggage shouldn't be more
than
Quoted 5 lines
Quoted 5 lines
4KB per oNode.
Quoted 3 lines
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes
currently) and length (another 8 bytes) [though as I point out, the length
is
Quoted 1 line
Quoted 1 line
something that can be optimized out] So worst case, this encoding would
be
Quoted 20 lines
Quoted 20 lines
an addition 16KB per onode.
Quoted 19 lines
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 11 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Just modified
store_testsynthetic test case to simulate many random4K
Quoted 20 lines
Quoted 20 lines
Quoted 3 lines
Quoted 3 lines
writes to 4M object.
With default settings ( crc32c + 4K block) onode size varies from 2K to
~13K
Quoted 16 lines
Quoted 16 lines
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Sage Weil
Quoted 6 lines · Somnath Roy
Quoted 4 lines
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Yeah.. you'll need to mkfs to blow away the old onodes and blobs
with
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
receiving 216M of data over network and in response to that it is
writing
Quoted 2 lines
Quoted 2 lines
total
Quoted 1 line
Quoted 1 line
of 852M of data and reading 143M of data. At this time FIO on client
side is
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
reporting ~35K 4K RW iops.
Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from
FIO
Quoted 1 line
Quoted 1 line
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M
of
Quoted 11 lines
Quoted 11 lines
data
Quoted 10 lines
Quoted 10 lines
and reading 226M of data from disk.
Quoted 9 lines
Quoted 9 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Not receiving anything from client but still writing 78M of data and
206M
Quoted 2 lines
Quoted 2 lines
of read.
Quoted 1 line
Quoted 1 line
Clearly, it is an effect of rocksdb compaction that stalling IO and even
if
Quoted 2 lines
Quoted 2 lines
we
Quoted 1 line
Quoted 1 line
increased compaction thread (and other tuning), compaction is not able
to
Quoted 31 lines
Quoted 31 lines
Quoted 9 lines
Quoted 9 lines
keep up with incoming IO.
Quoted 8 lines
Quoted 8 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; CephDevelopment
Quoted 21 lines
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
Subject: RE: RocksDB tuning
Quoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 5 lines
Quoted 5 lines
Quoted 5 lines · Allen Samuels
Quoted 4 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
IMO, you'll be able to cut the size of this by AT LEAST a factor of 3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.If you think of this as an application-specific data compression problem, here is a short list of potential compression
opportunities.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word
that
Quoted 9 lines
Quoted 9 lines
can
Quoted 8 lines
Quoted 8 lines
be dropped.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1" block, clever
choices offormatting can eliminate these entirely.
Quoted 1 line
IMO, an optimized encoded form of the extent table will be
around
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is
seeing.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data
here
Quoted 3 lines
Quoted 3 lines
will
Quoted 2 lines
Quoted 2 lines
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected
to
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
random 4K overwrites), that means somewhere in the data structures
at
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
least one address and one length for each of the 4K blocks (and likely
much
Quoted 1 line
Quoted 1 line
more in the lextent and blob maps as you alluded to above). The
encoding
Quoted 4 lines
Quoted 4 lines
of
Quoted 3 lines
Quoted 3 lines
just this information alone is larger than the checksum data.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a
custom
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata
on
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
read, etc.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
:/ I don't really have any good ideas here.
sage
Quoted 4 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development<ceph-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[email protected]>
Subject: RE: RocksDB tuningQuoted 2 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write goingon
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
and
working as expected. But, in the process, I found that onode size it is
writing
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head#is
Quoted 31 lines
Quoted 31 lines
Quoted 21 lines
Quoted 21 lines
7518
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfSomnath
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Roy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Development
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and
thus
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 1 line
Quoted 1 line
compaction as well hoping it can keep up with upcoming writes
and
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
writes
Quoted 1 line
Quoted 1 line
won't be stalling. But, eventually, after a min or so, it is stalling
io..
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_
Quoted 1 line
Quoted 1 line
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 4 lines
Quoted 4 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 8 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfMark
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 3 lines · Mark Nelson
Hi Allen,
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
that chhabaremesh's
min_alloc_sizecommit for differentmedia
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
types was committed into master:
https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
e3
efd187IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and
verified
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
that explicitly changing the
min_allocsize (in fact all of them to be
sure) to 4k does not change the behavior from graphs Ishowed
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
yesterday. The rocksdb compaction stalls due to excessive
reads
Quoted 53 lines
Quoted 53 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
appear (at least on the
surface) to be due to metadata traffic during heavy smallrandom
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
writes.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 5 lines
Mark
Quoted 2 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for
these things so that we don't have to edit the source code inthe
Quoted 10 lines
Quoted 10 lines
future.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]-----Original Message-----
From: [email protected] [mailto:ceph-devel-
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
<ceph-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs
choppiness
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
caused by rocksdb compaction.
We need to add the following options in
src/kv/RocksDBStore.cc
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
before rocksdb::DB::Open in RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks
ManaQuoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
PLEASE NOTE: The information contained in this electronic
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
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, youare
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hereby notified that you have received this message in
error
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
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).
--
To unsubscribe from this list: send the line "unsubscribe
ceph-Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
devel"
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 4 lines
Quoted 4 lines
info
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribeceph-
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
devel"
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected]
More
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected]
More
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
majordomo
Quoted 3 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
is
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 1 line
Quoted 1 line
that you have received this message in error and that any
review,
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy
any
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
and
all
Quoted 1 line
Quoted 1 line
copies of this message in your possession (whether hard copies
or
Quoted 18 lines
Quoted 18 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
electronically stored copies).
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message toQuoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
More majordomo info at http://vger.kernel.org/majordomo-
info.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
PLEASE NOTE: The information contained in this electronic mail
message is
Quoted 1 line
Quoted 1 line
intended only for the use of the designated recipient(s) named above.
If
Quoted 7 lines
Quoted 7 lines
the
Quoted 1 line
Quoted 1 line
reader of this message is not the intended recipient, you are hereby
notified
Quoted 2 lines
Quoted 2 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 1 line
Quoted 1 line
you have received this communication in error, please notify the
sender
Quoted 2 lines
Quoted 2 lines
by
Quoted 1 line
Quoted 1 line
telephone or e-mail (as shown above) immediately and destroy any
and
Quoted 8 lines
Quoted 8 lines
all
Quoted 7 lines
Quoted 7 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
Quoted 7 lines · Igor Fedotov
An update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
Quoted 8 lines
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
sage
Quoted 515 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte * 16 values = 10880
Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 13 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
Quoted 485 lines
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 476 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 25 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total
of 852M of data and reading 143M of data. At this time FIO on client side is
reporting ~35K 4K RW iops.Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 9 lines
Quoted 9 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 11 lines
Quoted 11 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 2 lines
Quoted 2 lines
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 20 lines
Quoted 20 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 6 lines
Quoted 6 lines
Quoted 6 lines · Allen Samuels
Quoted 5 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of
3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 3 lines
(3) Encoded offsets and sizes are often exactly "1" block,
clever
choices offormatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much
more in the lextent and blob maps as you alluded to above). The encoding of
just this information alone is larger than the checksum data.Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
:/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 4 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on
andQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
working as expected. But, in the process, I found that onode size
it iswriting
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 3 lines
Quoted 3 lines
type = none' and see if that is the entire reason or if something
else isgoing
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 2 lines
Quoted 2 lines
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 3 lines
Quoted 3 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 16 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
that chhabaremesh's
min_alloc_sizecommit for different media
types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
IE those tests appear to already have been using a 4K min alloc
size due to non-rotational NVMe media. I went back and verified
that explicitly changing themin_allocsize (in fact all of themQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
to be
sure) to 4k does not change the behavior from graphs I showed
yesterday. The rocksdb compaction stalls due to excessive reads
appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 1 line
Quoted 1 line
not leaked WAL data) during small random writes.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Mark
Quoted 6 lines
Mark
Quoted 3 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel-
[email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 36 lines
Quoted 36 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Here are the tunings that we used to avoid the IOPs choppiness
caused by rocksdb compaction.We need to add the following options in
src/kv/RocksDBStore.cc
beforerocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);Thanks
ManaPLEASE 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 shownQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
above) immediately and destroy any and all copies of this
message in your possession (whether hard copies or electronically stored copies).
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 5 lines
Quoted 5 lines
info
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 46 lines
Quoted 46 lines
Quoted 46 lines
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 5 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 4 lines
Quoted 4 lines
that you have received this message in error and that any review,
dissemination, distribution, or copying of this message is strictlyprohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 17 lines
Quoted 17 lines
copies of this message in your possession (whether hard copies or
electronically stored copies).Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
--
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.htmlPLEASE 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).Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
--
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
Sage,
By default 'bluestore_compression' is set to none with latest code. I will recreate the cluster with checksum off and see..
BTW, do I really need to mkfs or creating a new image (after restarting osds with checksum off) should suffice as onodes will be created during image writes ?
Thanks & Regards
Somnath
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 11:19 AM
To: Igor Fedotov
Cc: Allen Samuels; Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Quoted 7 lines · Igor Fedotov
An update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
Quoted 8 lines
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
sage
Quoted 515 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte *
16 values = 10880Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 504 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes
currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 482 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 26 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 20 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 2 lines
Quoted 2 lines
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 9 lines
Quoted 9 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 11 lines
Quoted 11 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 2 lines
Quoted 2 lines
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 21 lines
Quoted 21 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 6 lines
Quoted 6 lines
Quoted 6 lines · Allen Samuels
Quoted 5 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of
3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1"
block, clever choices offormatting can eliminate these entirely.
Quoted 5 lines
IMO, an optimized encoded form of the extent table will be around
1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
:/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 5 lines
Quoted 5 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:hea d# is7518
Quoted 45 lines
Quoted 45 lines
Quoted 45 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I
guess. Once compaction kicks in iops I am getting is *30 times* slower.I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 2 lines
Quoted 2 lines
writing WAL (?)..I used the following rocksdb option for faster
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
background
Quoted 2 lines
Quoted 2 lines
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 3 lines
Quoted 3 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style= k
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_
size_bas
e=67108864,max_background_compactions=31,level0_file_num_compaction_t ri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigge r=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_leve l
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 17 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc3
35Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 1 line
Quoted 1 line
not leaked WAL data) during small random writes.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Mark
Quoted 6 lines
Mark
Quoted 3 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 62 lines
Quoted 62 lines
Quoted 62 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: [email protected] [mailto:ceph-devel- [email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 34 lines
Quoted 34 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the IOPs choppiness caused by rocksdb compaction.
We need to add the following options in src/kv/RocksDBStore.cc before
rocksdb::DB::OpeninRocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
opt.OptimizeLevelStyleCompaction(512 * 1024
* 1024);Thanks
ManaPLEASE 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 shownQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
in the
body of a message to [email protected] MoreQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
majordomo
Quoted 6 lines
Quoted 6 lines
info
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
in the body of a message to
[email protected] Moremajordomo
Quoted 6 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] MoreQuoted 4 lines
Quoted 4 lines
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 25 lines
Quoted 7 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] MoreQuoted 11 lines
majordomo
Quoted 6 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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.htmlQuoted 2 lines
Quoted 2 lines
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).
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
majordomo
Quoted 1 line
--
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).
Quoted 3 lines · Somnath Roy
Sage,
By default 'bluestore_compression' is set to none with latest code. I will recreate the cluster with checksum off and see..
BTW, do I really need to mkfs or creating a new image (after restarting osds with checksum off) should suffice as onodes will be created during image writes ?
That'll keep checksums out of the new objects, but if you're compaction from old stuff in there that could confuse things. Perhaps if you delete the pool.. although even then you may see compaction going through old sst files (and then throwing it all away).
sage
Quoted 565 lines
Thanks & Regards
Somnath-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 11:19 AM
To: Igor Fedotov
Cc: Allen Samuels; Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 7 lines · Igor Fedotov
An update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
Quoted 8 lines
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
sage
Quoted 515 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte *
16 values = 10880Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 504 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes
currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 482 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 26 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 20 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total of 852M of data and reading 143M of data. At this time FIO on client side is reporting ~35K 4K RW iops.
Quoted 2 lines
Quoted 2 lines
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 9 lines
Quoted 9 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 11 lines
Quoted 11 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 2 lines
Quoted 2 lines
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 21 lines
Quoted 21 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 6 lines
Quoted 6 lines
Quoted 6 lines · Allen Samuels
Quoted 5 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of
3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 2 lines
(3) Encoded offsets and sizes are often exactly "1"
block, clever choices offormatting can eliminate these entirely.
Quoted 5 lines
IMO, an optimized encoded form of the extent table will be around
1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much more in the lextent and blob maps as you alluded to above). The encoding of just this information alone is larger than the checksum data.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
:/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 14 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 3 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on andQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
working as expected. But, in the process, I found that onode size it is
writing
Quoted 5 lines
Quoted 5 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:hea d# is7518
Quoted 45 lines
Quoted 45 lines
Quoted 45 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I
guess. Once compaction kicks in iops I am getting is *30 times* slower.I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 2 lines
Quoted 2 lines
type = none' and see if that is the entire reason or if something else is
going
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 2 lines
Quoted 2 lines
writing WAL (?)..I used the following rocksdb option for faster
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
background
Quoted 2 lines
Quoted 2 lines
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 3 lines
Quoted 3 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style= k
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_
size_bas
e=67108864,max_background_compactions=31,level0_file_num_compaction_t ri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigge r=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_leve l
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 17 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
that chhabaremesh's
min_alloc_sizecommit for different media types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc3
35Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
IE those tests appear to already have been using a 4K min alloc size due to non-rotational NVMe media. I went back and verified that explicitly changing the
min_allocsize (in fact all of them to be sure) to 4k does not change the behavior from graphs I showed yesterday. The rocksdb compaction stalls due to excessive reads appear (at least on the surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 1 line
Quoted 1 line
not leaked WAL data) during small random writes.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Mark
Quoted 6 lines
Mark
Quoted 3 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 62 lines
Quoted 62 lines
Quoted 62 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: [email protected]
[mailto:ceph-devel- [email protected]] On
Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph
Development<ceph-
Quoted 34 lines
Quoted 34 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Here are the tunings that we used to avoid the
IOPs choppiness caused by rocksdb compaction.We need to add the following options in
src/kv/RocksDBStore.cc before rocksdb::DB::Open
in RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
opt.OptimizeLevelStyleCompaction(512 * 1024
* 1024);Thanks
ManaPLEASE 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 shownQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
above) immediately and destroy any and all
copies of this message in your possession
(whether hard copies or electronically stored
copies).
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-devel"
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
in the
body of a message to [email protected]
MoreQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
majordomo
Quoted 6 lines
Quoted 6 lines
info
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
in the body of a message to
[email protected] Moremajordomo
Quoted 6 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] MoreQuoted 4 lines
Quoted 4 lines
majordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 3 lines
Quoted 3 lines
that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly
prohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 25 lines
Quoted 7 lines
copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] MoreQuoted 11 lines
majordomo
Quoted 6 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
--
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.htmlQuoted 2 lines
Quoted 2 lines
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).
Quoted 4 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] MoreQuoted 9 lines
Quoted 2 lines
Quoted 2 lines
majordomo
Quoted 1 line
--
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.htmlPLEASE 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). --
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
A message that is not in the archive (sent off-list or not yet received): BL2PR02MB21154152DA9CA4B6B2A4C131F4510@BL2PR02MB2115.namprd02.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
+devl
Yes Sage, make sense..I will try that and also will reduce the object size to 2MB as Allen suggested and see the effect.
Thanks & Regards
Somnath
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Saturday, June 11, 2016 6:18 AM
To: Somnath Roy
Cc: Igor Fedotov; Allen Samuels; Mark Nelson; Manavalan Krishnan
Subject: RE: RocksDB tuning
Quoted 7 lines · Somnath Roy
Removing devl as couldn't attach the graph..
Please find the graph attached for 4K RW..
I turned off crc but still onode size is 6K-9K range (checked randomly)..
Here's a simple test... remove the kNocompression option from the rocksdb options string and key if the compaction is more manageable if snappy has a go at it.
sage
Quoted 1,247 lines
Performance is similar..
[IMAGE]
Ran 10 jobs , each at peak giving ~4K , so aggregated output at peak is ~40K…But, see the choppiness..
Thanks & Regards
Somnath
-----Original Message-----
From: Somnath Roy
Sent: Friday, June 10, 2016 2:12 PM
To: 'Sage Weil'; Igor Fedotov
Cc: Allen Samuels; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningSage,
By default '
bluestore_compression' is set to none with latest code. I will recreate the cluster with checksum off and see..BTW, do I really need to mkfs or creating a new image (after restarting osds with checksum off) should suffice as onodes will be created during image writes ?
Thanks & Regards
Somnath
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 11:19 AM
To: Igor Fedotov
Cc: Allen Samuels; Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Quoted 23 lines · Igor Fedotov
An update:
I found that my previous results were invalid -
SyntheticWorkloadStatehad an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
Quoted 7 lines
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some
issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
sage
Quoted 15 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4
byte *
16 values = 10880
Branch's @github been updated with corresponding fixes.
Quoted 336 lines
Thanks,
Igor.
Quoted 328 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12
bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more
than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8
bytes
currently) and length (another 8 bytes) [though as I point out, the
length is something that can be optimized out] So worst case, this
encoding would be an addition 16KB per onode.
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]
Quoted 282 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy
Cc Allen Samuels <[email protected]>; Mark Nelson<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development <ceph-
Subject: Re: RocksDB tuning
Just modified
store_testsynthetic test case to simulate manyrandom 4K writes to 4M object.
With default settings ( crc32c + 4K block) onode size varies from
2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 14 lines · Sage Weil
Quoted 8 lines · Somnath Roy
Just turning off checksum with the below param is not helping,
I still need to see the onode size though by enabling
debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?
Yeah.. you'll need to mkfs to blow away the old onodes and blobs
Quoted 61 lines
with csum data.
As Allen pointed out, this is only part of the problem.. but I'm
curious how much!
Quoted 50 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0Quoted 1 line
42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0Quoted 1 line
40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0Quoted 1 line
40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0Quoted 1 line
42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0Quoted 1 line
35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0Quoted 1 line
31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0Quoted 1 line
39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0Quoted 1 line
40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0Quoted 1 line
40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0Quoted 1 line
42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0Quoted 1 line
For example, what last entry is saying that system (with 8
osds) is
receiving 216M of data over network and in response to that it is
writing total of 852M of data and reading 143M of data. At this
time FIO on client side is reporting ~35K 4K RW iops.
Quoted 4 lines
Quoted 4 lines
Now, after a min or so, the throughput goes down to barely 1K
from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 13 lines
Quoted 12 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0Quoted 1 line
2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0Quoted 1 line
3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0Quoted 1 line
Quoted 8 lines
Quoted 8 lines
2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0Quoted 1 line
So, system is barely receiving anything (~2M) but still
writing ~54M of data
and reading 226M of data from disk.
Quoted 17 lines
Quoted 16 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0Quoted 1 line
2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0Quoted 1 line
2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0Quoted 1 line
Quoted 8 lines
Quoted 8 lines
2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0Quoted 1 line
Not receiving anything from client but still writing 78M of
data and 206M
of read.
Quoted 3 lines
Quoted 3 lines
Clearly, it is an effect of rocksdb compaction that stalling
IO and even if we
increased compaction thread (and other tuning), compaction is not
able to keep up with incoming IO.
Quoted 46 lines
Quoted 45 lines
Thanks & Regards
Somnath
-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc Somnath Roy; Mark Nelson; Manavalan Krishnan; CephDevelopment
Subject: RE: RocksDB tuning
Quoted 23 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc Somnath Roy <[email protected]>; Mark Nelson<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development <ceph-
Subject: RE: RocksDB tuning
Quoted 1 line · Allen Samuels
Checksums are definitely a part of the problem, but I
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
suspect the smaller part of the problem. This particular
use-case (random 4K overwrites without the WAL stuff) is
the worst-case from an encoding perspective and
highlightsthe inefficiency in the current
code.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
As has been discussed earlier, a specialized
encode/decodeimplementation for these data structures is clearly called
for.
Quoted 23 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
IMO, you'll be able to cut the size of this by AT LEAST a
factor of
3 or
4 without a lot of effort. The price will be somewhat
increase CPU cost for the serialize/deserialize operation.
If you think of this as an application-specific data
compression problem, here is a short list of potential
compression opportunities.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
(1) Encoded sizes and offsets are 8-byte byte values,
converting these too
block values will drop 9 or 12 bits from each value. Also,
the ranges for these values is usually only 2^22 -- often much
less.
Quoted 145 lines
Quoted 144 lines
Quoted 144 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Meaning that there's 3-5 bytes of zeros at the top of each
word that can
be dropped.
Quoted 31 lines
Quoted 30 lines
Quoted 30 lines
Quoted 3 lines
(2) Encoded device addresses are often less than 2^32,
meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 3 lines
(3) Encoded offsets and sizes are often exactly "1"
block, clever choices of
formatting can eliminate these entirely.
Quoted 11 lines
IMO, an optimized encoded form of the extent table will be
around
1/4 of the current encoding (for this use-case) and will
likely result in an Onode that's only 1/3 of the size that
Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm
guessing this is a small part of the ~5K somnath saw. If
his objects are 4MB then 4KB of it
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
(80%) is the
csum_datavector, which is a flat vector ofu32 values that are presumably not very compressible.
I don't think that's what Somnath is seeing (obviously some
data here will
sharpen up our speculations). But in his use case, I believe that
he has a separate blob and pextent for each 4K write (since it's
been subjected to random 4K overwrites), that means somewhere in
the data structures at least one address and one length for each
of the 4K blocks (and likely much more in the lextent and blob
maps as you alluded to above). The encoding of just this
information alone is larger than the checksum data.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
We could perhaps break these into a separate key or keyspace..
That'll give rocksdb a bit more computation work to do (for
a custom merge operator, probably, to update just a piece of
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
the value) but for a 4KB value I'm not sure it's big enough
to really help. Also we'd lose locality, would need a
second get to load csum metadata on
read, etc.
Quoted 67 lines
Quoted 67 lines
Quoted 67 lines
:/ I don't really have any good ideas here.
sage
Quoted 46 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
Quoted 32 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc Mark Nelson <[email protected]>; Allen Samuels<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development
<ceph- [email protected]>
Subject: RE: RocksDB tuning
Quoted 6 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL
writegoing on and
working as expected. But, in the process, I found that
onode size it is
writing
Quoted 8 lines
Quoted 8 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:h ea
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
d# is
7518
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
This explains why so much data going to rocksdb I
guess. Once compaction kicks in iops I am getting is *30
times* slower.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
I have 15 osds on 8TB drives and I have created 4TB
rbd image preconditioned with 1M. I was running 4K RW
test.
Quoted 551 lines
Quoted 550 lines
Quoted 550 lines
Quoted 89 lines
Quoted 88 lines
Quoted 88 lines
Quoted 3 lines
Quoted 3 lines
The onode is big because of the csum metdata. Try
setting 'bluestore
csum
Quoted 4 lines
Quoted 4 lines
type = none' and see if that is the entire reason or if
something else is
going
Quoted 24 lines
Quoted 23 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 5 lines
Thanks & Regards
Somnath
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Somnath
Roy
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan;
Ceph
Development
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
As we discussed, it seems there is ~5X write amp on
the system with 4K
RW. Considering the amount of data going into rocksdb
(and thus kicking
of
Quoted 3 lines
Quoted 3 lines
compaction so fast and degrading performance
drastically) , it seems it is
still
Quoted 4 lines
Quoted 4 lines
writing WAL (?)..I used the following rocksdb option for
faster
background
Quoted 3 lines
Quoted 3 lines
compaction as well hoping it can keep up with upcoming
writes and
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
writes
Quoted 5 lines
Quoted 5 lines
won't be stalling. But, eventually, after a min or so,
it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write _
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_styl e=
k
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
CompactionStyleLevel,write_buffer_size=67108864,target_fil e_
size_base=6
7108864,max_background_compactions=31,level0_file_num_compaction _t
ri
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trig ge
r=
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_le ve
l
Quoted 44 lines
Quoted 43 lines
Quoted 43 lines
Quoted 33 lines
Quoted 32 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 30 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph
Development
Subject: Re: RocksDB tuning
On 06/09/2016 08:37 AM, Mark Nelson wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Hi Allen,
On a somewhat related note, I wanted to mention
thatI had
forgotten
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
that chhabaremesh's
min_alloc_sizecommit fordifferent media types was committed into master:
https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611d
c335
Quoted 46 lines
Quoted 45 lines
Quoted 45 lines
Quoted 19 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
e3
efd187
IE those tests appear to already have been using a
4K min alloc size due to non-rotational NVMe media.
I went back and verified that explicitly changing
the
min_allocsize (in fact all of them to besure) to 4k does not change the behavior from
graphsQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I showed yesterday. The rocksdb compaction stalls
due to excessive reads appear (at least on the
surface) to be due to metadata traffic during
heavysmall random
writes.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Sorry, this was worded poorly. Traffic due to
compaction of metadata
(ie
Quoted 9 lines
Quoted 9 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 3 lines
Mark
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Allen Samuels
Quoted 7 lines
Let's make a patch that creates actual Ceph
parameters for these things so that we don't
haveto edit the source code in the
future.
Quoted 136 lines
Quoted 135 lines
Quoted 135 lines
Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
Quoted 5 lines
-----Original Message-----
From: [email protected]
[mailto:ceph-devel- [email protected]] On
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph
Development
<ceph-
Quoted 82 lines
Quoted 81 lines
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Subject: RocksDB tuning
Hi Mark
Here are the tunings that we used to avoid the
IOPs choppiness caused by rocksdb compaction.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
We need to add the following options in
src/kv/RocksDBStore.cc before
rocksdb::DB::Openin RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 56 lines
Quoted 56 lines
Quoted 56 lines
Quoted 56 lines
opt.OptimizeLevelStyleCompaction(512 *
1024* 1024);
Thanks
Mana
PLEASE NOTE: The information contained in this
electronic mail message is intended only for
theuse of the designated
recipient(s) named above.
If the
reader of this message is not the intended
recipient, you are hereby notified that you
havereceived this message in error and that any
review, dissemination, distribution, or
copyingof this message is strictly prohibited. If you
have received this communication in error,
please notify the sender by telephone or
(as shown
above) immediately and destroy any and all
copies of this message in your possession
(whether hard copies or electronically stored
copies).
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
in the
body of a message to [email protected]
More
majordomo
Quoted 3 lines
Quoted 3 lines
info
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
in the body of a message to
[email protected] More majordomo info at
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 117 lines
Quoted 116 lines
Quoted 116 lines
Quoted 20 lines
Quoted 19 lines
Quoted 3 lines
Quoted 3 lines
in the body of a message to
[email protected] More
majordomo
Quoted 13 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
Quoted 7 lines
Quoted 7 lines
majordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this
electronic mail message
is
Quoted 4 lines
Quoted 4 lines
intended only for the use of the designated
recipient(s)named above. If
the
Quoted 3 lines
Quoted 3 lines
reader of this message is not the intended recipient,
you are hereby
notified
Quoted 5 lines
Quoted 5 lines
that you have received this message in error and that
any review, dissemination, distribution, or copying of
this message is strictly
prohibited. If
Quoted 3 lines
Quoted 3 lines
you have received this communication in error, please
notify the sender
by
Quoted 3 lines
Quoted 3 lines
telephone or e-mail (as shown above) immediately and
destroy any and
all
Quoted 53 lines
Quoted 24 lines
copies of this message in your possession (whether hard
copies or electronically stored copies).
Quoted 10 lines
--
To unsubscribe from this list: send the line
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
majordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line
Quoted 14 lines
Quoted 6 lines
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
majordomo
Quoted 5 lines
--
To unsubscribe from this list: send the line
"unsubscribeceph-devel" in the body of a message to
[email protected] More majordomo info at
Quoted 4 lines
Quoted 4 lines
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
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
copies or electronically stored copies).
Quoted 5 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 1 line
Quoted 11 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] More majordomo
Quoted 10 lines
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).
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).
For a flash-based system we want to shrink the stripe size until we get an onode that's sufficiently "small". With rocksDB as the metadata store, we want "small" to be the size that minimizes the number of log writes (but not any smaller) -- it'll take a bit of energy to figure out what this number should be, we'll need to understand the sizes of the other KV pairs that are being committed at the same time and then take into account the packing algorithm in the level0 log file.. With ZetaScale it'll be different (easier to compute, oNode size shouldn't be larger than a ZS block (8K by default)).
I don't see any point in spending energy on quantifying this until we've finished a concerted effort to "shrink" the onode encoding overhead.
The shrink really has two parts. One part is relatively straightforward code to develop an efficient representation of the lextent/blob/pextent that's optimized for the expected use cases. The other part is behavioral changes in the write-path code (like preventing too many accumulated overwrites as Sage discussed earlier).
The first part is a pretty straightforward problem once you identify the cases that you want to optimize for. The second part is likely to be more subtle and rely on machinery that hasn't been fully implemented yet.
I would recommend that, short term, we focus on the first part and see how far that gets us. Also, I suspect there's more to be learned about the behavioral front before we're able to conclusively decide what the right action is here.
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]
Quoted 1,305 lines
-----Original Message-----
From: Somnath Roy
Sent: Saturday, June 11, 2016 9:35 AM
To: Sage Weil <[email protected]>
Cc: Igor Fedotov <[email protected]>; Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <[email protected]>
Subject: RE: RocksDB tuning+devl
Yes Sage, make sense..I will try that and also will reduce the object size to 2MB as Allen suggested and see the effect.Thanks & Regards
Somnath-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Saturday, June 11, 2016 6:18 AM
To: Somnath Roy
Cc: Igor Fedotov; Allen Samuels; Mark Nelson; Manavalan Krishnan
Subject: RE: RocksDB tuningQuoted 7 lines · Somnath Roy
Removing devl as couldn't attach the graph..
Please find the graph attached for 4K RW..
I turned off crc but still onode size is 6K-9K range (checked randomly)..
Here's a simple test... remove the kNocompression option from the rocksdb options string and key if the compaction is more manageable if snappy has a go at it.
sage
Quoted 114 lines
Performance is similar..
[IMAGE]
Ran 10 jobs , each at peak giving ~4K , so aggregated output at peak is ~40K…But, see the choppiness..
Thanks & Regards
Somnath
-----Original Message-----
From: Somnath Roy
Sent: Friday, June 10, 2016 2:12 PM
To: 'Sage Weil'; Igor Fedotov
Cc: Allen Samuels; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningSage,
By default '
bluestore_compression' is set to none with latest code. I will recreate the cluster with checksum off and see..BTW, do I really need to mkfs or creating a new image (after restarting osds with checksum off) should suffice as onodes will be created during image writes ?
Thanks & Regards
Somnath
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 11:19 AM
To: Igor Fedotov
Cc: Allen Samuels; Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuning
Quoted 23 lines · Igor Fedotov
An update:
I found that my previous results were invalid -
SyntheticWorkloadStatehad an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
Quoted 7 lines
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some
issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
Quoted 328 lines
sage
Quoted 324 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4
byte *
16 values = 10880
Branch's @github been updated with corresponding fixes.
Thanks,
Igor.
Quoted 301 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12
bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more
than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8
bytes
currently) and length (another 8 bytes) [though as I point out, the
length is something that can be optimized out] So worst case, this
encoding would be an addition 16KB per onode.
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]
Quoted 255 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy
Cc Allen Samuels <[email protected]>; Mark Nelson<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development <ceph-
Subject: Re: RocksDB tuning
Just modified
store_testsynthetic test case to simulate manyrandom 4K writes to 4M object.
With default settings ( crc32c + 4K block) onode size varies from
2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 14 lines · Sage Weil
Quoted 8 lines · Somnath Roy
Just turning off checksum with the below param is not helping,
I still need to see the onode size though by enabling
debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?
Yeah.. you'll need to mkfs to blow away the old onodes and blobs
Quoted 61 lines
with csum data.
As Allen pointed out, this is only part of the problem.. but I'm
curious how much!
Quoted 50 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0
Quoted 1 line
42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0
Quoted 1 line
40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0
Quoted 1 line
40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0
Quoted 1 line
42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0
Quoted 1 line
35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0
Quoted 1 line
31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0
Quoted 1 line
39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0
Quoted 1 line
40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0
Quoted 1 line
40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0
Quoted 1 line
42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0
Quoted 1 line
For example, what last entry is saying that system (with 8
osds) is
receiving 216M of data over network and in response to that it is
writing total of 852M of data and reading 143M of data. At this
time FIO on client side is reporting ~35K 4K RW iops.
Quoted 4 lines
Quoted 4 lines
Now, after a min or so, the throughput goes down to barely 1K
from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 13 lines
Quoted 12 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0
Quoted 1 line
2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0
Quoted 1 line
3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0
Quoted 1 line
So, system is barely receiving anything (~2M) but still
writing ~54M of data
and reading 226M of data from disk.
Quoted 17 lines
Quoted 16 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out >
2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0
Quoted 1 line
2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0
Quoted 1 line
2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0
Quoted 1 line
Not receiving anything from client but still writing 78M of
data and 206M
of read.
Quoted 3 lines
Quoted 3 lines
Clearly, it is an effect of rocksdb compaction that stalling
IO and even if we
increased compaction thread (and other tuning), compaction is not
able to keep up with incoming IO.
Quoted 35 lines
Quoted 35 lines
Thanks & Regards
Somnath
-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc Somnath Roy; Mark Nelson; Manavalan Krishnan; CephDevelopment
Subject: RE: RocksDB tuning
Quoted 13 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc Somnath Roy <[email protected]>; Mark Nelson<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development
<ceph-
Quoted 219 lines
Quoted 20 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Subject: RE: RocksDB tuning
Quoted 10 lines · Allen Samuels
Checksums are definitely a part of the problem, but I
suspect the smaller part of the problem. This particular
use-case (random 4K overwrites without the WAL stuff) is
the worst-case from an encoding perspective and
highlightsthe inefficiency in the current
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
code.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
As has been discussed earlier, a specialized
encode/decodeimplementation for these data structures is clearly called
for.
Quoted 23 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
IMO, you'll be able to cut the size of this by AT LEAST a
factor of
3 or
4 without a lot of effort. The price will be somewhat
increase CPU cost for the serialize/deserialize operation.
If you think of this as an application-specific data
compression problem, here is a short list of potential
compression opportunities.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
(1) Encoded sizes and offsets are 8-byte byte values,
converting these too
block values will drop 9 or 12 bits from each value. Also,
the ranges for these values is usually only 2^22 -- often much
less.
Quoted 145 lines
Quoted 144 lines
Quoted 144 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Meaning that there's 3-5 bytes of zeros at the top of each
word that can
be dropped.
Quoted 31 lines
Quoted 30 lines
Quoted 30 lines
Quoted 3 lines
(2) Encoded device addresses are often less than 2^32,
meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 3 lines
(3) Encoded offsets and sizes are often exactly "1"
block, clever choices of
formatting can eliminate these entirely.
Quoted 11 lines
IMO, an optimized encoded form of the extent table will be
around
1/4 of the current encoding (for this use-case) and will
likely result in an Onode that's only 1/3 of the size that
Somnath is seeing.
That will be true for the lextent and blob extent maps. I'm
guessing this is a small part of the ~5K somnath saw. If
his objects are 4MB then 4KB of it
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
(80%) is the
csum_datavector, which is a flat vector ofu32 values that are presumably not very compressible.
I don't think that's what Somnath is seeing (obviously some
data here will
sharpen up our speculations). But in his use case, I believe that
he has a separate blob and pextent for each 4K write (since it's
been subjected to random 4K overwrites), that means somewhere in
the data structures at least one address and one length for each
of the 4K blocks (and likely much more in the lextent and blob
maps as you alluded to above). The encoding of just this
information alone is larger than the checksum data.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
We could perhaps break these into a separate key or keyspace..
That'll give rocksdb a bit more computation work to do (for
a custom merge operator, probably, to update just a piece of
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
the value) but for a 4KB value I'm not sure it's big enough
to really help. Also we'd lose locality, would need a
second get to load csum metadata on
read, etc.
Quoted 67 lines
Quoted 67 lines
Quoted 67 lines
:/ I don't really have any good ideas here.
sage
Quoted 46 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
Quoted 32 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc Mark Nelson <[email protected]>; Allen Samuels<[email protected]>; Manavalan Krishnan
<[email protected]>; Ceph Development
<ceph- [email protected]>
Subject: RE: RocksDB tuning
Quoted 6 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL
writegoing on and
working as expected. But, in the process, I found that
onode size it is
writing
Quoted 8 lines
Quoted 8 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:h ea
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
d# is
7518
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
This explains why so much data going to rocksdb I
guess. Once compaction kicks in iops I am getting is *30
times* slower.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 104 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
I have 15 osds on 8TB drives and I have created 4TB
rbd image preconditioned with 1M. I was running 4K RW
test.
Quoted 98 lines
Quoted 98 lines
Quoted 98 lines
Quoted 96 lines
Quoted 96 lines
Quoted 96 lines
Quoted 3 lines
Quoted 3 lines
The onode is big because of the csum metdata. Try
setting 'bluestore
csum
Quoted 4 lines
Quoted 4 lines
type = none' and see if that is the entire reason or if
something else is
going
Quoted 24 lines
Quoted 23 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 5 lines
Thanks & Regards
Somnath
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Somnath
Roy
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan;
Ceph
Development
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
As we discussed, it seems there is ~5X write amp on
the system with 4K
RW. Considering the amount of data going into rocksdb
(and thus kicking
of
Quoted 3 lines
Quoted 3 lines
compaction so fast and degrading performance
drastically) , it seems it is
still
Quoted 4 lines
Quoted 4 lines
writing WAL (?)..I used the following rocksdb option for
faster
background
Quoted 3 lines
Quoted 3 lines
compaction as well hoping it can keep up with upcoming
writes and
writes
Quoted 5 lines
Quoted 5 lines
won't be stalling. But, eventually, after a min or so,
it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
_
buffer_number_to_merge=3,recycle_log_file_num=16,compaction_styl
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
e=
k
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
CompactionStyleLevel,write_buffer_size=67108864,target_fil e_
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
size_base=6
7108864,max_background_compactions=31,level0_file_num_compaction
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
_t
ri
gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trig ge
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
r=
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_le
Quoted 50 lines
Quoted 49 lines
Quoted 49 lines
Quoted 49 lines
ve
l
Quoted 45 lines
Quoted 45 lines
Quoted 45 lines
Quoted 33 lines
Quoted 32 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 30 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph
Development
Subject: Re: RocksDB tuning
On 06/09/2016 08:37 AM, Mark Nelson wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Hi Allen,
On a somewhat related note, I wanted to mention
thatI had
forgotten
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
that chhabaremesh's
min_alloc_sizecommit forQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
different media types was committed into master:
https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611d
Quoted 365 lines
Quoted 364 lines
Quoted 364 lines
Quoted 364 lines
c3
35
Quoted 46 lines
Quoted 45 lines
Quoted 45 lines
Quoted 19 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
e3
efd187
IE those tests appear to already have been using a
4K min alloc size due to non-rotational NVMe media.
I went back and verified that explicitly changing
the
min_allocsize (in fact all of them to besure) to 4k does not change the behavior from
graphsQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I showed yesterday. The rocksdb compaction stalls
due to excessive reads appear (at least on the
surface) to be due to metadata traffic during
heavysmall random
writes.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Sorry, this was worded poorly. Traffic due to
compaction of metadata
(ie
Quoted 9 lines
Quoted 9 lines
not leaked WAL data) during small random writes.
Quoted 7 lines
Mark
Quoted 3 lines
Mark
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Allen Samuels
Quoted 7 lines
Let's make a patch that creates actual Ceph
parameters for these things so that we don't
haveto edit the source code in the
future.
Quoted 136 lines
Quoted 135 lines
Quoted 135 lines
Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
-----Original Message-----
From: [email protected]
[mailto:ceph-devel- [email protected]] On
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph
Development
<ceph-
Quoted 82 lines
Quoted 81 lines
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
Subject: RocksDB tuning
Hi Mark
Here are the tunings that we used to avoid the
IOPs choppiness caused by rocksdb compaction.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
We need to add the following options in
src/kv/RocksDBStore.cc before
rocksdb::DB::Openin RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 56 lines
Quoted 56 lines
Quoted 56 lines
opt.OptimizeLevelStyleCompaction(512 *
1024* 1024);
Thanks
Mana
PLEASE NOTE: The information contained in this
electronic mail message is intended only for
theuse of the designated
recipient(s) named above.
If the
reader of this message is not the intended
recipient, you are hereby notified that you
havereceived this message in error and that any
review, dissemination, distribution, or
copyingof this message is strictly prohibited. If you
have received this communication in error,
please notify the sender by telephone or
(as shown
above) immediately and destroy any and all
copies of this message in your possession
(whether hard copies or electronically stored
copies).
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
in the
body of a message to [email protected]
More
majordomo
Quoted 3 lines
Quoted 3 lines
info
Quoted 1 line
Quoted 1 line
Quoted 1 line
at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
in the body of a message to
[email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-
devel"
Quoted 117 lines
Quoted 116 lines
Quoted 116 lines
Quoted 20 lines
Quoted 19 lines
Quoted 3 lines
Quoted 3 lines
in the body of a message to
[email protected] More
majordomo
Quoted 13 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
Quoted 7 lines
Quoted 7 lines
majordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this
electronic mail message
is
Quoted 4 lines
Quoted 4 lines
intended only for the use of the designated
recipient(s)named above. If
the
Quoted 3 lines
Quoted 3 lines
reader of this message is not the intended recipient,
you are hereby
notified
Quoted 5 lines
Quoted 5 lines
that you have received this message in error and that
any review, dissemination, distribution, or copying of
this message is strictly
prohibited. If
Quoted 3 lines
Quoted 3 lines
you have received this communication in error, please
notify the sender
by
Quoted 3 lines
Quoted 3 lines
telephone or e-mail (as shown above) immediately and
destroy any and
all
Quoted 53 lines
Quoted 24 lines
copies of this message in your possession (whether hard
copies or electronically stored copies).
Quoted 10 lines
--
To unsubscribe from this list: send the line
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
majordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line
Quoted 14 lines
Quoted 6 lines
"unsubscribe ceph-devel"
in the body of a message to
[email protected]More
majordomo
Quoted 5 lines
--
To unsubscribe from this list: send the line
"unsubscribeceph-devel" in the body of a message to
[email protected] More majordomo info at
Quoted 4 lines
Quoted 4 lines
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
Quoted 22 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
copies or electronically stored copies).
Quoted 5 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe
ceph-devel"
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] More
majordomo
Quoted 7 lines
Quoted 6 lines
Quoted 9 lines
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).
Quoted 1 line
Quoted 12 lines · Sage Weil
Quoted 11 lines · Igor Fedotov
An update:
I found that my previous results were invalid - SyntheticWorkloadState had an odd swap for offset > len case... Made a brief fix.
Now onode size with csum raises up to 38K, without csum - 28K.
For csum case there is 350 lextents and about 170 blobs
For no csum - 343 lextents and about 170 blobs.
Quoted 7 lines
Quoted 4 lines
(blobs counting is very inaccurate!)
Potentially we shouldn't have >64 blobs per 4M thus looks like some issues in the write path...
Synthetic randomly twiddles alloc hints, which means some of those blobs are probably getting compressed. I suspect if you set 'bluestore compression = none' it'll drop back down to 64.
This result are for compression = none and write block size limited to 4K. And no ops besides writes - I made appropriate changes for Synthetic Generator and created a different test case. Moreover I saw an odd swap in SyntheticWorkloadState::write()
...
if (offset > len)
swap(offset, len);
that effectively limited the range affected by writes during this test case. Removing the swap caused a failure of the existing SynteticTest. Still investigating...
Quoted 520 lines
There is still a problem with compression, though. I think the write path should look at whether we are obscuring an existing blob with more than N layers (where N is probably 2?) and if so do a read+write 'compaction' to flatten it. That (or something like it) should get us a ~2x bound on the worst case lextent count (in this case ~128)...
sage
Quoted 511 lines
And CSum vs. NoCsum differenct looks pretty consistent - 170 blobs * 4 byte * 16 values = 10880
Branch's @github been updated with corresponding fixes.
Thanks,
Igor.Quoted 13 lines · Allen Samuels
Let's see, 4MB is 2^22 bytes. If we storage a checksum for each 2^12 bytes that's 2^10 checksums at 2^2 bytes each is 2^12 bytes.
So with optimal encoding, the checksum baggage shouldn't be more than 4KB per oNode.
But you're seeing 13K as the upper bound on the onode size.
In the worst case, you'll need at least another block address (8 bytes currently) and length (another 8 bytes) [though as I point out, the length is something that can be optimized out] So worst case, this encoding would be an addition 16KB per onode.
Quoted 483 lines
I suspect you're not at the worst-case yet :)
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 474 lines
-----Original Message-----
From: Igor Fedotov [mailto:[email protected]]
Sent: Friday, June 10, 2016 8:58 AM
To: Sage Weil <[email protected]>; Somnath Roy <[email protected]>
Cc: Allen Samuels <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningJust modified
store_testsynthetic test case to simulate many random 4K writes to 4M object.With default settings ( crc32c + 4K block) onode size varies from 2K to ~13K
with disabled crc it's ~500 - 1300 bytes.
Hence the root cause seems to be in csum array.
Here is the updated branch:
https://github.com/ifed01/ceph/tree/wip-bluestore-test-size
Thanks,
Igor
Quoted 5 lines · Sage Weil
Quoted 4 lines · Somnath Roy
Just turning off checksum with the below param is not helping, I still need to see the onode size though by enabling debug..Do I need to mkfs
(Sage?) as it is still holding checksum of old data I wrote ?Quoted 25 lines
Yeah.. you'll need to mkfs to blow away the old onodes and blobs with csum data.
As Allen pointed out, this is only part of the problem.. but I'm curious how much!
Quoted 19 lines
bluestore_csum= false
bluestore_csum_type= noneHere is the snippet of 'dstat'..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 41 14 36 5 0 4| 138M 841M| 212M 145M| 0 0 > 42 14 35 5 0 4| 137M 855M| 213M 147M| 0 0 > 40 14 38 5 0 3| 143M 815M| 209M 144M| 0 0 > 40 14 38 5 0 3| 137M 933M| 194M 134M| 0 0 > 42 15 34 5 0 4| 133M 918M| 220M 151M| 0 0 > 35 13 43 6 0 3| 147M 788M| 194M 134M| 0 0 > 31 11 49 6 0 3| 157M 713M| 151M 104M| 0 0 > 39 14 38 5 0 4| 139M 836M| 246M 169M| 0 0 > 40 14 38 5 0 3| 139M 845M| 204M 140M| 0 0 > 40 14 37 5 0 4| 149M 743M| 210M 144M| 0 0 > 42 14 35 5 0 4| 143M 852M| 216M 150M| 0 0 >For example, what last entry is saying that system (with 8 osds) is
receiving 216M of data over network and in response to that it is writing total
of 852M of data and reading 143M of data. At this time FIO on client side is
reporting ~35K 4K RW iops.Quoted 1 line
Quoted 1 line
Now, after a min or so, the throughput goes down to barely 1K from FIO
(and very bumpy) and here is the 'dstat' snippet at that time..
Quoted 9 lines
Quoted 9 lines
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 83 14 0 0| 220M 58M|4346k 3002k| 0 0 > 2 1 82 14 0 0| 223M 60M|4050k 2919k| 0 0 > 3 1 82 13 0 0| 217M 63M|6403k 4306k| 0 0 > 2 1 83 14 0 0| 226M 54M|2126k 1497k| 0 0 >So, system is barely receiving anything (~2M) but still writing ~54M of data
and reading 226M of data from disk.
Quoted 11 lines
Quoted 11 lines
After killing fio script , here is the 'dstat' output..
----total-cpu-usage---- -dsk/total- -net/total- ---paging-->
usr sys idl wai hiq siq| read writ| recv send| in out > 2 1 86 12 0 0| 186M 66M| 28k 26k| 0 0 > 2 1 86 12 0 0| 201M 78M| 20k 21k| 0 0 > 2 1 85 12 0 0| 230M 100M| 24k 24k| 0 0 > 2 1 85 12 0 0| 206M 78M| 21k 20k| 0 0 >Not receiving anything from client but still writing 78M of data and 206M
of read.
Quoted 2 lines
Quoted 2 lines
Clearly, it is an effect of rocksdb compaction that stalling IO and even if we
increased compaction thread (and other tuning), compaction is not able to keep up with incoming IO.
Quoted 20 lines
Quoted 20 lines
Thanks & Regards
Somnath-----Original Message-----
From: Allen Samuels
Sent: Friday, June 10, 2016 8:06 AM
To: Sage Weil
Cc: Somnath Roy; Mark Nelson; Manavalan Krishnan; Ceph Development
Subject: RE: RocksDB tuningQuoted 10 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:55 AM
To: Allen Samuels <[email protected]>
Cc: Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 6 lines
Quoted 6 lines
Quoted 6 lines · Allen Samuels
Quoted 5 lines
Checksums are definitely a part of the problem, but I suspect the smaller part of the problem. This particular use-case (random 4K overwrites without the WAL stuff) is the worst-case from an encoding perspective and highlights the inefficiency in the current
code.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
As has been discussed earlier, a specialized encode/decode implementation for these data structures is clearly called for.
IMO, you'll be able to cut the size of this by AT LEAST a factor of
3 or
4 without a lot of effort. The price will be somewhat increase CPU cost for the serialize/deserialize operation.If you think of this as an application-specific data compression problem, here is a short list of potential compression opportunities.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
(1) Encoded sizes and offsets are 8-byte byte values, converting these too
block values will drop 9 or 12 bits from each value. Also, the ranges for these values is usually only 2^22 -- often much less. Meaning that there's 3-5 bytes of zeros at the top of each word that can
be dropped.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
(2) Encoded device addresses are often less than 2^32, meaning there's 3-4
bytes of zeros at the top of each word that can be dropped.
Quoted 3 lines
(3) Encoded offsets and sizes are often exactly "1" block,
clever
choices offormatting can eliminate these entirely.
Quoted 4 lines
IMO, an optimized encoded form of the extent table will be around 1/4 of the current encoding (for this use-case) and will likely result in an Onode that's only 1/3 of the size that Somnath is seeing.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
That will be true for the lextent and blob extent maps. I'm guessing this is a small part of the ~5K somnath saw. If his objects are 4MB then 4KB of it
(80%) is thecsum_datavector, which is a flat vector of u32 values that are presumably not very compressible.I don't think that's what Somnath is seeing (obviously some data here will
sharpen up our speculations). But in his use case, I believe that he has a separate blob and pextent for each 4K write (since it's been subjected to random 4K overwrites), that means somewhere in the data structures at least one address and one length for each of the 4K blocks (and likely much
more in the lextent and blob maps as you alluded to above). The encoding of
just this information alone is larger than the checksum data.Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
We could perhaps break these into a separate key or keyspace.. That'll give rocksdb a bit more computation work to do (for a custom merge operator, probably, to update just a piece of the value) but for a 4KB value I'm not sure it's big enough to really help. Also we'd lose locality, would need a second get to load csum metadata on
read, etc.
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
:/ I don't really have any good ideas here.
sage
Quoted 21 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, Milpitas, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416 [email protected]Quoted 15 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Friday, June 10, 2016 2:35 AM
To: Somnath Roy <[email protected]>
Cc: Mark Nelson <[email protected]>; Allen Samuels <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: RE: RocksDB tuningQuoted 4 lines · Somnath Roy
Sage/Mark,
I debugged the code and it seems there is no WAL write going on
andQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
working as expected. But, in the process, I found that onode size
it iswriting
Quoted 4 lines
Quoted 4 lines
to my environment ~7K !! See this debug print.
Quoted 1 line
2016-06-09 15:49:24.710149 7f7732fe3700 20bluestore(/var/lib/ceph/osd/ceph-0) onode
#1:7d3c6423:::rbd_data.10186b8b4567.0000000000070cd4:head# is7518
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
This explains why so much data going to rocksdb I guess. Once compaction kicks in iops I am getting is *30 times* slower.
I have 15 osds on 8TB drives and I have created 4TB rbd image preconditioned with 1M. I was running 4K RW test.
The onode is big because of the csum metdata. Try setting 'bluestore
csum
Quoted 3 lines
Quoted 3 lines
type = none' and see if that is the entire reason or if something
else isgoing
Quoted 9 lines
Quoted 9 lines
on.
We may need to reconsider the way this is stored.
s
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of SomnathRoy
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sent: Thursday, June 09, 2016 8:23 AM
To: Mark Nelson; Allen Samuels; Manavalan Krishnan; CephDevelopment
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Subject: RE: RocksDB tuning
Mark,
As we discussed, it seems there is ~5X write amp on the system with 4KRW. Considering the amount of data going into rocksdb (and thus kicking
of
Quoted 2 lines
Quoted 2 lines
compaction so fast and degrading performance drastically) , it seems it is
still
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
writing WAL (?)..I used the following rocksdb option for faster
background
Quoted 2 lines
Quoted 2 lines
compaction as well hoping it can keep up with upcoming writes and
writes
Quoted 3 lines
Quoted 3 lines
won't be stalling. But, eventually, after a min or so, it is stalling io..
Quoted 1 line
bluestore_rocksdb_options="compression=kNoCompression,max_write_buffer_number=16,min_write_ buffer_number_to_merge=3,recycle_log_file_num=16,compaction_style=k
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
CompactionStyleLevel,write_buffer_size=67108864,target_file_size_bas e=6
7108864,max_background_compactions=31,level0_file_num_compaction_tri gger=8,level0_slowdown_writes_trigger=32,level0_stop_writes_trigger=
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
64,
num_levels=4,max_bytes_for_level_base=536870912,max_bytes_for_level
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
_multiplier=8,compaction_threads=32,flusher_threads=8"
Quoted 16 lines
I will try to debug what is going on there..
Thanks & Regards
Somnath-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Nelson
Sent: Thursday, June 09, 2016 6:46 AM
To: Allen Samuels; Manavalan Krishnan; Ceph Development
Subject: Re: RocksDB tuningQuoted 2 lines · Mark Nelson
Hi Allen,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On a somewhat related note, I wanted to mention that I had
forgotten
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
that chhabaremesh's
min_alloc_sizecommit for different media
types was committed into master:https://github.com/ceph/ceph/commit/8185f2d356911274ca679614611dc335
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
e3
efd187Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
IE those tests appear to already have been using a 4K min alloc
size due to non-rotational NVMe media. I went back and verified
that explicitly changing themin_allocsize (in fact all of themQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
to be
sure) to 4k does not change the behavior from graphs I showed
yesterday. The rocksdb compaction stalls due to excessive reads
appear (at least on the
surface) to be due to metadata traffic during heavy small randomwrites.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Sorry, this was worded poorly. Traffic due to compaction of metadata
(ie
Quoted 1 line
Quoted 1 line
not leaked WAL data) during small random writes.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Mark
Quoted 6 lines
Mark
Quoted 3 lines · Allen Samuels
Let's make a patch that creates actual Ceph parameters for these things so that we don't have to edit the source code in the
future.
Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Allen Samuels
SanDisk |a Western Digital brand
2880 Junction Avenue, San Jose, CA 95134
T: +1 408 801 7030| M: +1 408 780 6416
[email protected]Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: [email protected]
[mailto:ceph-devel-
[email protected]] On Behalf Of Manavalan Krishnan
Sent: Wednesday, June 08, 2016 3:10 PM
To: Mark Nelson <[email protected]>; Ceph Development<ceph-
Quoted 36 lines
Quoted 36 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
[email protected]>
Subject: RocksDB tuningHi Mark
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Here are the tunings that we used to avoid the IOPs
choppiness
caused by rocksdb compaction.We need to add the following options in
src/kv/RocksDBStore.cc
before rocksdb::DB::Open in RocksDBStore::do_open
opt.IncreaseParallelism(16);Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
opt.OptimizeLevelStyleCompaction(512 * 1024 * 1024);
Thanks
ManaPLEASE 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 shownQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
above) immediately and destroy any and all copies of
this
message in your possession (whether hard copies or
electronically stored copies).
--
To unsubscribe from this list: send the line
"unsubscribe
ceph-devel"
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
in the
body of a message to [email protected] Moremajordomo
Quoted 5 lines
Quoted 5 lines
info
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
Quoted 46 lines
Quoted 46 lines
Quoted 46 lines
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 5 lines
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
info at http://vger.kernel.org/majordomo-info.html
PLEASE NOTE: The information contained in this electronic mail messageis
Quoted 2 lines
Quoted 2 lines
intended only for the use of the designated recipient(s) named above. If
the
Quoted 2 lines
Quoted 2 lines
reader of this message is not the intended recipient, you are hereby
notified
Quoted 4 lines
Quoted 4 lines
that you have received this message in error and that any review,
dissemination, distribution, or copying of this message is strictlyprohibited. If
Quoted 2 lines
Quoted 2 lines
you have received this communication in error, please notify the sender
by
Quoted 2 lines
Quoted 2 lines
telephone or e-mail (as shown above) immediately and destroy any and
all
Quoted 17 lines
Quoted 17 lines
copies of this message in your possession (whether hard copies or
electronically stored copies).Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 5 lines
info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in the body of a message to [email protected] Moremajordomo
Quoted 3 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
--
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.htmlPLEASE 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).Quoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
--
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
Quoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
I've been thinking more about this and I'm wondering if we should revisit the choice to use a min_alloc_size of 4K on flash. If it's 4K, then a 4K write means
- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flush
which puts a 2 write lower bound on latency. If we have min_alloc_size of 8K or 16K, then a 4K write is
- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k write
Fewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
The upside of a larger min_alloc_size is the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).
There is probably a case where 4k min_alloc_size is the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.
sage
Quoted 4 lines · Sage Weil
Quoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
Quoted 8 lines
I've been thinking more about this and I'm wondering if we should revisit the choice to use a
min_alloc_sizeof 4K on flash. If it's 4K, then a 4K write means- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flush
AFAIK these flushes should happen async under the hood (ie almost free) on devices with proper power loss protection.
Quoted 7 lines
which puts a 2 write lower bound on latency. If we have
min_alloc_sizeof 8K or 16K, then a 4K write is- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k write
Given what I've seen about how rocksdb behaves (even on ramdisk), I think this is actually going to be worse than above in a lot of cases. I could be wrong though. For SSDs that don't have PLP this might be significantly faster.
Quoted 22 lines
Fewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
The upside of a larger
min_alloc_sizeis the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).There is probably a case where 4k
min_alloc_sizeis the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.sage
--
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
Quoted 24 lines · Mark Nelson
Quoted 4 lines · Sage Weil
Quoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
Quoted 8 lines
I've been thinking more about this and I'm wondering if we should revisit the choice to use a
min_alloc_sizeof 4K on flash. If it's 4K, then a 4K write means- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flushAFAIK these flushes should happen async under the hood (ie almost free) on devices with proper power loss protection.
Quoted 5 lines
which puts a 2 write lower bound on latency. If we have
min_alloc_sizeof
8K or 16K, then a 4K write is
Quoted 8 lines
Quoted 3 lines
- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k writeGiven what I've seen about how rocksdb behaves (even on ramdisk), I think this is actually going to be worse than above in a lot of cases. I could be wrong though. For SSDs that don't have PLP this might be significantly faster.
Sage pointed out that the smaller min_alloc_size will increase the size of the onode. More than anything this would probably be the reason imho to increase the min_alloc_size (so long as we can keep the extra data from moving out of the WAL).
Quoted 27 lines
Quoted 16 lines
Fewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
The upside of a larger
min_alloc_sizeis the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).There is probably a case where 4k
min_alloc_sizeis the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.Quoted 7 lines
sage
--
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--
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
Quoted 45 lines
-----Original Message-----
From: Mark Nelson [mailto:[email protected]]
Sent: Tuesday, June 14, 2016 6:01 AM
To: Sage Weil <[email protected]>; Igor Fedotov <[email protected]>
Cc: Allen Samuels <[email protected]>; Somnath Roy <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningQuoted 23 lines · Mark Nelson
Quoted 4 lines · Sage Weil
Quoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
Quoted 8 lines
I've been thinking more about this and I'm wondering if we should revisit the choice to use a
min_alloc_sizeof 4K on flash. If it's 4K, then a 4K write means- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flushAFAIK these flushes should happen async under the hood (ie almost free) on devices with proper power loss protection.
Quoted 4 lines
which puts a 2 write lower bound on latency. If we have
min_alloc_sizeof 8K or 16K, then a 4K write isQuoted 8 lines
Quoted 3 lines
- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k writeGiven what I've seen about how rocksdb behaves (even on ramdisk), I think this is actually going to be worse than above in a lot of cases. I could be wrong though. For SSDs that don't have PLP this might be significantly faster.
Quoted 4 lines
Sage pointed out that the smaller
min_alloc_sizewill increase the size of the onode. More than anything this would probably be the reason imho to increase themin_alloc_size(so long as we can keep the extra data from moving out of the WAL).
For flash what we want to do is leave min_alloc_size at 4K and figure out how to shrink the oNode so that the KV commit fits into a minimal number of writes.
There are two obvious things to do w.r.t. shrinking the oNode size:
(1) sophisticated encode/decode function. I've talked about this before, hopefully I'll have more time to dig into this shortly.
(2) Reducing the stripe size. A larger stripe size tends to improve sequential read/write speeds when the application is doing large I/O operations (less I/O fracturing). It will also reduce metadata size by amortizing the fixed size of an oNode (i.e., the stuff in an oNode that doesn't scale with the object size) across fewer oNodes. Both of these phenomenon provide decreasing benefits as the stripe size increases. However, larger oNodes cost more to read/write them for random I/O operations. I believe that for flash, the current default stripe size of 4MB is too large in that the gains for sequential operations are minimal and the penalty on random operations is too large... This believe should be subjected to experimental verification AFTER we've shrunk the oNode using (1). It's also po ssible that the optimal stripe size (for flash) is HW dependent -- since the variance in performance characteristics between different flash devices can be rather large.
Quoted 30 lines
Quoted 17 lines
Quoted 17 lines
Fewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
The upside of a larger
min_alloc_sizeis the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).There is probably a case where 4k
min_alloc_sizeis the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.Quoted 5 lines
Quoted 5 lines
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 5 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] Moremajordomo
Quoted 1 line
Quoted 9 lines · Allen Samuels
For flash what we want to do is leave
min_alloc_sizeat 4K and figure out how to shrink the oNode so that the KV commit fits into a minimal number of writes.There are two obvious things to do w.r.t. shrinking the oNode size:
(1) sophisticated encode/decode function. I've talked about this before, hopefully I'll have more time to dig into this shortly.
Quoted 14 lines
(2) Reducing the stripe size. A larger stripe size tends to improve sequential read/write speeds when the application is doing large I/O operations (less I/O fracturing). It will also reduce metadata size by amortizing the fixed size of an oNode (i.e., the stuff in an oNode that doesn't scale with the object size) across fewer oNodes. Both of these phenomenon provide decreasing benefits as the stripe size increases. However, larger oNodes cost more to read/write them for random I/O operations. I believe that for flash, the current default stripe size of 4MB is too large in that the gains for sequential operations are minimal and the penalty on random operations is too large... This believe should be subjected to experimental verification AFTER we've shrunk the oNode using (1). It's also possible that the optimal stripe size (for flash) is HW dependent -- since the variance in performance characteristics between different flash devices can be rather large.
Agreed on both of these.
Not mutually exclusive with (3), though: increase blob size via larger min_alloc_size. 4K random write benchmark write-amp aside, I still think we may end up with an onode size where the lower write latency and half to quarter-size lextent/blob map reduces metadata compaction overhead enough to offset the larger initial txn sizes. We'll see when we benchmark.
sage
Quoted 36 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Tuesday, June 14, 2016 2:09 PM
To: Allen Samuels <[email protected]>
Cc: Mark Nelson <[email protected]>; Igor Fedotov <[email protected]>; Somnath Roy <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <[email protected]>
Subject: RE: RocksDB tuningQuoted 9 lines · Allen Samuels
For flash what we want to do is leave
min_alloc_sizeat 4K and figure out how to shrink the oNode so that the KV commit fits into a minimal number of writes.There are two obvious things to do w.r.t. shrinking the oNode size:
(1) sophisticated encode/decode function. I've talked about this before, hopefully I'll have more time to dig into this shortly.
Quoted 6 lines
(2) Reducing the stripe size. A larger stripe size tends to improve sequential read/write speeds when the application is doing large I/O operations (less I/O fracturing). It will also reduce metadata size by amortizing the fixed size of an oNode (i.e., the stuff in an oNode that doesn't scale with the object size) across fewer oNodes. Both of these phenomenon provide decreasing benefits as the stripe size
increases.
Quoted 8 lines
However, larger oNodes cost more to read/write them for random I/O operations. I believe that for flash, the current default stripe size of 4MB is too large in that the gains for sequential operations are minimal and the penalty on random operations is too large... This believe should be subjected to experimental verification AFTER we've shrunk the oNode using (1). It's also possible that the optimal stripe size (for flash) is HW dependent -- since the variance in performance characteristics between different flash devices can be rather large.
Quoted 7 lines
Agreed on both of these.
Not mutually exclusive with (3), though: increase blob size via larger
min_alloc_size. 4K random write benchmark write-amp aside, I still think we may end up with an onode size where the lower write latency and half to quarter-size lextent/blob map reduces metadata compaction overhead enough to offset the larger initial txn sizes. We'll see when we benchmark.
Yes, we will see. I believe that on flash you'll still lose because you're writing the data twice. But let the benchmarking proceed!
(I'm assuming an oNode diet has already happended).
Quoted 2 lines
sage
Quoted 21 lines
-----Original Message-----
From: Mark Nelson [mailto:[email protected]]
Sent: Tuesday, June 14, 2016 4:54 AM
To: Sage Weil <[email protected]>; Igor Fedotov <[email protected]>
Cc: Allen Samuels <[email protected]>; Somnath Roy <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <ceph- [email protected]>
Subject: Re: RocksDB tuningQuoted 8 lines · Sage Weil
Quoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
I've been thinking more about this and I'm wondering if we should revisit the choice to use a
min_alloc_sizeof 4K on flash. If it's 4K, then a 4K write means
Quoted 7 lines
Quoted 4 lines
- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flushAFAIK these flushes should happen async under the hood (ie almost free) on devices with proper power loss protection.
Correct, from the device perspective. However, you're still burning CPU time on the host which is often the bottleneck for flash performance.
It'll pay to have a toggle to disable the bdev flushes when you're known to be running with enterprise-grade devices (i.e., "proper power loss protection")
Quoted 36 lines
Quoted 8 lines
which puts a 2 write lower bound on latency. If we have
min_alloc_sizeof 8K or 16K, then a 4K write is- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k writeGiven what I've seen about how rocksdb behaves (even on ramdisk), I think this is actually going to be worse than above in a lot of cases. I could be wrong though. For SSDs that don't have PLP this might be significantly faster.
Quoted 22 lines
Fewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
The upside of a larger
min_alloc_sizeis the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).There is probably a case where 4k
min_alloc_sizeis the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.sage
--
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
Quoted 25 lines
-----Original Message-----
From: Sage Weil [mailto:[email protected]]
Sent: Tuesday, June 14, 2016 4:18 AM
To: Igor Fedotov <[email protected]>
Cc: Allen Samuels <[email protected]>; Somnath Roy <[email protected]>; Mark Nelson <[email protected]>; Manavalan Krishnan <[email protected]>; Ceph Development <[email protected]>
Subject: Re: RocksDB tuningQuoted 2 lines · Igor Fedotov
This result are for compression = none and write block size limited to 4K.
I've been thinking more about this and I'm wondering if we should revisit the choice to use a
min_alloc_sizeof 4K on flash. If it's 4K, then a 4K write means- 4K write (to newly allocated block)
- bdev flush
- kv commit (4k-ish?)
- bdev flushwhich puts a 2 write lower bound on latency. If we have
min_alloc_sizeof 8K or 16K, then a 4K write is
Quoted 7 lines
- kv commit (4K + 4k-ish)
- bdev flush
- [async] 4k writeFewer bdev flushes, and only marginally more writes to the device. I guess the question is is whether write-amp is really that important for a 4k workload?
I don't think most people would agree that 2 -> 3 comprises "marginally more" ;-)
Sadly, this is a critical benchmark for people (independent of whether it actually is representative of any workload) and going with the KV commit path will dramatically lower the measured performance.
The true difference in performance associated with this choice will only become apparent after we've put the oNode on a diet. Right now, the "4k-ish" commit of the oNode is much much larger and it hides the performance difference associated with this choice.
If you're running on a hybrid system, i.e., metadata on flash and HDD for raw data, then the second path is the right choice -- so we'll end up needing to support both code paths :)
Quoted 12 lines
The upside of a larger
min_alloc_sizeis the worst case metadata (onode) size is 1/2 or 1/4. The sequential read cost of a previously random-written object will also be better (fewer IOs).There is probably a case where 4k
min_alloc_sizeis the right choice but it feels like we're optimizing for write-amp to the detriment of other more important things. For example, even after we improve the onode encoding, it may be that the larger metadata results in more write-amp than the WAL for the 4k writes does.sage