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

  • Home
  • SEARCH
  • 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 6683111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:46:59+00:00 2026-05-26T04:46:59+00:00

This might seem like a strange problem, but I am trying to send as

  • 0

This might seem like a strange problem, but I am trying to send as many HTTP POST requests as possible within a several second interval.

I am wondering if anyone has any advice as I am currently only achieving around 6-9 requests a second which seems fairly low. My code is as follows – I am using the Apache Commons HTTP library:

  import org.apache.commons.httpclient.HttpClient;
  import org.apache.commons.httpclient.methods.GetMethod;
  import org.apache.commons.httpclient.methods.PostMethod; 


 long start = System.currentTimeMillis();
 long end = start + 4000; 
 int count = 0;
 while (System.currentTimeMillis() < end)
      {
        count++;
        httpClient.executeMethod(method);
       }
 System.out.println((double)count/4 + " reqs / sec");

The post method is created once beforehand:

 String body= getBodyString();
 PostMethod method = new PostMethod(Url);
 method.setRequestEntity( new StringRequestEntity(body));
 method.setRequestHeader(...etc)    

I am guessing that there is some sort of inherent sequential behavior whereby the httpclient is waiting for the response? In my case, I do not care about the response so presumably there is a way to improve the call rate. Perhaps I can be preparing the next request whilst one is being sent etc. Also could there be a more efficient and speedy library?

I’m new to this type of code so I apologize if this question doesn’t make much sense.

  • 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-05-26T04:46:59+00:00Added an answer on May 26, 2026 at 4:46 am

    Use the Threads, Luke!

    Your client is limited by the average response time of the server. If the server responds withing 100 milliseconds you will never exceed 10 requests per second.

    However if you send 10 requests at the same time and the server is capable of handling them simultaneously with the same response time, you’ve immediately reached 100 request/second.

    If you aim to stress-test your application, there are some nice free tools like JMeter or ab. If you are literally spamming someone else’s site: shame on you. And most likely their network infrastructure will cut you off soon.

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

Sidebar

Related Questions

This might seem like a basic question and back to Http protocol 101. But
This might seem like a strange question, but can I actually shut down the
This might seem like a n00b question, but I am trying to break some
This might seem like a stupid question I admit. But I'm in a small
This might seem like a weird question, but bear with me. I'd like to
Ok sorry this might seem like a dumb question but I cannot figure this
This might seem obvious but I've had this error when trying to use LINQ
This might seem like an odd request but I'd like to use jQuery's Selectable
This might seem like a really dumb question, but I am writing an application
This might seem like a trivial question, but I'm a bit muddled in my

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.