HeteroTSDB: 異種混合キーバリューストアを用いた自動階層化のための 時系列データベースアーキテクチャ / HeteroTSDB: A Time Series Database Architecture for Automatically Tiering on Heterogeneous Key-Value Stores
by
Yuuki Tsubouchi (yuuk1)
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
HeteroTSDB: ҟछࠞ߹ΩʔόϦϡʔετΞ Λ༻͍ͨࣗಈ֊ԽͷͨΊͷ ࣌ܥྻσʔλϕʔεΞʔΩςΫνϟ ௶ ༎थ, ࡔ ேਓ, ᖛా ݈, দ խ(ͯͳ), Ѩ෦ ത(ϨϐμϜ,ίίϯ,JAIST), দຊ ྄հ(GMOϖύϘ,͘͞ΒΠϯλʔωοτ) 2018.12.6 ୈ11ճΠϯλʔωοτͱӡ༻ٕज़γϯϙδϜ IOTS2018
Slide 2
Slide 2 text
࣍ 1. എܠͱత 2. ࣌ܥྻσʔλϕʔεͷ՝ 3. HeteroTSDBΞʔΩςΫνϟ 4. ࣮ݧͱ࣮ڥͷద༻ 5. ·ͱΊ 2
Slide 3
Slide 3 text
എܠͱత 3 1.
Slide 4
Slide 4 text
γεςϜܭଌͷॏཁੑͷߴ·Γ • Πϯλʔωοτ͕ͨΓલʹར༻Ͱ͖Δ࣌ • Մ༻ੑͱԠͷߴ͍ཁٻ • ཁٻΛຬ͍ͨͯ͠Δ͔Ͳ͏͔Λ֬ೝ͢ΔͨΊʹɺγεςϜΛৗ ʹܭଌ͢Δ͜ͱ(ϞχλϦϯά)͕ඞཁ • ϞχλϦϯάઐ༻ͷγεςϜߏஙɾӡ༻͕ඞཁ • ϞχλϦϯάγεςϜͷߏஙɾӡ༻ͷෛՙΛݮ͢ΔͨΊʹϞ χλϦϯάαʔϏεͷར༻૿Ճ 4
Slide 5
Slide 5 text
࣌ܥྻσʔλϕʔεͷཁٻ • ܭଌͨ݁͠ՌΛ࣌ܥྻʹه͠औಘ͢ΔͨΊͷ࣌ܥྻσʔλϕʔ εΛར༻͢Δ͜ͱ͕͋Δ • ϞχλϦϯάαʔϏεఏڙͷͨΊʹ࣌ܥྻσʔλϕʔεʹର͢ Δߴ͍ੑೳཁٻ͕͋Δ • ߴॻ͖ࠐΈεέʔϧΞτੑ • ߴՄ༻ੑ • ॻ͖ࠐΈॲཧޮ • σʔλอଘޮ 5
Slide 6
Slide 6 text
࣌ܥྻσʔλϕʔεͷ՝ • ϞχλϦϯάαʔϏεͷػೳՃͷͨΊʹσʔλߏΛ֦ுͯ͠ ͍͘ඞཁ͕͋Δ • ͜Ε·Ͱͷख๏Ͱ֦ுੑΛߟྀ͞Ε͍ͯͳ͔ͬͨ • ઌߦख๏ີ݁߹ͳDBMS(σʔλϕʔεཧγεςϜ)ʹґଘ 6 ຊൃදͰੑೳཁٻΛຬͨͭͭ͠ ՝ΛղܾͰ͖ΔΞʔΩςΫνϟͷఏҊ
Slide 7
Slide 7 text
ੑೳͱ֦ுੑΛཱ྆͢ΔΞʔΩςΫνϟఏҊ • ߴॻ͖ࠐΈεέʔϧΞτੑͱߴՄ༻ੑ • εέʔϧΞτ͍ͤ͢͞KVSΛར༻͢Δ • ॻ͖ࠐΈॲཧޮͱσʔλอଘޮ • ϝϞϦͱσΟεΫͷࠩͱ༰ྔ୯Ձͷੑ࣭ΛΈ߹ΘͤΔ • ΠϯϝϞϦKVSͰॻ͖ࠐΈΛड͚͚ɺΦϯσΟεΫKVSͰݹ ͍࣌ܥྻσʔλΛอ࣋͢Δ • σʔλߏͷ֦ுੑ • ֦ு༰ʹ߹Θͤͯผ్DBMSΛ༻ҙ͠ॻ͖ࠐΈΛෳ͢Δ 7
Slide 8
Slide 8 text
࣌ܥྻσʔλϕʔεͷ ՝ 8 2.
Slide 9
Slide 9 text
࣌ܥྻσʔλϕʔεͷઌߦख๏ 9 0QFO54%# (PSJMMB *OqVY%# ॻ͖ࠐΈ εέʔϧΞτੑ Մೳ Մೳ Մೳ ༻൛ͷΈ ߴՄ༻ੑ Ϋϥελػߏ༗Γ Ϋϥελػߏ༗Γ Ϋϥελػߏ༗Γ ॻ͖ࠐΈޮ ϝϞϦόοϑΝ ΠϯϝϞϦ ϝϞϦόοϑΝ σʔλอଘޮ ແѹॖ ѹॖ ѹॖ ૄ݁߹ੑ ີ݁߹ ີ݁߹ ີ݁߹
Slide 10
Slide 10 text
HeteroTSDB ΞʔΩςΫνϟ 10 3.
Slide 11
Slide 11 text
֦ுੑͷ͋Δ࣌ܥྻDBͷઃܭ • ີ݁߹ͳDBMSͦͷͷΛ֦ு͢Δ͜ͱ༰қͰͳ͍ • ༻్͝ͱʹҟͳΔෳͷDBMSΛΈ߹Θͤͨҟछࠞ߹DBMS ʹΑΔૄ݁߹ԽΛࢦ͢ • ΠϯσοΫεͷΑ͏ͳՃͷσʔλߏͷͨΊͷDBMSΛઐ༻ ʹஔ͢Δ 11
Slide 12
Slide 12 text
ॻ͖ࠐΈޮͱσʔλอ࣋ޮͷཱ྆ • ߴͳΠϯϝϞϦKVSͰॻ͖ࠐΈΛड͚͚Δ • (1) ϝϞϦσΟεΫͱൺֱ͠༰ྔ୯Ձ͕େ͖͍ • ΦϯσΟεΫKVSݹ͍σʔλΛҠಈ͢ΔKVSͷࣗಈ֊Խ • (2) ΠϯϝϞϦKVSͷނো࣌ʹϝϞϦ্ͷσʔλ͕شൃ͢Δ • ϝοηʔδϒϩʔΧʔʹઌߦॻ͖ࠐΈ͓͖ͯ͠ɺσʔλফࣦ࣌ ʹϒϩʔΧʔ্ͷσʔλΛ࠶ॲཧ͠ɺΠϯϝϞϦKVS্ͷσʔ λΛ෮چͤ͞Δ 12
Slide 13
Slide 13 text
HeteroTSDBͷϑϩʔ 13 Message Broker (1) write Client Metric Writer Metric Reader In-Memory KVS On—Disk KVS (2) subscribe and write (3) migration (i) query (ii) read from each kvs (iii) merge datapoints (ii)
Slide 14
Slide 14 text
ΩʔόϦϡʔܗࣜΛલఏͱͨ࣌͠ܥྻσʔλߏ 14 • (1) KVSͰൣғݕࡧ͕Ͱ͖ͳ͍࣮͕͋Δ • λΠϜελϯϓΛղ૾ͷഒʹἧ͑ͯॻ͖ࠐΈ(ΞϥΠϯϝϯτ) • (2) KVSͷࢀরճ͕ଟ͍ • ҰͭͷΩʔόϦϡʔϖΞʹಉҰܥྻͷෳͷσʔλΛ֨ೲ • (3) KVSͷΩʔόϦϡʔϖΞαΠζͷ੍ݶΛ͑ͯ͠·͏ • ݻఆͷλΠϜΟϯυʹΑΓܥྻΛׂͯ֨͠ೲ • (4) ॻ͖ࠐΈΤϥʔ࣌ͷ࠶ࢼߦ࣌ʹಉ͡σʔλΛॏෳอଘͯ͠͠·͏ • ࣌ࠁΛΩʔͱͨ͠ϋογϡϚοϓʹΑΓɺ͖ʹॻ͖ࠐΈ
Slide 15
Slide 15 text
15 (3) λΠϜΟϯυ (4) ϋογϡϚοϓ (1) ΞϥΠϯϝϯτ (2) ܥྻ୯ҐͷϖΞ
Slide 16
Slide 16 text
KVSؒͷσʔλҠಈ: λΠϚʔख๏ • ΩʔόϦϡʔϖΞ୯ҐͰλΠϚʔΛઃఆ • λΠϚʔ͕0ʹͳΔͱτϦΨʔ͕ىಈ͠ϖΞ୯ҐͰσʔλҠಈ • ϖΞ୯ҐͷҠಈґଘؔΛ࣋ͨͳ͍ಠཱͨ͠ॲཧͱͳΔͨΊɺ ฒߦॲཧ͕༰қ 16 • ࣮ͰTTL (Time To Live)Λར༻
Slide 17
Slide 17 text
KVSؒͷσʔλҠಈ: Χϯτख๏ • TTL͕ͳ͍KVSΛར༻͢Δ߹ • ܥྻͷσʔλ͕֓ͶҰఆִؒͰॻ͖ࠐ·ΕΔ͜ͱʹண • σʔλͷॻ͖ࠐΈ࣌ʹɺλΠϜΟϯυͷσʔλ͕Ұ ఆݸҎ্Ͱ͋ΕσʔλΛҠಈ • ҠಈʹɺλΠϜΟϯυͷσʔλΛಡΈग़͠ɺҠಈઌ ͷKVSʹॻ͖ࠐΈɺҠಈݩͷσʔλΛআ͢Δ • ్தͰॻ͖ࠐΈ͕ఀࢭͨ͠ܥྻʹ͍ͭͯɺఆظతʹશσʔλ ΛεΩϟϯ͠ɺҠಈॲཧΛ࣮ࢪ 17
Slide 18
Slide 18 text
σʔλߏͷ֦ு • ϦΞϧλΠϜॻ͖ࠐΈ • ϝοηʔδϒϩʔΧʔͷߪಡऀΛผ్༻ҙ͠ɺՃDBMSʹॻ ͖ࠐΈ • ॻ͖ࠐ·Εͨσʔλ͕֦ு͞ΕͨDBMS্ʹଈө • όονॻ͖ࠐΈ • ΠϯϝϞϦKVS͔ΒΦϯσΟεΫKVSҠಈ͢Δͱ͖ʹɺෳͷ ܥྻσʔλΛ·ͱΊͯՃDBMSʹॻ͖ࠐΈ • ՃDBMSͷॻ͖ࠐΈճΛݮ 18
Slide 19
Slide 19 text
HeteroTSDBΞʔΩςΫνϟͷ࣮ 19 • AWS্Ͱ࣮ • ҟछࠞ߹KVSڥʹͯ૿Ճ͢Δӡ༻ෛ୲ ͷݮͷͨΊαʔόϨεϓϥοτϑΥʔϜΛར༻ • ϝϞϦɺSSDɺ࣓ؾσΟεΫͷ3ߏ
Slide 20
Slide 20 text
HeteroTSDBΞʔΩςΫνϟ·ͱΊ • ΠϯϝϞϦKVSͱΦϯσΟεΫKVSʹΑΔࣗಈ֊Խ • ࣌ܥྻσʔλߏ • ΞϥΠϯϝϯτɺλΠϜΟϯυɺϋογϡϚοϓ • KVSؒͷσʔλҠಈ • λΠϚʔख๏: ΩʔόϦϡʔϖΞ୯ҐͰฒߦॲཧՄೳ • Χϯτख๏: TTLΛར༻Ͱ͖ͳ͍߹ʹར༻ • σʔλߏͷ֦ு • ϦΞϧλΠϜॻ͖ࠐΈ • όονॻ͖ࠐΈ 20
Slide 21
Slide 21 text
࣮ݧͱ࣮ڥͷద༻ 21 4.
Slide 22
Slide 22 text
22 ߲ ༷ #FODINBSL $MJFOU &$Πϯελϯε ΠϯελϯελΠϓ 04 ,FSOFM DYMBSHF "NB[PO-JOVY .FTTBHF #SPLFS ,JOFTJT%BUB4USFBNT γϟʔυ .FUSJD 8SJUFS -BNCEB ϝϞϦྔ ϥϯλΠϜ .# /PEFKT *O.FNPSZ ,74 &MBTUJ$BDIFGPS3FEJT ϊʔυλΠϓ γϟʔυ DBDIFSMBSHF 0O%JTL,74 %ZOBNP%# ࣮ࡍͷϫʔΫϩʔυΛͨ͠ϕϯ νϚʔΧʔΛ࡞ • ΤʔδΣϯτ • ΤʔδΣϯτͷϝτϦοΫૹ৴ ִؒ (1ݻఆ) • 1ճͷૹ৴͋ͨΓʹؚ·ΕΔϝτ ϦοΫ (100ݻఆ) ΤʔδΣϯτ 3FEJT ϊʔυ %ZOBNP%# 8$6 1 1 1 1 P1~P4ͷύϥϝʔληοτΛ༻͍ͯϦιʔ εมԽΛ2࣌ؒ؍͢Δ
Slide 23
Slide 23 text
࣮ݧ݁Ռ: ؒॻ͖ࠐΈճ 23 0 1 2 3 4 5 0 20 40 60 80 100 120 datapoint writes / min (mega) minutes In-Memory KVS On-Disk KVS ΠϯϝϞϦKVSͷؒॻ͖ࠐΈճ 4MͰҰఆ ΦϯσΟεΫKVSؒॻ͖ࠐΈճ 70k͔Β170kͷؒΛਪҠ ΦϯσΟεΫKVSͷ ؒॻ͖ࠐΈճΛ 1/20ʹݮͨ͜͠ͱ͕Θ͔Δ ॻ͖ࠐΈεϧʔϓοτͷ࣌ؒมԽ
Slide 24
Slide 24 text
24 0 10 20 30 40 50 60 70 80 90 100 0 20 40 60 80 100 120 0 2 4 6 8 10 12 14 16 CPU usage (%) Free memory size (GB) minutes master CPU usage (%) slave1 CPU usage (%) slave2 CPU usage (%) Free memory size (GB) 50Λ͑ͨͱ͜ΖͰ ۭ͖ϝϞϦ༻ྔ͕10.5GBͰҰఆʹͳͬ ͍ͯΔͨΊσʔλҠಈͰ͖͍ͯΔͱ͍͑Δ CPUར༻ͱϝϞϦ༻ྔ
Slide 25
Slide 25 text
25 0 2 4 6 8 10 12 14 16 18 P1 P2 P3 P4 0 100 200 300 400 500 600 writes / min (mega) writes / min (kilo) parameters set In-Memory KVS [writes/min (mega)] On-Disk KVS [writes/min (kilo)] ΠϯϝϞϦKVSϊʔυͱ ΦϯσΟεΫKVSͷΩϟύγ ςΟͷ૿Ճʹରͯ͠εϧʔϓο τ͕ઢܗʹεέʔϧ͍ͯ͠Δ ͱݴ͑Δ ΩϟύγςΟͱ ॻ͖ࠐΈεϧʔϓοτ ͷؔ
Slide 26
Slide 26 text
Mackerelͷ࣮ڥͷద༻ • 20177݄͔Β20188݄·Ͱͷ1ؒͷՔಇ࣮ • ಉظؒͷো݅2݅ɺނোճ2݅ • ো1: ಛఆͷΠϯϝϞϦKVSͷϊʔυʹॻ͖ࠐΈෛՙ͕ूத͠ɺϝϞ Ϧ্ݶʹୡ͠ɺOSʹڧ੍ఀࢭ͞Εɺσʔλফࣦൃੜ • ϝοηʔδϒϩʔΧʔ্ͷσʔλΛ࠶ॲཧ͠σʔλ෮چ • ো2: ಉҰͷϝτϦοΫ໊ͱλΠϜελϯϓΛͭσʔλ͕࣌ؒ ʹେྔʹॻ͖ࠐ·ΕɺΠϯϝϞϦKVSͷॻ͖ࠐΈαΠζ্ݶʹୡͨ͠ • ΠϯϝϞϦKVSʹॻ͖ࠐΉલʹॏෳΛഉআ͢Δ͜ͱͰղܾ 26
Slide 27
Slide 27 text
Mackerelͷ࣮ڥͷద༻ • ނোʹ͍ͭͯɺ͍ͣΕΠϯϝϞϦKVSͷϊʔυ͕ఀࢭ͠ɺ ֘ϊʔυ͕Ϋϥελ͔Β֎ΕΔ·ͰͷؒʹΤϥʔ͕ൃੜͨ͠ • Lambda࣮ؔߦͷࣗಈ࠶ࢼߦʹΑΓࣗಈͰσʔλ෮چ • Ұ෦ͷϝτϦοΫͷॻ͖ࠐΈ͕Ԇ͢ΔʹͱͲ·ͬͨ 27
Slide 28
Slide 28 text
࣮ݧͱ࣮ڥͷద༻ͷ·ͱΊ • ॻ͖ࠐΈॲཧޮ • ΦϯσΟεΫKVSͷॻ͖ࠐΈճΛ1/20ʹݮͰ͖ͨ • σʔλอଘޮ • ΠϯϝϞϦKVSͷϝϞϦ༻ྔ͕ຬഋʹͳΔ͜ͱͳ͘ɺσʔλҠಈͰ͖ ͍ͯΔ͜ͱΛ֬ೝͰ͖ͨ • ॻ͖ࠐΈεέʔϧΞτੑ • KVSͷΩϟύγςΟ૿Ճʹର͢Δεϧʔϓοτͷઢܗ૿ՃΛ֬ೝͰ͖ͨ • ߴՄ༻ੑͱσʔλফࣦੑ • ࣮ڥʹద༻͢Δ͜ͱʹΑΓ֬ೝͰ͖ͨ 28
Slide 29
Slide 29 text
·ͱΊ 29 5.
Slide 30
Slide 30 text
·ͱΊ • ੑೳͱ֦ுੑΛཱ྆͢Δ࣌ܥྻσʔλϕʔεΞʔΩςΫνϟͷ ఏҊ • AWSͷϚωʔδυαʔϏεʹΑΓҟछࠞ߹σʔλετΞΛલఏ ͱͨ͠ΞʔΩςΫνϟͷߴ͍࣮ݱੑ • Mackerelͷ࣌ܥྻσʔλϕʔεͱͯ͠1ͷՔಇ࣮ 30
Slide 31
Slide 31 text
ࠓޙͷల • ઌߦͷ࣌ܥྻσʔλϕʔεͱͷੑೳൺֱ࣮ݧ • σʔλߏͷ֦ுੑΛ׆͔ͨ͠ػೳͷ࣮ • σʔλஔใͷΠϯσΩγϯάʹΑΔࢀর͍߹ΘͤͷϨΠ ςϯγͷ࠷దԽ • ଟ࣍ݩσʔλϞσϧͷରԠ • KVSؒͷσʔλҠಈख๏ͷ൚༻Խ • ॲཧͱσʔλͱλΠϚʔΛҰମԽͨ͠σʔλύΠϓϥΠϯ 31