Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-28342

Overhead of JSON validation is quite noticeable especially for large documents

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • Morpheus
    • 3.1.6, 4.6.4, 5.5.0
    • couchbase-bucket
    • Intel CPU E5-2630 v4 (10 vCPU)
      CentOS 7.4.1708

    Description

      Build 5.5.0-1960.

      Environment:

      • 1 node
      • 1 ephemeral bucket
      • passive compression mode

      Here is my write-only workload (50K updates/sec):

      ./cbc-pillowfight --batch-size 100 --num-items 5000000 --num-threads 25 --min-size $size --max-size $size --set-pct 100 --num-cycles 40000 --no-population --compress --json --rate-limit 50000  --spec couchbase://172.23.133.13/bucket-1?password=password
      

      I iterate using different document sizes (from 256B to 8KB). In the meantime, I measure overall CPU utilization ("Solaris mode") and CPU overhead of two expensive calls:

      • JSON_checker::Validator::validate
      • snappy::RawUncompress

      Overhead of those functions is measured using Linux perf. I picked mc:worker_0 for profiling.

      Of course, my micro-benchmark doesn't represent typical production workloads. I am rather trying to examine a very specific code path. In regular tests the overhead is usually less than 10%.

      Reported results are still very concerning in my opinion. Passive compression mode made things a little bit worse since we need to inflate JSON documents before validation.

      Attachments

        1. perf_overhead.png
          96 kB
          Pavel Paulau
        2. cpu_utilization.png
          60 kB
          Pavel Paulau

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mohammad.zaeem Mohammad Zaeem
              pavelpaulau Pavel Paulau (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty