There are already many load testing tools in the world.
I'm thinking about how to make such a tool.
I would like to implement it on ruby or python (for now on ruby), so
First of all, I was thinking about a library called faraday
.
What I don't know this time is that depending on the value passed to the argument,
This is the logic for adjusting the number of requests.
For example,
·I want to throw 1000 requests per minute
·I want to send 800 requests per minute
When making minor adjustments such as
client=Faraday.new(:url=>"http://localhost:4567")
res=client.get(1000)#1000 times
That's what I want to do.
I am not sticking to Faraday, so I can replace the library that I can use in ruby if it meets this requirement.
What I was thinking about was
1) Record the number of requests per minute # Suppose 1500 requests per minute
2) Based on that time, divide it by the number you want to send this time. If you want to send it 1000 times, do you want to adjust it by 2/3?
With this method, it would be nice if 1500 times per minute is the same as the result of each time, but I thought it would not work if the width of the front and back was large.
Also, I was thinking about what I would do if I wanted to send 2,000 requests per minute, so I had a hard time.
Thank you for your cooperation.
What I want to do this time is
because it is a program that can test scenarios such as 1000 people per minute.
I want to implement the program on the premise that it is handled by multiple connections instead of a single connection.
Unfortunately, I would like to realize this implementation, so I have done multi-posting.
Please understand.
https://teratail.com/questions/41220?complete=
There was a lot of mention of response time, but
The reason I'm concerned about response time is because I thought about it on the premise of a single connection.
Therefore, if multiple connections are assumed, you don't have to worry about the response time.
I'm sorry that I didn't organize the connection.
Then, what I don't understand is how do I create a script to send requests to multiple connections?
1000.times.do
client=Faraday.new(:url=>"http://localhost:4567")
res=client.get()
end
I thought it would be like this, but I thought it would be a single connection...
ruby python test
If there are 1000 people, will it be 1000 within 1 minute?
Or is it 1000 at approximately equal intervals within 1 minute?
If it's the former, I think it would be good to create 1000 instances without thinking about it and send requests.
However, depending on the communication environment, the communication time and timeout may take a long time to finish within a minute.
If it is the latter, I think it will be easy to make if you repeat it with a timer.
It's like setting the timer repeat interval to 60sec/1000 people, and if it's 1500 people, it's 60sec/1500 people.
What do you think?
© 2024 OneMinuteCode. All rights reserved.