Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OCHaCafe Premium #2 クラウド・アプリケーションのパフォーマンス

OCHaCafe Premium #2 クラウド・アプリケーションのパフォーマンス

2020年4月3日実施 Oracle Cloud Hangout Cafe(おちゃかふぇ) の番外編 "OCHaCafe Premium" のセッション資料です。

https://ochacafe.connpass.com/event/169582/

oracle4engineer

April 03, 2020
Tweet

More Decks by oracle4engineer

Other Decks in Technology

Transcript

  1. 2 The following is intended to outline our general product

    direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Safe harbor statement Copyright © 2020, Oracle and/or its affiliates. All rights reserved
  2. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    3 2 1 マイクロサービス・アーキテクチャを適用したアプリケーションの性能 マイクロサービス・アーキテクチャとその性能に関わる考慮点 性能についてのおさらい 4
  3. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • • “ ” • - • “ ” • • ※ Wikipedia https://ja.wikipedia.org/wiki/%E3%83%91%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%B3%E3%82%B9 https://ja.wikipedia.org/wiki/%E6%80%A7%E8%83%BD 6
  4. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    2 TAT(Turn Around Time) • • • (Response Time) • • • 7
  5. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    (Throughput) • • TPS (Transaction Per Second) • (Bottleneck) • • • 8
  6. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • • • • • DB IoT Pub/Sub etc. 100tps 100tps 100tps 100tps 100tps 200tps 9
  7. / • • • • CI/CD ( ) 環境の分離による システム全断の防止

    自動化された ビルド/テスト/リリース リリース プロセスの反復 Copyright © 2020, Oracle and/or its affiliates. All rights reserved 11
  8. • • • • • • Copyright © 2020, Oracle

    and/or its affiliates. All rights reserved API 12
  9. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    API Microservices A B { … } { … } { … } { … } C B Ajax GET Ajax Ajax Ajax { … } { … } { … } API Gateway Service A Service B Service C Front Service 13
  10. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • • • • • CPU/ • / Error! Error! ( ) 14
  11. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • • • / • • API • / NoSQL RDB RDB NoSQL REST API 15
  12. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    EC • Mall - - • Cart - / - - • Order - - - Mall • search_products • get_product Order • list_orders • checkout • update_products Cart • add_product • get_cart • checkout list_order add_product/chekout search/get_product checkout 18
  13. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • - - ( / ) - 1 • - - (※ ) - REST API - 19
  14. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    Mall • search_products • get_product Order • list_orders • checkout • update_products Cart • add_product • get_cart • checkout Pod: monolith-eshop PRODUCT INVENTORY ORDER ORDER_ITEM CART CART_ITEM 20
  15. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    / / Order REST Mall • search_products • get_product Pod: api-eshop-mall Cart • add_product • get_cart • checkout Pod: api-eshop-cart Order • list_orders • checkout • update_products • search_products • get_product Pod: api-eshop-order PRODUCT INVENTORY ORDER ORDER_ITEM CART CART_ITEM • / Order • / Order • Cart • Mall Cart 21
  16. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    Pod Load Gen DB api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order jaeger monolith-eshop Mall Cart Order 22
  17. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    / Pod Load Gen DB api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order jaeger monolith-eshop Mall Cart Order OKE Database System Virtual Machine 23
  18. Oracle Java OSS • GitHub https://github.com/oracle/helidon • Java Java 2

    • Helison MP Eclipse MicroProfile • Helison SE Cross Cutting Concern • • Redis (Helidon MP ) Project Helidon Copyright © 2020, Oracle and/or its affiliates. All rights reserved 24
  19. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    Java Eclipse MicroProfile • • Java EE • Eclipse MicroProfile - Kubernetes - Health Check/Circuit Breaker/Fault Tolerance - OpenTracing/OpenMetrics, etc. • Java EE 8 - JAX-RS/JSON-B/JSON-P/CDI/Commons Annotations OpenMetrics OpenTracing Health Check Circuit Breaker Fault Tolerance 25
  20. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    Oracle Container Engine for Kubernetes (OKE) Kubernetes 1Tb/s, <500μs Availability Domain 3 Worker Node 25Gb/s, <100μs Availability Domain 2 Worker Node 25Gb/s, <100μs Availability Domain 1 Master Node Worker Node 25Gb/s, <100μs Master Node Master Node 26
  21. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    Pod CPU Load Gen DB api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order jaeger monolith-eshop Mall Cart Order Pod OCPU (=1 core ) 2.00 2.00 0.25 ※metric-server require/limit = 500m CPU = 0.25 OCPU 0.25 0.25 0.25 1 REST Mall x 24, x 20 Cart x 8, x 3, x 1 Order x 1 27
  22. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • - 0.25 OCPU - Pod 0.25 OCPU • - 0.25 OCPU A (Mall) + B (Cart) + C (Order) • Order - 0.25 OCPU A (Mall) + B’ (※) + C (Order) - ※Cart ( ) Load Gen api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order monolith-eshop Mall Cart Order 2.00 0.25 0.25 0.25 0.25 A B C A + B + C B’ A A + B + C A + B + C 29
  23. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    ) (tps) (ms) 100 VU ( ) 113.1 737 43.0 1,933 45 tps ( ) 45.8 14 43.3 1,065 40 tps 40.6 101 43tps 2 5 tps 1 31
  24. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    45tps #3 HTTP GET JAX-RS ( Rest Clinet Order REST ) Order ( ) 34
  25. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    9 45tps #4 (2.02s) (2.11s) Order JPA (5.55ms) Order (8.94ms) 35
  26. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    40tps ( ) (0.00ms) (107.2ms) Order JPA (5.16ms) Order (7.08ms) 36
  27. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    1. 2. ( ) 3. Mall Order Order (7.08 8.94ms ) Mall 37
  28. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    • - - ( / ) - 1 • - - (※ ) - API - • Event Sourcing/CQRS - - / Redis - (Kafka ) Produce/Consumer 38
  29. async-eshop-order Order async-relay-order relay Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved async-eshop-mall Mall PRODUCT INVENTORY ORDER ORDER_ITEM redis-mall PRODUCT INVENTORY kProductStream kOrderStream async-relay-mall relay async-eshop-cart Cart async-relay-cart relay redis-cart PRODUCT INVENTORY CART CART_ITEM 39
  30. async-eshop-order Order async-relay-order relay Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved Order async-eshop-mall Mall PRODUCT INVENTORY ORDER ORDER_ITEM redis-mall PRODUCT INVENTORY kProductStream kOrderStream async-relay-mall relay • Redis async-eshop-cart Cart async-relay-cart relay redis-cart PRODUCT INVENTORY CART CART_ITEM • Redis Order 40
  31. async-eshop-order Order async-relay-order relay Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved async-eshop-mall Mall PRODUCT INVENTORY ORDER ORDER_ITEM redis-mall PRODUCT INVENTORY kProductStream kOrderStream • Kafka • Kafka async-relay-mall relay • Order async-eshop-cart Cart async-relay-cart relay redis-cart PRODUCT INVENTORY CART CART_ITEM • Cart • Mall • • 41
  32. Event Sourcing : #1 • • • • • •

    • INVENTORY Shopping API Decrease Inventory Event Store Order #123 Created Approve d Ready Shipped Subscribe Shipped Copyright © 2020, Oracle and/or its affiliates. All rights reserved 42
  33. CQRS : Event Sourcing #2 CQRS (Command Query Responsibility Segregation)

    Event Sourcing • • API • • Event Sourcing • HISTORY Shopping API Add History Event Store Order #123 Created Approve d Ready Shipped Subscribe Shipped Search History History API Publish Copyright © 2020, Oracle and/or its affiliates. All rights reserved 43
  34. async-eshop-order Order async-relay-order relay Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved Microservices async-eshop-mall Mall PRODUCT INVENTORY ORDER ORDER_ITEM redis-mall PRODUCT INVENTORY kProductStream kOrderStream async-relay-mall relay async-eshop-cart Cart async-relay-cart relay redis-cart PRODUCT INVENTORY CART CART_ITEM Event Sourcing CQRS 44
  35. Load Gen Event Store Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved jaeger DB monolith-eshop Mall Cart Order api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order async-eshop-mall Mall async-eshop-cart Cart async-eshop-order Order async-relay-mall Relay async-relay-cart Relay async-relay-order Relay kProductStream kOrderStream redis-mall redis-cart Pod 45
  36. Load Gen Event Store Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved / OKE Virtual Machine DB Database System api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order async-eshop-mall Mall async-eshop-cart Cart async-eshop-order Order async-relay-mall Relay async-relay-cart Relay async-relay-order Relay kProductStream kOrderStream redis-mall redis-cart Streaming jaeger Pod monolith-eshop Mall Cart Order 46
  37. 47 Oracle Cloud Infrastructure - Streaming API Gateway Oracle Functions

    Events IoT Mobile/Web Activities Object Storage Database System App Kafka Client (Producer/Consumer) Streaming • • IoT SNS • • Apache Kafka Streaming • Kafka Broker Kafka API • Kafka Connect Copyright © 2020, Oracle and/or its affiliates. All rights reserved
  38. 1 OCPU x 4 node Load Gen Event Store Copyright

    © 2020, Oracle and/or its affiliates. All rights reserved Mall Cart Order Pod CPU jaeger DB api-eshop-mall Mall api-eshop-cart Cart api-eshop-order Order async-eshop-mall Mall async-eshop-cart Cart async-eshop-order Order async-relay-mall Relay async-relay-cart Relay async-relay-order Relay kProductStream kOrderStream redis-mall redis-cart 0.25 0.25 0.25 0.25 0.25 0.25 2.00 2.00 • Write: 1MB/s • Read: 2MB/s monolith-eshop Mall Cart Order 0.25 ※metric-server require/limit = 500m CPU = 0.25 OCPU 48
  39. Copyright © 2020, Oracle and/or its affiliates. All rights reserved

    / ) (tps) (ms) 100 VU ( ) 113.1 737 43.0 1,933 149.8 556 45 tps ( ) 45.8 14 43.3 1,065 45.8 12 40 tps 40.6 101 3 50
  40. async-eshop-order Order async-relay-order relay Copyright © 2020, Oracle and/or its

    affiliates. All rights reserved async-eshop-mall Mall PRODUCT INVENTORY ORDER ORDER_ITEM redis-mall PRODUCT INVENTORY kProductStream kOrderStream async-relay-mall relay async-eshop-cart Cart async-relay-cart relay redis-cart PRODUCT INVENTORY CART CART_ITEM • Cart • • ( ) 51