Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Performance & scalability of Couchbase Server – Couchbase Connect 2016

2,317 views

Published on

There are so many NoSQL choices right now. Couchbase Server not only scales-out, but gives you rich functionality and scaling options with Multi-Dimensional Scaling. Rich functionality in Couchbase provides key-value, query, and indexing to enable easier application development. YCSB is the de facto benchmark for NoSQL performance measurement. In this session, we’ll explain how we measured and tuned the system to win the benchmark. This session will also cover how to tune Couchbase Server for various YCSB workloads.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Performance & scalability of Couchbase Server – Couchbase Connect 2016

  1. 1. ©2016 Couchbase Inc. 1 The Couchbase Connect16 mobile app Take our in-app survey!
  2. 2. ©2016 Couchbase Inc. Performance & Scalability of Couchbase Server 2
  3. 3. ©2016 Couchbase Inc. 3 Raju Suravarjjala Senior Director, QE & Perf raju@couchbase.com IMAGE GOES HERE
  4. 4. ©2016 Couchbase Inc.©2016 Couchbase Inc. Agenda • What is Couchbase? • Why you will choose Couchbase? • Accessing Data from Couchbase • Performance within the Database & Application • Tuning N1QL • Performance testing at Couchbase • Measuring Couchbase Performance • Benchmarks • Demo
  5. 5. ©2016 Couchbase Inc.©2016 Couchbase Inc. What is Couchbase? Couchbase is a distributed operational database that enables you to develop with agility and operate at any scale. Managed Cache Key-Value Store Document Database Embedded Database Sync Management
  6. 6. ©2016 Couchbase Inc.©2016 Couchbase Inc. Operate at Any Scale Elastic Scalability Consistent High Performance Always-on Availability Multi-Data Center Deployment Simple, Powerful Administration Enterprise Grade Security
  7. 7. ©2016 Couchbase Inc. ©2015 Couchbase Inc. 7 Accessing Data From Couchbase Key access using Document ID • Operations are extremely fast with consistent low latency • Reads and writes are evenly distributed across Data Service nodes • Data is cached in built-in Managed Caching layer and stored in persistent storage layer Queries using N1QL • SQL-like : SELECT * FROM WHERE, LIKE, GROUP, etc., • JOINs • Powerful Extensions (nest, unnest) for JSON to support nested and hierarchical data structures. • Multiple access paths – Views and global secondary indexes • ODBC/JDBC drivers available Views using static queries • Pre-computed complex Map- Reduce queries • Incrementally updated to power analytics, reporting and dashboards • Strong for complex custom aggregations
  8. 8. ©2016 Couchbase Inc.©2016 Couchbase Inc. Performance within the Database • Architecture and Design: • Shared nothing workload distribution • RAM < - > RAM replication and data transfer (DCP) • Managed Caching Layer • Direct Client < - > Node communication • Efficient Resource Utilization: • Asynchronous and multi-threaded processing • Core data management written in C/C++ • Workload isolation between data storage, querying and indexing (MDS) • Append-only storage format
  9. 9. ©2016 Couchbase Inc.©2016 Couchbase Inc. Performance for the Application • Choose the right access pattern: • Key-Value • Primary key lookup, whole document or individual fields • Predictable sub-ms latencies for 100K+ reads/writes per second • Less flexible, application needs more code • N1QL (plus GSI) • Operational queries: Low-ms latencies, 10K ops/sec • Analytical queries:Variable performance • “Push-down” to data base layer • SQL-based language provides much more flexibility • Map-ReduceViews • API-based, incremental map-reduce • “Scatter-Gather” = Less scalable for reads, more scalable for writes
  10. 10. ©2016 Couchbase Inc.©2016 Couchbase Inc. Indexing with Couchbase Server:Views vs GSI Find theTop 10 Most Active Users for Month of Jan CREATE INDEX ON customer_bucket(customer_name, total_logins.jan_2015) WHERE type=“customer_profile”; SELECT customer_name, total_logins.jan_2015 FROM customer_bucket WHERE type=“customer_profile” ORDER BY total_logins.jan_2015 DESC LIMIT 10; Q1: Execution Plan on N nodes 1. Scatter: Scatter Q1 to N nodes 2. Gather: Gather N results from N nodes 3. Finalize: Re-Aggregate Q1 on 1 node Local Indexes (Views) Q1 Active @ Jan 2015 Cluster Manager Data Service Managed Cache Storage Cluster Manager Managed Cache Storage Cluster Manager Managed Cache Storage Cluster Manager Managed Cache Storage Cluster Manager Managed Cache Storage Index Service Query Service Data Service Index Service Query Service Data Service Index Service Query Service Data Service Index Service Query Service Data Service Index Service Query Service 1 2 3
  11. 11. ©2016 Couchbase Inc.©2016 Couchbase Inc. Indexing with Couchbase Server:Views vs GSI Find theTop 10 Most Active Users for Month of Jan CREATE INDEX ON Customer_bucket(customer_name, total_logins.jan_2015) WHERE type=“customer_profile”; SELECT customer_name, total_logins.jan_2015 FROM customer_bucket WHERE type=“customer_profile” ORDER BY total_logins.jan_2015 DESC LIMIT 10; Q1 Active @ Jan 2015 Q1: Execution Plan on N nodes 1. Execute Q1 on N1QL Service node 2. Scan index on Index Service node 3. Return results to application Global Indexes (GSI) Cluster Manager Index Service Managed Cache Storage Cluster Manager Index Service Managed Cache Storage Cluster Manager Query Service Managed Cache Storage Cluster Manager Data Service Managed Cache Storage Cluster Manager Data Service Managed Cache Storage 1 2 3
  12. 12. ©2016 Couchbase Inc.©2016 Couchbase Inc. Tuning N1QL – Indexing, Indexing, Indexing! • Global Secondary Indexes/Memory Optimized Indexes: • Index any JSON field (including nested and array structures) • Compound/Composite Indexes • Functional Indexes • Partial Indexes • Covering Indexes • Partition-able for scaling out • Per-query scan consistency options • EXPLAIN plan for analysis/optimization • Best Practices for performance: • Covering indexes • Avoid “intersect” scans • Smaller result sets
  13. 13. ©2016 Couchbase Inc.©2016 Couchbase Inc. CouchbaseTesting Suite - Summary • Couchbase Software goes through rigorous testing • 4,500 FunctionalTests via continuous integration model • Hours of functional testing – 12000 for major releases, 4500 for minor releases • Platform certification – 3000 functional tests • Scale tests on 30 node on a weekly basis, 130 node being run on a monthly basis • 30+ different System test setups including some customer workloads • Hours of performance testing - 5000+ hours for major, 2000+ hours for minor releases • 103 performance metric captured for Performance tests Couchbase Testing Suite Sanity & Unit Testing Functional Testing Regression Testing System Testing Scale Testing Performance Testing
  14. 14. ©2016 Couchbase Inc.©2016 Couchbase Inc. 14 ©2015 Couchbase Inc. 4 Daily Performance Sanity • Catch performance regressions early! • Run performance tests daily in parallel releases: 4.1 and 4.5 • Built on Couchbase 4.0: • New system to provision infrastructure elastically on-demand • New system to capture results and analyze historic trends.
  15. 15. ©2016 Couchbase Inc.©2016 Couchbase Inc. PerformanceTesting
  16. 16. ©2016 Couchbase Inc.©2016 Couchbase Inc. Measuring Couchbase Performance • Hundreds of metrics available from Couchbase Server: • Throughput: • Data Service: >100k reads/sec/node • Data Service: >10k writes/sec/node • Query Service: >10k queries/sec/node • Latency: • Data Service: 500µs-1ms for reads and writes in RAM • Data Service: 1ms replication between nodes • Query Service: 1-3ms for simple lookup queries • N1QL: • SELECT * FROM system:active_requests; • SELECT * FROM system:completed_requests; • Built-into client/SDK: • Throughput/Total Ops • Latency Histograms
  17. 17. ©2016 Couchbase Inc. ©2015 Couchbase Inc. 17 Benchmarks
  18. 18. ©2016 Couchbase Inc.©2016 Couchbase Inc. LatestYCSB Benchmarks Couchbase Key-Value Access 454,652 0 50000 100000 150000 200000 250000 300000 350000 400000 450000 500000 Ops/sec YCSB Workload A Throughput %50 Read + %50 Write Couchbase Server 4.5 Details: Standard Workload A as Defined by the Benchmark, 1 bucket 150M items with 1K size, Couchbase Server 4.5, 9 c3.8xlarge nodes
  19. 19. ©2016 Couchbase Inc.©2016 Couchbase Inc. LatestYCSB Benchmarks Couchbase N1QL Queries 30,911 0 5000 10000 15000 20000 25000 30000 35000 Ops/sec YCSB Workload E Throughput %95 Range Queries + %5 Writes 9 Nodes Couchbase Server 4.5 Details: Standard Workload E as Defined by the Benchmark, 1 bucket 150M items with 1K size, Indexing: Memory Optimized GSI, Couchbase Server 4.5, 9 c3.8xlarge nodes
  20. 20. ©2016 Couchbase Inc.©2016 Couchbase Inc. Couchbase on Google Cloud Engine  1M writes/sec to disk on Google Cloud Engine, median latency 15ms, 95th at 27ms  Couchbase server 3.1.5: 50 nodes, n1-standard-16 VMs, 500GB SSD per node  https://cloudplatform.googleblog.com/2015/05/Couchbase-Server-Hits-One-Million-Writes-Per-Second-with-Just-50- Nodes-of-Google-Compute-Engine.html
  21. 21. ©2016 Couchbase Inc.©2016 Couchbase Inc. Couchbase Performance Improvements • YCSB improvements: Hundreds of commits/improvements to Couchbase Java SDK • https://github.com/brianfrankcooper/YCSB/tree/master/couchbase2 • JAVA Object cleanup • Remove thread contention • Streaming improvements • Couchbase Server 4.5: • “Memory-Optimized” indexes: 20X throughput improvement from standard GSI • Array-element indexing: 2000X query latency improvement • “Flexible JOIN”: 7x query latency improvement • Sub-document API: 10X key-value latency improvement for large documents • Enterprise Backup-Restore: 2x faster • Key-Value throughput: 20% more throughput 0 1 2 3 4 5 6 7 8 Subdoc Fulldoc 95% Get Latency 95% Set Latency 0 50 100 150 200 250 300 350 400 450 EE CE Backup speed(MB/s) Restore speed( MB/s) 0 10000 20000 30000 40000 50000 60000 70000 80000 Array index 4.5 (MOI) Primary index 4.5 (MOI)
  22. 22. ©2016 Couchbase Inc.©2016 Couchbase Inc. Couchbase Performance Improvements • 3 nodes, 24 cores, 1 bucket, 1 replica, 20M * 256b docs • 100% resident, 80:20 read/write, same latency 4.1.1 4.5.0 Improvements Reads/s 235K 285K 21% Writes/s 58K 72K 24% CPU 75% 70% 7%
  23. 23. ©2016 Couchbase Inc.©2016 Couchbase Inc. N1QL Configuration • curl -u Administrator:password http://localhost:8093/admin/settings >z.json • Edit the z.json & increase servicers • Example: • {"completed-limit":4000,"completed-threshold":1000,"cpuprofile":"","debug":false,"keep-alive- length":16384,"loglevel":"INFO","max-parallelism":1,"memprofile":"","pipeline-batch":16,"pipeline- cap":512,"request-size-cap":67108864,"scan-cap":0,"servicers":32,"timeout":0} • CHANGE the relevant values. • E.g.,Your queries are getting large number of documents for each query. • Increase pipeline-batch to 1024 and pipeline-cap: 4096 • Do the following: • curl -u Administrator:password http://localhost:8093/admin/settings -XPOST -d@z.json
  24. 24. ©2016 Couchbase Inc. ©2015 Couchbase Inc. 24 Demo
  25. 25. ©2016 Couchbase Inc.©2016 Couchbase Inc. Summary • Performance tests are run on daily & weekly basis. • Major releases: Over 5000 hours of performance testing are usually spent on major releases. • Minor releases: About 2000 hours on minor releases. • Any regression in any of the metrics (103) will be reviewed and analyzed immediately. • All releases (from Major to Maintenance) will not be signed off if there is major regression. • YCSB workloadsA & E are run on 4 node cluster and analyzed and will not be signed off if there is a major regression
  26. 26. ©2016 Couchbase Inc. 26 Share your opinion on Couchbase 1. Go here: http://gtnr.it/2eRxYWn 2. Create a profile 3. Provide feedback (~15 minutes)
  27. 27. ©2016 Couchbase Inc. Thank you! 27

×