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

Add loadgen and loadgen-verify commands #343

Merged
merged 12 commits into from
Jan 16, 2023
Merged

Conversation

MarcoPolo
Copy link
Collaborator

Context

As part of load testing, I've maintained a set of tools out of repo for creating write load. Those tools lived at https://github.com/marcopolo/storetheindex-deployment. Now it's time to move the write load generator to this repo so that it stays alive and can verify consistency automatically via CI.

Note that the read load generator is a bit trickier since it involves coordinating lambdas to query an endpoint. The the other repo should be reproducible at any point in the future, and the things that may change are the easy bits of which url to hit for a find query, while the hard stuff (managing builds that get deployed to lambdas and having a nice interface to start a load test) should be stable.

Proposed Changes

Adds a loadgen and loadgen-verify command

These are commands that can be used to generate write load on a storage provider, and verify the Ads have been correctly ingested.

Useful for both stress testing an indexer as well as verifying consistency.

To run this locally for example you would (in the root of this repo):

  1. Start the indexer go run . daemon
  2. Start the load generator go run . loadgen --topic="indexer/ingest" (note you may need to change the topic depending on how your local indexer is configure. See ~/.storetheindex/config for your specific settings)
  3. Verify that all the load generated was correctly ingested go run . loadgen-verify

Tests

Adds a couple new test that serve as a both a check that the loadgen command works as well as a way to verify the consistency of the whole storetheindex system.

Revert Strategy

Change is safe to revert.

@MarcoPolo MarcoPolo marked this pull request as ready for review April 8, 2022 21:33
@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2022

Codecov Report

Base: 55.70% // Head: 54.21% // Decreases project coverage by -1.49% ⚠️

Coverage data is based on head (52b84af) compared to base (5f79fde).
Patch coverage: 7.06% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
- Coverage   55.70%   54.21%   -1.50%     
==========================================
  Files         144      148       +4     
  Lines       14304    14757     +453     
==========================================
+ Hits         7968     8000      +32     
- Misses       5470     5884     +414     
- Partials      866      873       +7     
Impacted Files Coverage Δ
command/loadgen.go 0.00% <0.00%> (ø)
command/loadgen/loadgen.go 0.00% <0.00%> (ø)
command/loadgen/pseudorand.go 0.00% <0.00%> (ø)
main.go 0.00% <0.00%> (ø)
server/ingest/http/handler.go 22.50% <0.00%> (-1.50%) ⬇️
command/loadgen/config.go 36.14% <36.14%> (ø)
server/ingest/http/server.go 76.92% <100.00%> (+1.24%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MarcoPolo
Copy link
Collaborator Author

TestEndToEndWithReferenceProvider is broken again. It works locally for me.

@willscott
Copy link
Member

I see:

 --- FAIL: TestLargeLoad (43.22s)
=== CONT  
    testing.go:1152: race detected during execution of test
FAIL
FAIL	github.com/filecoin-project/storetheindex/command	66.429s

should we not run that one with race detector?

@MarcoPolo MarcoPolo requested a review from gammazero May 16, 2022 19:36
@MarcoPolo
Copy link
Collaborator Author

@gammazero I tagged you for a review. Mind taking a look at this? I'll rebase this soon. Thanks!

Copy link
Collaborator

@gammazero gammazero left a comment

Choose a reason for hiding this comment

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

Need to update to not use go-legs.

}

// Set up a context that is canceled when the command is interrupted
ctx, cancel := context.WithCancel(context.Background())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like this would prevent the test from ending due to parent context timeout.

Suggested change
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(ctx)

command/loadgen/loadgen.go Outdated Show resolved Hide resolved
command/loadgen/loadgen.go Outdated Show resolved Hide resolved
command/loadgen_test.go Outdated Show resolved Hide resolved
command/loadgen_test.go Show resolved Hide resolved
e2e_test.go Outdated Show resolved Hide resolved
@MarcoPolo
Copy link
Collaborator Author

@gammazero can you please take this? You have the most context at this point.

Also if you want to run the load tests again, I would recommend against testground. I would suggest either the existing AWS setup or docker compose

@gammazero
Copy link
Collaborator

gammazero commented Jan 13, 2023

@MarcoPolo Yes, I got this. Thanks for the suggestion re. testground.

@MarcoPolo
Copy link
Collaborator Author

Some notes on testground: libp2p/test-plans#103

@gammazero gammazero merged commit 77fb07b into main Jan 16, 2023
@gammazero gammazero deleted the marco/loadgen-command branch January 16, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants