Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expgraphqlbench

Measure the speed of the GraphQL API against decision 18: cached GET, 304, cached POST, a cached answer through the kernel and an uncached query, N requests each, with median, p95 and max.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/commands/expgraphqlbench.md

On this page

exp:expgraphqlbench

Measure the speed of the GraphQL API against decision 18: cached GET, 304, cached POST, a cached answer through the kernel and an uncached query, N requests each, with median, p95 and max.

Script bin/php/expgraphqlbench.php, code in kernel/private/classes/commands/expgraphqlbench.php. Run it from the installation root, as the user the web server runs as:

./console exp:expgraphqlbench --help
./console exp:graphql:bench --help
php bin/php/expgraphqlbench.php --help

Help text

Measure the speed of the GraphQL API against decision 18
Sends the requests of each row one after the other to an end point, --requests times each
(after two that warm it up), --runs times, and prints the median, p95 and max of every row:

  get       a cached persisted query, GET ?id=          (answered before the kernel starts)
  304       the same with If-None-Match
  post      a cached persisted query, POST JSON {id}    (answered before the kernel starts)
  kernel    a cached persisted query as a form POST, which starts the kernel (what the first
            request of new credentials costs)
  uncached  the text of --query-file as an ad-hoc POST (never cached)

Every cached answer must come within 33 ms (the hard limit, on every request); the targets are
20 ms, then 13 ms, for the median and the p95. Uncached answers are measured, without a limit.
A time runs from the request being sent to the last byte of the answer (one connection for all,
so the TLS handshake is not in it). An OAuth token or a personal API key is read from the
environment variable

Options

OptionValueHelp
--urlrequiredthe end point, e.g. https://example.com/api/graphql
--idrequiredthe name or SHA-256 of the persisted query to measure
--variablesrequiredthe variables of the query, as JSON
--query-filerequireda .graphql file with the text of the query, for the uncached row
--requestsrequiredrequests per row and run (default 200)
--runsrequiredhow often every row runs (default 3)
--rowsrequiredthe rows to run, comma separated: get,304,post,kernel,uncached (default all)
--siteaccess-headerrequiredsend X-Siteaccess with this siteaccess
--insecuredo not check the TLS certificate (a test server of your own)
--formatrequiredtext (the default) or json

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/expgraphqlbench.php, kernel/private/classes/commands/expgraphqlbench.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x