Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 532
    • Issues 532
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 101
    • Merge requests 101
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • BINDBIND
  • Issues
  • #3304

Closed
Open
Created Apr 26, 2022 by Michał Kępień@michalOwner

Consider dropping the JSON_C_TO_STRING_PRETTY flag used for generating JSON statistics

JSON is a machine-readable format, so there is no need to generate statschannel output in a "pretty" form. Quick experiments show that redundant whitespace adds up to about 40% of the JSON payload produced by statschannel code.

Yes, lib/isc/httpd.c supports DEFLATE compression via zlib and that enables massive savings in terms of payload size, but it requires clients to send the Accept-Encoding: deflate HTTP header in order to kick in, so IMHO HTTP-level compression and producing "minified" JSON data are tangential mechanisms rather than exclusive alternatives.

Piping "minified" JSON through jq allows one to get the "pretty" form without the extra bandwidth cost.

Some semi-random measurements:

  • v9.19, 4 logical CPU cores

    $ curl -s http://localhost:8080/json | wc -c
    71386
    $ curl -s http://localhost:8080/json | jq -c | wc -c
    41881
    $ curl -s -H "Accept-Encoding: deflate" http://localhost:8080/json | wc -c
    4150
  • v9.19, 32 logical CPU cores

    $ curl -s http://localhost:8080/json | wc -c
    391217
    $ curl -s http://localhost:8080/json | jq -c | wc -c
    227837
    $ curl -s -H "Accept-Encoding: deflate" http://localhost:8080/json | wc -c
    16721
  • v9.16, 4 logical CPU cores

    $ curl -s http://localhost:8080/json | wc -c
    896972
    $ curl -s http://localhost:8080/json | jq -c | wc -c
    529643
    $ curl -s -H "Accept-Encoding: deflate" http://localhost:8080/json | wc -c
    25880
  • v9.16, 32 logical CPU cores

    $ curl -s http://localhost:8080/json | wc -c
    6954362
    $ curl -s http://localhost:8080/json | jq -c | wc -c
    4106064
    $ curl -s -H "Accept-Encoding: deflate" http://localhost:8080/json | wc -c
    174557
Assignee
Assign to
Time tracking