$30 off During Our Annual Pro Sale. View Details »

Problems and Solutions for Two Billion Recommendations Per Day

Problems and Solutions for Two Billion Recommendations Per Day

Naoki Watanabe (hackmylife) (LINE / CRS dev team / Software engineer )

https://tech-verse.me/ja/sessions/13
https://tech-verse.me/en/sessions/13
https://tech-verse.me/ko/sessions/13

Tech-Verse2022
PRO

November 18, 2022
Tweet

More Decks by Tech-Verse2022

Other Decks in Technology

Transcript

  1. View Slide

  2. Agenda
    - About Smart Channel
    - Architecture
    - Troubles & Solutions
    - Lessons learned

    View Slide

  3. Smart Channel

    View Slide

  4. Smart Channel

    View Slide

  5. Smart Channel

    View Slide

  6. Service Concept

    View Slide

  7. Contents
    Service Concept

    View Slide

  8. Contents
    Service Concept

    View Slide

  9. Contents Personalize
    Service Concept

    View Slide

  10. Stats
    Request / day MAU Items / day

    View Slide

  11. Stats
    Request / day
    2 billion
    MAU Items / day

    View Slide

  12. Stats
    Request / day
    2 billion
    MAU
    167 million
    Items / day

    View Slide

  13. Stats
    Request / day
    2 billion
    MAU
    167 million
    Items / day
    16 million

    View Slide

  14. Architecture

    View Slide

  15. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Services
    LINE APP

    View Slide

  16. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Services
    Contents
    LINE APP

    View Slide

  17. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Request
    Services
    Contents
    LINE APP

    View Slide

  18. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Services
    Contents
    LINE APP

    View Slide

  19. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Services
    Contents
    LINE APP
    Contents

    View Slide

  20. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Imp/Click
    Services
    Contents
    LINE APP
    Contents

    View Slide

  21. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Imp/Click
    Log
    Services
    Contents
    LINE APP
    Contents

    View Slide

  22. Flow
    CRS Engine
    Event Tracker
    Learning
    worker
    Imp/Click
    Log
    Services
    Parameter
    Contents
    LINE APP
    Contents

    View Slide

  23. Key function

    View Slide

  24. Gathers recommended contents from services
    Key function

    View Slide

  25. Gathers recommended contents from services
    Select best ones of the many contents
    Key function

    View Slide

  26. Gathers recommended contents from services
    Learning users preferences & use them to make the next selection
    Select best ones of the many contents
    Key function

    View Slide

  27. https://linedevday.linecorp.com/jp/2019/sessions/B1-2

    View Slide

  28. Peak Traffic

    View Slide

  29. Peak Traffic
    - LINE’s peak traffic is New Year

    View Slide

  30. Peak Traffic
    - LINE’s peak traffic is New Year
    - Especially JP (GTM+9)

    View Slide

  31. Peak Traffic
    - LINE’s peak traffic is New Year
    - Especially JP (GTM+9)
    - 250k request / second

    View Slide

  32. Peak Traffic
    - LINE’s peak traffic is New Year
    - Especially JP (GTM+9)
    - 250k request / second
    - Client side cache is effective

    View Slide

  33. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    New Year Peek of 2018

    View Slide

  34. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    New Year Peek of 2018

    View Slide

  35. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    180 121,000
    New Year Peek of 2018

    View Slide

  36. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    180 121,000
    300 107,000
    New Year Peek of 2018

    View Slide

  37. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    180 121,000
    300 107,000
    600 71,000
    New Year Peek of 2018

    View Slide

  38. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    180 121,000
    300 107,000
    600 71,000
    1800 58,000
    New Year Peek of 2018

    View Slide

  39. Request with client-side cache
    TTL (seconds) Estimated RPS
    0 250,000
    60 148,000
    180 121,000
    300 107,000
    600 71,000
    1800 58,000
    New Year Peek of 2018

    View Slide

  40. Core system
    LINE App Services
    CRS
    Engine

    View Slide

  41. Core system
    LINE App Services
    CRS
    Engine

    View Slide

  42. Core system
    LINE App Services
    CRS
    Engine

    View Slide

  43. Core system
    LINE App Services
    Importer
    CRS
    Engine

    View Slide

  44. Core system
    LINE App Services
    Importer
    CRS
    Engine
    Redis
    Cluster

    View Slide

  45. Data Modeling

    View Slide

  46. Data Modeling

    View Slide

  47. Data Modeling

    View Slide

  48. Data Modeling

    View Slide

  49. Data Modeling
    167Million times

    View Slide

  50. Data Modeling

    View Slide

  51. Data Modeling
    Item-A ID
    Item-B ID
    Item-C ID
    Item-A ID
    Item-D ID

    View Slide

  52. Data Modeling
    Item-A ID
    Item-B ID
    Item-C ID
    Item-A ID
    Item-D ID

    View Slide

  53. Targeting
    Data Modeling
    Item-A ID
    Item-B ID
    Item-C ID
    Item-A ID
    Item-D ID

    View Slide

  54. Information
    Targeting
    Data Modeling
    Item-A ID
    Item-B ID
    Item-C ID
    Item-A ID
    Item-D ID

    View Slide

  55. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Value: Item-A ID, Item-B ID, ….

    View Slide

  56. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….

    View Slide

  57. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….

    View Slide

  58. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    + Service X

    View Slide

  59. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Key: User-A ID
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y

    View Slide

  60. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Key: User-A ID
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y

    View Slide

  61. Redis Cluster
    Redis Cluster
    Key: User-A ID
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Key: User-A ID
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y

    View Slide

  62. Redis Cluster
    Redis Cluster
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y
    Key: {User-A ID}
    Key: {User-A ID}

    View Slide

  63. Redis Cluster
    Redis Cluster
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y
    Key: {User-A ID}
    Key: {User-A ID}

    View Slide

  64. Redis Cluster
    Redis Cluster
    Node 3
    Node 2
    Node 1
    Value: Item-A ID, Item-B ID, ….
    Value: Item-X ID, Item-Y ID, ….
    + Service X
    + Service Y
    Key: {User-A ID}
    Key: {User-A ID}
    Value: Item-C ID, Item-D ID, ….
    + Service X
    Key: {User-B ID}

    View Slide

  65. Data Modeling
    Type Data format Distribution Key
    Targeting Redis
    {User-A}:Service x => Item-A ID, Item-B ID, …
    {User-A}:Service Y => Item-X ID, Item-Y ID, …
    {User-B}:Service X => Item-C ID, Item-D, …
    User ID

    View Slide

  66. Data Modeling
    Type Data format Distribution Key
    Targeting Redis
    {User-A}:Service x => Item-A ID, Item-B ID, …
    {User-A}:Service Y => Item-X ID, Item-Y ID, …
    {User-B}:Service X => Item-C ID, Item-D, …
    User ID
    Information Redis Item ID

    View Slide

  67. Delivery flow
    Information

    View Slide

  68. Delivery flow
    Targeting
    Redis
    Information
    Fetch
    Targeting

    View Slide

  69. Delivery flow
    Targeting
    Redis
    Fetch
    Information
    Information
    Redis
    Information
    Fetch
    Targeting

    View Slide

  70. Delivery flow
    Targeting
    Redis
    Fetch
    Information
    Information
    Redis
    Information
    Fetch
    Targeting Ranking

    View Slide

  71. Look before you leap
    - Measure performance per web server

    View Slide

  72. Look before you leap
    - Measure performance per web server

    View Slide

  73. Look before you leap
    - Measure performance per web server

    View Slide

  74. Look before you leap
    - Release gradually
    - Measure performance per web server

    View Slide

  75. Look before you leap
    - Release gradually
    - Always A/B test if anything is unclear
    - Measure performance per web server

    View Slide

  76. Troubles & Solutions

    View Slide

  77. 1st trouble
    Targeting
    Redis
    Fetch
    Information
    Information
    Redis
    Information
    Fetch
    Targeting Ranking

    View Slide

  78. 1st trouble
    Targeting
    Redis
    Fetch
    Information
    Information
    Redis
    Information
    Fetch
    Targeting Ranking

    View Slide

  79. Sudden slowdown Response
    2020/11/10

    View Slide

  80. Sudden slowdown Response
    99%tile 50ms
    2020/11/10

    View Slide

  81. Sudden slowdown Response
    99%tile 50ms
    2020/11/10 2020/12/1

    View Slide

  82. Sudden slowdown Response
    99%tile 50ms 99%tile 200ms
    2020/11/10 2020/12/1

    View Slide

  83. Information Redis Stats
    Time

    View Slide

  84. Information Redis Stats
    Count
    Time

    View Slide

  85. Recommended Item Increasing
    ↓11/1 8.3 items/user
    12/5 20.5 items/user↓

    View Slide

  86. Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID

    View Slide

  87. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID

    View Slide

  88. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F

    View Slide

  89. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  90. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  91. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Item F ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  92. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Item F ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  93. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Item D ID
    Item C ID
    Item F ID
    Item e ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  94. Fetch Information Process
    Hypothesis - 1
    Fetch Target Process
    Targeting Redis
    Item a ID Item B ID
    Item D ID
    Item C ID
    Item F ID
    Item e ID
    Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Lettuce (mget)

    View Slide

  95. Verification -1
    Execution time (99%tile)

    View Slide

  96. Verification -1
    1-9 items
    Execution time (99%tile)

    View Slide

  97. Verification -1
    1-9 items
    10-19 items
    Execution time (99%tile)

    View Slide

  98. Verification -1
    1-9 items
    10-19 items
    20-29 items
    Execution time (99%tile)

    View Slide

  99. Verification -1
    1-9 items
    10-19 items
    20-29 items
    30-39 items
    Execution time (99%tile)

    View Slide

  100. Verification -1
    1-9 items
    10-19 items
    20-29 items
    30-39 items
    Over 40 items
    Execution time (99%tile)

    View Slide

  101. Verification -1
    1-9 items
    10-19 items
    20-29 items
    30-39 items
    Over 40 items
    Execution time (99%tile) Command count

    View Slide

  102. Verification -1
    1-9 items
    10-19 items
    20-29 items
    30-39 items
    Over 40 items
    Execution time (99%tile) Command count
    1-9 items
    10-19 items
    20-29 items
    30-39 items
    Over 40 items

    View Slide

  103. Targeting
    Hypothesis - 2
    X
    Y
    Z

    View Slide

  104. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    X
    Y
    Z

    View Slide

  105. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    X
    Y
    Z

    View Slide

  106. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    X
    Y
    Z

    View Slide

  107. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    Item a ID Item F ID
    X
    Y
    Z

    View Slide

  108. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    Item a ID Item F ID
    X
    Y
    Z

    View Slide

  109. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    X
    Y
    Z

    View Slide

  110. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    X
    Y
    Z

    View Slide

  111. Information Redis
    Node 1 Node 3
    Node 2
    Item A
    Item B
    Item C
    Item D
    Item E
    Item F
    Targeting
    Fetch Information Process
    Hypothesis - 2
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    X
    Y
    Z

    View Slide

  112. Problem & Solution
    # Issue Problem

    View Slide

  113. Problem & Solution
    # Issue Problem
    1 Burst of MGET command
    • Recommend items increased
    • Need access to multiple Redis nodes to retrieve
    information

    View Slide

  114. Problem & Solution
    # Issue Problem
    1 Burst of MGET command
    • Recommend items increased
    • Need access to multiple Redis nodes to retrieve
    information
    2
    Concentration of
    Targeting
    • There is content recommended by many people
    • Concentration of access to specific node

    View Slide

  115. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking

    View Slide

  116. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking

    View Slide

  117. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking
    Limit

    View Slide

  118. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking
    Limit
    ↓ Not Smart

    View Slide

  119. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking

    View Slide

  120. Solution1 - Burst of MGET command
    Fetch
    Information
    Information
    Redis
    Information
    Targeting
    Redis
    Fetch
    Targeting Ranking
    Smart
    Filter

    View Slide

  121. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Filter
    Fetch
    Information

    View Slide

  122. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Filter
    Information
    Filter
    Targeting
    Filter
    Fetch
    Information

    View Slide

  123. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Fetch
    Information

    View Slide

  124. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Fetch
    Information

    View Slide

  125. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information

    View Slide

  126. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information

    View Slide

  127. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)

    View Slide

  128. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)

    View Slide

  129. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5

    View Slide

  130. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item Item Item

    View Slide

  131. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item Item Item
    Item
    Item Item Item Item Item

    View Slide

  132. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item
    Item Item Item Item Item
    Item Item Item

    View Slide

  133. Smart Filter
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item
    Item Item Item
    Item Item Item Item Item

    View Slide

  134. Smart Filter
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item Item Item
    Item
    Item Item Item Item Item
    Item Item Item
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information

    View Slide

  135. Smart Filter
    Tier 1 (user log based)
    Tier 2 (user attribute based)
    Limit N = 5
    Item
    Item
    Item Item Item Item Item
    Item Item Item Item Item
    Information
    Fetch
    Targeting Ranking
    Information
    Filter
    Targeting
    Filter
    Limit Fetch
    Information

    View Slide

  136. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    X
    Y
    Z

    View Slide

  137. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    X
    Y
    Z

    View Slide

  138. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    X
    Y
    Z

    View Slide

  139. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    X
    Y
    Z

    View Slide

  140. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    X
    Y
    Z

    View Slide

  141. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    X
    Y
    Z

    View Slide

  142. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    X
    Y
    Z

    View Slide

  143. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    X
    Y
    Z

    View Slide

  144. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F
    X
    Y
    Z

    View Slide

  145. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F
    X
    Y
    Z

    View Slide

  146. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F
    X
    Y
    Z

    View Slide

  147. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F Item D
    X
    Y
    Z

    View Slide

  148. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F Item D
    Caffeine
    Cache time: 5s
    Eviction: size-based
    X
    Y
    Z

    View Slide

  149. Solution2 - Concentration of Targeting
    Information Redis
    Node 1
    Node 3
    Node 2
    Item A Item B
    Item C Item D
    Item E Item F
    Targeting
    Item a ID Item B ID
    Item a ID Item F ID
    Item D ID
    Item B ID
    Cache (size=4)
    Item A Item B
    Item F Item D
    Caffeine
    Cache time: 5s
    Eviction: size-based
    X
    Y
    Z

    View Slide

  150. Results
    Percentile
    Response Time
    Before After
    99.9 352ms 67ms
    99.0 176ms 29ms
    95.0 126ms 22ms
    75.0 92ms 16ms

    View Slide

  151. Results
    Percentile
    Response Time
    Before After
    99.9 352ms 67ms
    99.0 176ms 29ms
    95.0 126ms 22ms
    75.0 92ms 16ms
    80% faster

    View Slide

  152. Earthquake
    2nd trouble

    View Slide

  153. Earthquake
    CHIBA M 5.9
    2021/10/7 22:41
    https://www.jma.go.jp/jma/press/2110/08c/202110080050.html
    2nd trouble

    View Slide

  154. Traffic explosion

    View Slide

  155. Traffic explosion
    Request per second

    View Slide

  156. Traffic explosion
    Request per second Application server threads

    View Slide

  157. Service effect
    Earthquake notice expected

    View Slide

  158. Service effect
    Earthquake notice expected
    Some request time outed…

    View Slide

  159. Prioritized Delivery
    Fetch
    Information Information
    Fetch
    Targeting Ranking
    Prioritized
    Contents
    Information

    View Slide

  160. Prioritized Delivery
    Fetch
    Information Information
    Fetch
    Targeting Ranking
    Prioritized
    Contents
    Information
    Disaster information threshold

    View Slide

  161. Prioritized Delivery
    Fetch
    Information Information
    Fetch
    Targeting Ranking
    Prioritized
    Contents
    Information
    Disaster information threshold
    Japanese earthquake scale >= 6

    View Slide

  162. Prioritized Delivery
    Fetch
    Information Information
    Fetch
    Targeting Ranking
    Prioritized
    Contents
    Information
    Disaster information threshold
    Japanese earthquake scale >= 6
    10/7 earthquake scale = 5+

    View Slide

  163. Scale-out Change Threshold
    Solution

    View Slide

  164. Scale-out Change Threshold
    Solution
    Servers
    25 → 50

    View Slide

  165. Scale-out Change Threshold
    Solution
    Japanese earthquake scale
    6 → 5
    Servers
    25 → 50

    View Slide

  166. Earthquake
    Result

    View Slide

  167. Earthquake
    FUKUSIHIMA M7.3
    2022/3/16 23:36
    https://www.jma.go.jp/jma/press/2203/17a/202203170130.html
    Result

    View Slide

  168. Result
    105k req/sec

    View Slide

  169. Result
    105k req/sec Response time 88ms(99.9%)

    View Slide

  170. Result
    105k req/sec Response time 88ms(99.9%) MGET 367µs

    View Slide

  171. Result
    105k req/sec Response time 88ms(99.9%) MGET 367µs

    View Slide

  172. Unexpected issue

    View Slide

  173. Unexpected issue
    - My house lost power

    View Slide

  174. Unexpected issue
    - My house lost power
    - Candles and tethering were used

    View Slide

  175. Lessons learned

    View Slide

  176. In the design
    - Define system requirements for the system in numerical terms

    View Slide

  177. In the design
    - Be prepared for errors in assumptions and unexpected behavior that can be
    easily controlled
    - Define system requirements for the system in numerical terms

    View Slide

  178. In the design
    - Be prepared for errors in assumptions and unexpected behavior that can be
    easily controlled
    - The growth of the service sometimes be a problem. And it usually comes
    just when you’ve forgotten about it.
    - Define system requirements for the system in numerical terms

    View Slide

  179. In the trouble
    - Logs and metrics are very important. If they are missing, add them as
    needed.

    View Slide

  180. In the trouble
    - We have to make hypotheses and test them one by one.
    - Logs and metrics are very important. If they are missing, add them as
    needed.

    View Slide

  181. In the trouble
    - We have to make hypotheses and test them one by one.
    - The evolution of technology bring us another difficulty. There is no silver
    bullet yet.
    - Logs and metrics are very important. If they are missing, add them as
    needed.

    View Slide

  182. View Slide

  183. I have not failed.

    View Slide

  184. I have not failed.
    I’ve just found 10,000 ways that won’t work.

    View Slide

  185. I have not failed.
    I’ve just found 10,000 ways that won’t work.
    - Thomas Edison

    View Slide