Skip to content

[performance] CRDB sharding influences Locust test results #1559

Description

@the-glu

Describe the bug

Even on the same hardware (see #1557 for issues across hardware), we noticed significant performance variance when running locust load tests without changing any parameters.

As an example, using a dedicated machine in aws (c8a.4xlarge), with the following parameters that ensure all CRDB instances have the same latency (one node per USS, so CRDB needs to cross INTER USS for each connection):

INTER_USS_NETEM_CONF=delay 25ms 7.5ms 50% distribution paretonormal loss 0.025% 25%'
INTRA_USS_NETEM_CONF='delay 600us 40us 25% distribution normal loss 0.0005%'
NUM_USS=3
NUM_NODES=1

Running locust with 3 locust instances running in parallel, one against each DSS and the following command:

docker run -e AUTH_SPEC="DummyOAuth(http://oauth.authority.localutm:8085/token,uss1)" --network="interop_ecosystem_network" -p 8089:8089 -v .:/app/ interuss/monitoring-dev uv run locust -f loadtest/locust_files/FlightsInSub.py -H http://dss1.uss1.localutm -u 10 --cluster-count 11 --base-lat 34 --base-lng -118 --area-radius 15182 --max-flight-distance 10000  --uss-base-url http://dss1.uss1.localutm

(with base lat of 34, 35, 36).

The 3 DSS show different q/s results:

Image

Restarting from scratch but restarting CRDB node 1 to make it not leader, and waiting for CRDB to stabilize before running tests:

Image

Now at the beginning, DSS 3 was faster, but quickly all DSS reach the same q/s with high errors.
(Both cases are reproducible)


If we switch to a different scenario with 3 USS and 3 nodes the issue is even worse, as shard repartition may be lucky. If CockroachDB needs to contact only local peers inside a USS, queries will be quick. If data is spread across 'external USS', queries will be slow.

INTER_USS_NETEM_CONF='delay 25ms 7.5ms 50% distribution paretonormal loss 0.025% 25%'
INTRA_USS_NETEM_CONF='delay 600us 40us 25% distribution normal loss 0.0005%'
NUM_USS=7
NUM_NODES=3

The test is run only on the first DSS.

Image

Re-creating the cluster from scratch and running it again:

Image

In both cases, in the first run data was locally present, in the second run it was not:

Image Image

Even when doing direct queries on CRDB, looking at index repartition and querying where data is local vs not local to the DSS:

Image

I also noticed when taking the last screenshot that data repartition also changes randomly. Initially, the numbers were inverted.

Expected behavior

We should define a way to have reproducible results, removing as many variables as possible. To do that, we should probably (and that may not be enough):

  • Not have possible variance due to data spread in CockroachDB on nodes with different latencies, and always use NUM_NODES=1
  • Always test and use the average query/s across all DSS to remove variance related to data locality relative to the DSS.

and/or

  • Look into solutions to guide CockroachDB (e.g. with locality) to be consistent with data spreading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions