elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.16k forks source link

Scalability testing of the single apis #143066

Open dmlemeshko opened 1 year ago

dmlemeshko commented 1 year ago

Security

curl 'https://BASE_PATH/internal/security/login_state' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/security/me' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-system-request: true' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
  curl 'https://BASE_PATH/internal/security/session' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-system-request: true' \
  -H 'kbn-version: 8.4.1' \
  -H 'tracestate: es=s:0.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
  curl 'https://BASE_PATH/internal/security/security_checkup/state' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'tracestate: es=s:0.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/security/user_profile?dataPath=avatar' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'tracestate: es=s:0.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed

Core

curl 'https://BASE_PATH/api/core/capabilities?useDefaultCapabilities=true' \
  -H 'content-type: application/json' \
  -H 'kbn-version: 8.4.1' \
  -H 'origin: https://BASE_PATH' \
  -H 'user-agent: USER_AGENT' \
  --data-raw '{"applications":["error","status","security_access_agreement","security_capture_url","security_login","security_logout","security_logged_out","security_overwritten_session","security_account"]}' \
  --compressed
curl 'https://BASE_PATH/api/core/capabilities' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'origin: https://BASE_PATH' \
  -H 'user-agent: USER_AGENT' \
  --data-raw '{"applications":["error","status","kibana","dev_tools","r","short_url_redirect","home","management","space_selector","security_access_agreement","security_capture_url","security_login","security_logout","security_logged_out","security_overwritten_session","security_account","reportingRedirect","graph","discover","integrations","fleet","ingestManager","visualize","canvas","dashboards","lens","osquery","maps","ml","securitySolutionUI","siem","observability-overview","uptime","logs","metrics","infra","monitoring","enterpriseSearch","enterpriseSearchContent","elasticsearch","appSearch","workplaceSearch","apm","ux","kibanaOverview"]}' \
  --compressed

Licensing

curl 'https://BASE_PATH/api/licensing/info' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-system-request: true' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/licensing/feature_usage/register' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'origin: https://BASE_PATH' \
  -H 'user-agent: USER_AGENT' \
  --data-raw '[{"featureName":"URL drilldown","licenseType":"gold"},{"featureName":"geo_line aggregation","licenseType":"gold"},{"featureName":"geo_tile aggregation on geo_shape field-type","licenseType":"gold"},{"featureName":"layer from local Elastic Maps Server","licenseType":"enterprise"}]' \
  --compressed

Saved objects

  curl 'https://BASE_PATH/api/saved_objects_tagging/tags' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-system-request: true' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/api/saved_objects/_find?default_search_operator=AND&has_reference=%5B%5D&page=1&per_page=1000&search_fields=title%5E3&search_fields=description&type=dashboard' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/api/index_management/indices' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/saved_objects_tagging/tags/_find?page=1&perPage=10000' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed

Telemetry

curl 'https://BASE_PATH/api/saved_objects/_bulk_get' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'origin: https://BASE_PATH' \
  -H 'user-agent: USER_AGENT' \
  --data-raw '[{"id":"telemetry","type":"telemetry"}]' \
  --compressed
curl 'https://BASE_PATH/api/ui_counters/_report' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-system-request: true' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --data-raw '{"report":{"reportVersion":3,"application_usage":{"dashboards-main":{"minutesOnScreen":14.70805,"numberOfClicks":2,"appId":"dashboards","viewId":"main"},"home-main":{"minutesOnScreen":0.14415,"numberOfClicks":3,"appId":"home","viewId":"main"}},"uiCounter":{"ebt_counters.client-enqueued_enqueued-click":{"key":"ebt_counters.client-enqueued_enqueued-click","appName":"ebt_counters.client","eventName":"click","type":"enqueued_enqueued","total":5},"ebt_counters.client-enqueued_enqueued-Loaded Kibana":{"key":"ebt_counters.client-enqueued_enqueued-Loaded Kibana","appName":"ebt_counters.client","eventName":"Loaded Kibana","type":"enqueued_enqueued","total":1}},"userAgent":{"kibana-user_agent":{"key":"kibana-user_agent","appName":"kibana","type":"user_agent","userAgent":"USER_AGENT"}}}}' \
  --compressed
curl 'https://BASE_PATH/api/telemetry/v2/clusters/_stats' \
  -H 'content-type: application/json' \
  -H 'kbn-version: 8.4.1' \
  -H 'origin: https://BASE_PATH' \
  -H 'user-agent: USER_AGENT' \
  --compressed

Misc

  curl 'https://BASE_PATH/api/banners/info' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/spaces/_active_space' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
curl 'https://BASE_PATH/internal/data_views/has_data_views' \
  -H 'content-type: application/json' \
  -H 'cookie: COOKIE' \
  -H 'kbn-version: 8.4.1' \
  -H 'user-agent: USER_AGENT' \
  --compressed
elasticmachine commented 1 year ago

Pinging @elastic/kibana-qa (Team:QA)

rudolf commented 1 year ago

Here are some ideas. A concurrency test is basically a proxy for how long a certain route blocks the event loop or to ensure we don't hit an OOM condition. To prevent an impact on Kibana availability we should avoid regressions in:

These suggestions are based on https://overview.elastic-cloud.com/app/dashboards#/view/91b76e00-7750-11ed-bdfe-fd5199a89568?_g=() because the request path in the proxy logs include the space and any uuids if applicable, it means this analysis excludes a lot of APIs but it's a start. Would be better to analyse APM traces as that would generalise any parameters in the request path.

Potential event loop blockers

Some based on personal experience in SDHs others based on the biggest request / response size * number of requests. Many of these APIs depend on having the right "fixtures" in tests to be helpful.

High volume APIs