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

CF AE queries often take > 10s #68

Open
benvinegar opened this issue Apr 14, 2024 · 0 comments
Open

CF AE queries often take > 10s #68

benvinegar opened this issue Apr 14, 2024 · 0 comments
Labels
bug Something isn't working perf

Comments

@benvinegar
Copy link
Owner

benvinegar commented Apr 14, 2024

I've been doing some experimentation logging calls to CF Analytics Engine, and observe that the same queries can sometimes take < 1s but also > 10s or even worse (I've observed ~25 seconds sometimes).

Here's an example of the same query SQL but performed on different columns (e.g. blob1, double2, etc) can yield wildly different query times:

query path true OK  took 794ms
query country true OK  took 903ms
done referrer true OK  took 3143ms
done deviceModel true OK  took 3325ms
done browserName true OK  took 12746ms # <-- 12.7 seconds

Example of one of these queries:

SELECT blob7,
       SUM(_sample_interval) AS count
FROM  metricsdataset
WHERE  timestamp > Now() - INTERVAL '7' day
       AND double1 = 1
       AND blob8 = 'counterscale-dev'
GROUP  BY blob7
ORDER  BY count DESC
LIMIT  10

I'd personally love to instrument this code with @getsentry and emit metrics/spans etc for individual queries, but the CF <> Sentry integration only captures errors via tail workers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working perf
Projects
None yet
Development

No branches or pull requests

1 participant