Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dx 963] Add do_not_track Analytics FAQ #4032

Merged
merged 65 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
e866178
add the new faq page for do_not_track to developer support faq section
Jan 24, 2024
e7e8453
add draft introduction paragraph summarising do_not_track
Jan 24, 2024
a0d740b
add link placeholders
Jan 24, 2024
6050c13
add do not track demo perf summary image
Jan 24, 2024
48d67e6
rename the faq image folder
Jan 24, 2024
84652f3
add dashboard apis measured image
Jan 24, 2024
4ed83eb
rename do_not_track perf image
Jan 24, 2024
146fd99
add image of APIs measured
Jan 24, 2024
dabfa0b
add %decrease
Jan 24, 2024
3348bf8
fix grammar and readability of result summary paragraph
Jan 24, 2024
f70337c
remove placeholder
Jan 26, 2024
25dd43a
remove heading
Jan 26, 2024
3992229
add info relating to load test
Jan 26, 2024
dd97df8
update dev support FAQ for do_not_track analytics
Jan 26, 2024
1de4b9a
update dev support FAQ for do_not_track analytics with example distri…
Jan 26, 2024
9c79314
update analytics traffic
Jan 26, 2024
ced327e
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Jan 29, 2024
0bdfae7
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Jan 29, 2024
964b823
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Jan 29, 2024
f4d23b7
update title and description for code review
Jan 29, 2024
160378e
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Jan 29, 2024
2d1568c
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Jan 29, 2024
cbe0967
refactor example systems paragraph for code review
Jan 29, 2024
fa3d0b6
Merge branch 'dx-963' of github.com:TykTechnologies/tyk-docs into dx-963
Jan 29, 2024
592d7b4
update example perf test for do_not_track, use correct parameter naming
Jan 29, 2024
d408f69
fix invalid link from code review
Jan 29, 2024
1894344
fix grammar for code review
Jan 29, 2024
c77e986
add introduction paragraph to highlight the problem that can arise fr…
Jan 29, 2024
ec97bd7
fix grammar
Jan 29, 2024
2c52100
add link sentence in introduction to do_not_track
Jan 29, 2024
34bde4c
reduce image size
Jan 29, 2024
cb16291
add additional tags
Jan 29, 2024
0721297
add CPU usage
Jan 29, 2024
fa3e858
add CPU load image, from DX-962
Jan 29, 2024
dcb5b18
remove incorrect image path
Jan 29, 2024
4532e0f
update content to include do not track CPU high load image
Jan 29, 2024
c1b52dd
update the introduction paragraph with linked content and example ana…
Jan 29, 2024
1ba82cc
update page title
Jan 31, 2024
8a8c82b
Update for code review
Apr 17, 2024
8a5a68d
Merge branch 'master' into dx-963
dcs3spp Apr 17, 2024
0b6df86
Update menu item casing
Apr 17, 2024
a8a5384
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
19f8136
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
c165f66
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
d9f5746
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
4e4fb71
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
0e7c88f
Update for code review to use persistent data store insead of backend…
Apr 17, 2024
4bd0c20
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
4f89b56
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
1053771
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
277ada9
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
16caa19
Update tyk-docs/content/developer-support/frequently-asked-questions/…
letzya Apr 17, 2024
5826cf6
Update tyk-docs/content/developer-support/frequently-asked-questions/…
dcs3spp Apr 17, 2024
0df64ce
Update track middleware link to remove surrounding quotes
Apr 17, 2024
0c76840
Merge branch 'dx-963' of github.com:TykTechnologies/tyk-docs into dx-963
Apr 17, 2024
4de5726
update dashboard apis image
Apr 17, 2024
1ba8a01
add zoomed images for performance results
Apr 18, 2024
0a18ab4
update content to display zoomed images
Apr 18, 2024
83595fe
remove redis_single.png - it should be in separate PR for analytics k…
Apr 18, 2024
4347cae
Merge branch 'master' into dx-963
dcs3spp Apr 18, 2024
b2bdf9b
restore do_not_track middleware for code review
Apr 18, 2024
b09d999
Merge branch 'dx-963' of github.com:TykTechnologies/tyk-docs into dx-963
Apr 18, 2024
4bfbbb6
Update tyk-docs/content/developer-support/frequently-asked-questions/…
letzya Apr 19, 2024
782f080
Update tyk-docs/content/developer-support/frequently-asked-questions/…
letzya Apr 19, 2024
b18f42d
Merge branch 'master' into dx-963
dcs3spp Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "What Is The Performance Impact Of Analytics?"
date: 2024-01-22
tags: ["do_not_track", "Analytics", "RPS", "Requests Per Second", "CPU", "high load", "high traffic"]
description: "This FAQ explains how analytics impacts system performance and how to disable using do_not_track"
---

This FAQ explains how analytics may impact performance relating to high CPU load and reduced Requests Per Second (RPS). Subsequently, it describes how to configure Tyk to reduce this performance impact for platforms that exhibit high volumes of traffic.

## What Are Analytics?
Tyk Gateway allows analytics to be recorded and stored in a persistent data store (MongoDB/SQL) for all APIs by default, via [Tyk Pump]({{< ref "tyk-stack/tyk-pump/tyk-analytics-record-fields" >}}).

Tyk Gateway generates transaction records for each API request and response, containing [analytics data]({{< ref "tyk-stack/tyk-pump/tyk-analytics-record-fields" >}}) relating to: the originating host (where the request is coming from), which Tyk API version was used, the HTTP method requested and request path etc.
dcs3spp marked this conversation as resolved.
Show resolved Hide resolved

The transaction records are transmitted to Redis and subsequently transferred to a persistent [data store]({{< ref "tyk-stack/tyk-pump/other-data-stores" >}}) of your choice via Tyk Pump. Furthermore, Tyk Pump can also be configured to [aggregate]({{< ref "tyk-dashboard-analytics#aggregated-analytics" >}}) the transaction records (using different data keys - API ID, access key, endpoint, response status code, location) and write to a persistent data store. Tyk Dashboard uses this data for:
- [Aggregated analytics]({{< ref "tyk-dashboard-analytics" >}}) - Displaying analytics based on the aggregated data.
- [Log Browser]({{< ref "tyk-stack/tyk-manager/analytics/log-browser" >}}) to display raw transaction records.

## How Do Analytics Impact Performance?

Analytics may introduce the problem of increased CPU load and a decrease in the number of requests per second (RPS).

In the *Tyk Dashboard API* screen below, there are two APIs, *track* and *notrack*. The APIs were created to conduct a simple load test, to show the gateway's RPS (requests per second) for each API:
letzya marked this conversation as resolved.
Show resolved Hide resolved

- **track**: Traffic to this API is tracked, i.e. transaction records are generated for each request/response.
- **notrack**: Traffic to this API is not tracked, i.e. transaction records are not generated for each request/response.

{{< img src="img/faq/do-not-track-usage-scenario/dashboard_apis_measured.png" alt="apis measured in Tyk Dashboard" width="864">}}

100,000 requests were sent to each API and the rate at which Tyk was able to handle those requests (number of requests per second) was measured. The results for the *tracked* API are displayed in the left pane terminal window; with the right pane showing the results for the *untracked* API.

### Tracked API Performance

{{< img src="img/faq/do-not-track-usage-scenario/track.png" alt="measuring tracked API performance impact" >}}

### Untracked API Performance

{{< img src="img/faq/do-not-track-usage-scenario/notrack.png" alt="measuring do_not_track API performance impact" >}}

### Explaining the results

We can see that **19,253.75** RPS was recorded for the *untracked* API; with **16,743.6011** RPS reported for the *tracked* API. The number of requests per second decreased by **~13%** when analytics was enabled.

## What Can Be Done To Address This Performance Impact?

Tyk is configurable, allowing fine grained control over which information should be recorded and which can be skipped, thus reducing CPU cycles, traffic and storage.

Users can selectively prevent the generation of analytics for
[do_not_track]({{<ref "product-stack/tyk-gateway/middleware/do-not-track-middleware">}}) middleware:
- **Per API**: Tyk Gateway will not create records for requests/responses for any endpoints of an API.
- **Per Endpoint**: Tyk Gateway will not create records for requests/responses for specific endpoints.

When set, this prevents Tyk Gateway from generating the transaction records. Without transaction records, Tyk Pump will not transfer analytics to the chosen persistent data store. It's worth noting that the [track middleware]({{< ref "product-stack/tyk-dashboard/advanced-configurations/analytics/activity-by-endpoint" >}}) exclusively influences the generation of *endpoint popularity* aggregated data by Tyk Pump.

## Conclusion

[Disabling]({{<ref "product-stack/tyk-gateway/middleware/do-not-track-middleware">}}) the creation of analytics (either per API or for specific endpoints) helps to reduce CPU cycles and network requests for systems that exhibit high load and traffic, e.g. social media platforms, streaming, financial services and trading platforms.

Application decisions need to be made concerning which endpoints are non critical and can thus have analytics disabled. Furthermore, benchmarking and testing will be required to evaluate the actual benefits for the application specific use case.

Subsequently, it is worthwhile monitoring traffic and system load and using this feature to improve performance.
4 changes: 4 additions & 0 deletions tyk-docs/data/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3917,6 +3917,10 @@ menu:
path: /frequently-asked-questions/how-to-backup-tyk-cloud-deployment
category: Page
show: True
- title: "What is the performance impact of analytics"
path: /developer-support/frequently-asked-questions/what_is_the_performance_impact_of_analytics
category: Page
show: True
- title: "Support SLA Policies"
path: /frequently-asked-questions/sla-policies
category: Page
Expand Down
Loading