tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
807 stars 70 forks source link

support: users launching but requests are intermittent, not continuous #486

Closed ElijahLynn closed 2 years ago

ElijahLynn commented 2 years ago

Hi there,

I tried running Goose on example.com in the example folder with:

cargo run --example simple --release --features gaggle -- --host http://example.com and commented out the login and /about in simple.rs. Over the course of 41 seconds in maintaining phase I only have 33 requests. I left out the manager/worker stuff for simplicity for now. example.com isn't throttling because ab -n 1000 -c 20 https://example.com/ takes 9 seconds and hits 110 RPS.

I have read the docs at https://book.goose.rs/getting-started/running.html and https://book.goose.rs/getting-started/common.html and am not seeing what I am doing wrong to get each user to make continuous requests. The comment below suggests the transactions should run continuously per user.

Thanks

// These next two transactions run repeatedly as long as the load test is running.

async fn main() -> Result<(), GooseError> {
    GooseAttack::initialize()?
        // In this example, we only create a single scenario, named "WebsiteUser".
        .register_scenario(
            scenario!("WebsiteUser")
                // After each transactions runs, sleep randomly from 5 to 15 seconds.
                .set_wait_time(Duration::from_secs(5), Duration::from_secs(15))?
                // This transaction only runs one time when the user first starts.
                // .register_transaction(transaction!(website_login).set_on_start())
                // These next two transactions run repeatedly as long as the load test is running.
                .register_transaction(transaction!(website_index)),
                // .register_transaction(transaction!(website_about)),
        )
        .execute()
        .await?;

    Ok(())
}

image

ElijahLynn commented 2 years ago

Well thank goodness for rubber ducking! I see this now, which I glanced over initially:

// After each transactions runs, sleep randomly from 5 to 15 seconds.
                .set_wait_time(Duration::from_secs(1), Duration::from_secs(5))?

Lol. It was waiting between 5-15 seconds in that example, and then running continuously. I commented that out to test and all is working well! AND I finally see some CPU activity on my local now too! I'll move away from example.com now for my hello-world Goose Gaggle as it generated 10K requests in just 15seconds, at 1,251 RPS.

image

ElijahLynn commented 2 years ago

I think the Goose Book should have the ToC expanded by default. To get Goose running, I had seen the book a few times and just assumed there wasn't much docs yet and completely missed the hamburger ToC on the top left. I eventually got it working from looking at the blog posts and example code etc. And THEN I found the docs.

image

jeremyandrews commented 2 years ago

The menu automatically expands if you have a large enough screen. From the mdbook documentation:

The sidebar may not automatically appear if the window is too narrow, particularly on mobile displays. In that situation, the menu icon (three horizontal bars) at the top-left of the page can be pressed to open and close the sidebar.

ElijahLynn commented 2 years ago

Thanks, maybe some verbiage suggesting there is a ToC would be good on the main README.