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

Fastly Meetup #2 LT

tjun
April 16, 2019

Fastly Meetup #2 LT

- Fastly monitoring at merpay
- Fastlyで404をキャッシュしてハマった話

tjun

April 16, 2019
Tweet

More Decks by tjun

Other Decks in Technology

Transcript

  1. @tjun
    merpay SRE team

    View Slide

  2. 日本最大のフリマアプリを提供する株式会社メ
    ルカリのグループ会社である株式会社メルペイ
    が運営するスマホ決済サービスです。
    使わなくなったものをメルカリで売って得た売上
    金や、銀行口座からチャージしたお金を、「メル
    カリ」やお店でのお支払いにご利用頂けます。
    現在は iD決済とコード決済に対応しています。

    View Slide

  3. 3
    Clients
    Merpay
    Gateway
    ServiceA
    ServiceB
    ServiceC
    GKE (Kubernetes)
    Fastly Ingress

    View Slide

  4. Fastly Integration (METRIC COLLECTION) in Datadog https://docs.datadoghq.com/integrations/fastly/
    Metrics example:
    - latency
    - cache hit rate
    - Request count
    - status

    View Slide

  5. Log streaming: Google BigQuery https://docs.fastly.com/guides/streaming-logs/log-streaming-google-bigquery
    We sometimes run queries with status_code, response_time, host, path, timestamp to detect
    errors, slow endpoints.
    Query example
    SELECT
    *
    FROM
    `project.fastly.default`
    WHERE
    host = "example.com"
    AND response_time >= 10000
    AND timestamp > "2019-03-30 02:00:00"
    LIMIT
    1000

    View Slide

  6. Next step: We want to try Fastly Integration (LOG COLLECTION) in Datadog
    https://docs.datadoghq.com/integrations/fastly/

    View Slide

  7. @tjun
    merpay SRE team
    で が
    キャッシュされてしまった話

    View Slide

  8. 8
    Clients
    Merpay
    Gateway
    ServiceA
    ServiceB
    ServiceC
    GKE (Kubernetes)
    Fastly Ingress

    View Slide

  9. 9
    Merpay
    Gateway
    GKE (Kubernetes) namespaceA
    nginx
    replica set
    pods
    nodejs
    Service nginx
    nodejs
    nginx
    nodejs

    View Slide

  10. 10
    Fastly
    nginx
    new
    replica set
    pods
    nodejs
    ...
    nginx
    nodejs
    nginx
    nodejs
    nginx
    pods
    nodejs
    nginx
    nodejs
    nginx
    nodejs
    old
    replica set
    Client

    View Slide

  11. 11
    Fastly
    nginx
    new
    replica set
    pods
    nodejs
    Service
    nginx
    nodejs
    nginx
    nodejs
    nginx
    pods
    nodejs
    nginx
    nodejs
    nginx
    nodejs
    old
    replica set
    Client

    View Slide

  12. ● Do not host images on node.js microservices
    ● Do not cache 404 on this endpoit

    View Slide

  13. まとめ
    404 responseもキャッシュされるので気をつけましょう!
    We hiring!!
    Fastly使ってサービス作りたいSREを募集しています

    View Slide

  14. 14

    View Slide