Skip to content

nix(loadtest): avoid hitting the database when possible - #5055

Draft
wolfgangwalther wants to merge 3 commits into
PostgREST:mainfrom
wolfgangwalther:loadtest-no-db
Draft

nix(loadtest): avoid hitting the database when possible#5055
wolfgangwalther wants to merge 3 commits into
PostgREST:mainfrom
wolfgangwalther:loadtest-no-db

Conversation

@wolfgangwalther

Copy link
Copy Markdown
Member

Since the mixed loadtests are dominated by the OpenAPI, #5054 needs to support that as well first. Once it does, the loadtests will be much more balanced between the requests.

It should be a good change, but I'm not sure whether this will have the desired stabilization effect in GHA.

This allows returning the request's SQL query by setting the `Accept:
application/vnd.pgrst.sql` header on the client-side. I opted to use a
mimetype in our vendor namespace, because this needs to support a `for=`
parameter from the beginning - queries differ depending on which
mimetype would *normally* be requested.

I mostly copied my way along the implementation of the
`application/vnd.pgrst.plan` header and made adjustments where
necessary.

Resolves PostgREST#3580
Comment thread test/load/targets.http
Comment on lines 12 to 15
POST http://postgrest/films?columns=id,title,year,runtime,genres,director,actors,plot,posterUrl
Prefer: tx=rollback
Accept: application/vnd.pgrst.sql
# this bulk.json was obtained from https://github.com/erik-sytnyk/movies-list/blob/master/db.json
@bulk.json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This request probably doesn't make much sense anymore when queries are not actually run.

@mkleczek

Copy link
Copy Markdown
Collaborator

Since the mixed loadtests are dominated by the OpenAPI, #5054 needs to support that as well first. Once it does, the loadtests will be much more balanced between the requests.

It should be a good change, but I'm not sure whether this will have the desired stabilization effect in GHA.

I am more and more convinced GHA flakiness drives us towards spending a lot of effort on testing the wrong thing - we are starting to chase performance differences in a place that has minuscule effect on the actual performance of PostgREST deployments, which is dominated by database queries.

In other words: 20% difference in latency reported from load tests is going to have 0.2% or less effect on the actual performance.
The problem becomes that, because numbers are inflated and catch the eye, we start wasting effort on addressing them (and potentially dismiss changes that only seem like performance regressions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants