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

Bulutta Yüksek Performanslı ve Verimli Sistem T...

Bulutta Yüksek Performanslı ve Verimli Sistem Tasarlama

Avatar for Serkan ÖZAL

Serkan ÖZAL

May 18, 2020
Tweet

Other Decks in Programming

Transcript

  1. WHO AM I? • Founder & CTO @ Thundra •

    Co-organizer of ◦ Cloud and Serverless Turkey • In serverless era since 4 years • PhD candidate @METU @serkan_ozal serkan-ozal
  2. AGENDA • Metrics • Caching • I/O • Event Driven

    (Async) Architecture • Replication • Recovery
  3. Metrics to Keep an Eye on [1] - Latency (avg,

    p50, p90, p99, max) - Errors (HTTP 4XX, 5XX) - CPU - Memory - IO
  4. Metrics to Keep an Eye on [2] - AWS Lambda

    (Errors, Throttles, Conc. Exec, Iterator age) - AWS SQS (# Msg Visible, Age Of Oldest Msg) - AWS Kinesis (R/W Provisioned Throughput Exceeded, Iterator age) - AWS DynamoDB (Throttled Reqs, Consumed RW Capacity Units) - Redis (# Connections, Hit/Miss ratio, # Evictions, CPU, Memory)
  5. How to Cache? - Local cache - Invalidation - TTL

    (Soft/Hard) & Expiration - Eviction - Versioning - Negative vs Positive Cache - Inline vs Side Caches - Thundering Herd & Request coalescing
  6. I/O

  7. How to I/O? - Async IO vs Non-Blocking IO (select/poll,

    epoll, kqueue) - Connection reuse / Keep-alive - TCP No-Delay - HTTP/2 vs HTTP/1 - Rest vs gRPC - CDN
  8. Redis - TCP-KeepAlive - Pipelining - MGET on cluster (custom

    hashing by {}) - Disable RDB Snapshot / AOF - Disable disk swap - Be aware of command complexity
  9. Elasticsearch - Evenly distributed sharding - Be careful when using

    custom id and routing - Reindex / Force merge - Increase refresh interval - Use Bulk requests - Use optimum data types (text vs keyword) - Disable disk swap - Monitor by “profiling” API
  10. How to be Event Driven? - Authenticate & validate (pre-process?)

    immediately - Process later - Resilient to upstream service failures - Loosely coupled systems - Batch processing - Fallback instead of retry
  11. How to Recover? - Periodic (hourly, daily etc ...) snapshots

    - Event logs - Replay events - Replicate