Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8000569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:50:21+00:00 2026-06-04T15:50:21+00:00

I want to stress test my service endpoint, making http POST requests. I want

  • 0

I want to stress test my service endpoint, making http POST requests.

I want the solution to be able to either:

  1. Make a certain number of requests, like 100K
  2. Keep running for x number of minutes

So far I created my solution using an executorservice like:

int MAX_THREADS = 20;
int MAX_REQUESTS = 1000;

ExecutorService es = Executors.newFixedThreadPool(MAX_THREADS);

for(int x = 0; x < MAX_REQUESTS; x++) {
  es.execute(new MyTask());
}

es.shutdown();

try {
  es.awaitTermination(..);
}
catch(...) {

}

Where MyTask implemented Runnable, and it makes the HttpPost using HttpClient (apache).

So this creates a set pool of threads, and then calls the task x number of times.

How can I modify this to also be able to run for a specified number of minutes?

For me to get start/end time statistics, I’m going to have to use futures so each thread and return back how long it took to run correct?

Also, in my runnable task, I am creating a new instance of the HttpClient object, and loading a file that I send with the post. I’m guessing this is going to slow down my benchmark, is there a way to re-use the httpclient with everything setup except for the actual call to make the request?

Before anyone mentions it, I know there are tools like jmeter etc. that does this already, but I want to both learn how this works and I will be doing some custom things later on that I want full control over.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:50:24+00:00Added an answer on June 4, 2026 at 3:50 pm

    Why make your own if you can use Apache JMeter? You can make a simple plugin to suit your applications needs and then have all the load generating possibilities of JMeter at your fingertips. Including running with intervals and such.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I make a stress test of the SQL Server 2008 and I want to
I want to stress test a web service method by calling it several thousand
I have an existing TestNG test case. I want to make a stress test
So I want to use funkload to stress test an API. I have a
I wrote a twitter like service, and I want to do some stress testing
So I have a test case that I want to make into a thread.
I want to conduct a stress and performance test on the front-end of my
I need to monitor several systems going thru stress testing. I want to make
How can we stress test a Sql Azure database? I want to find out
I want to stress-test my application this way, because it seems to be failing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.