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 8729575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:51:27+00:00 2026-06-13T08:51:27+00:00

From netstat -anp | grep I at two different times, I can see HttpClient

  • 0

From netstat -anp | grep I at two different times, I can see HttpClient is not re-using my connections. I connect to the same host every time with different urls such as

  • https://myhost.com/postkey12345
  • https://myhost.com/postkey54321

Why is HttpClient not just re-using the same connection to myhost.com every time?

I have the following code for intialization of the Pool that I pass to HttpClient…

PoolingClientConnectionManager mgr = new PoolingClientConnectionManager();
mgr.setDefaultMaxPerRoute(30);
mgr.setMaxTotal(30);

I see they are using an HttpRoute and have localAddress in the equals which seems odd as HttpRoute should be equal on just hostname and schema(https/http) and that is it, right? Does that have something to do with it? Is this a bug? Performance is very crappy having to re-establish https sockets every time!!!!!

  • 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-13T08:51:28+00:00Added an answer on June 13, 2026 at 8:51 am

    I suspect rather strongly that SSL connections established by your applications are stateful. That is, the server requested the client to authenticate with a private certificate, making them security context specific. HttpClient detects that and prevents those connections from being leased to a caller with a different security context. Effectively HttpClient is playing safe by forcing a new connection for each request rather than risking leasing persistent SSL connection to the wrong user.

    You can do two things here

    • disable connection state tracking
    • make sure all logically related requests share the same context (recommended)

    For details see this section of the HttpClient tutorial

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

Sidebar

Related Questions

From time to time, I find myself using the same group of statements and
I'm using the following command to check how many connections I have from a
How can I access Ethernet statistics from C/C++ code like netstat -e ? Interface
From this context: import itertools lines = itertools.cycle(open('filename')) I'm wondering how I can implement
From the Scala API , I got the following example, which does not compile;
From 2.13.2/3 The double quote and the question mark ? , can be represented
On Ubuntu this command line: sudo netstat -tap | grep mysql if MySQL is
I'm using the code below, it seem sometime the socket is not released How
Using Java, I get this error when attempting to connect to a mysql database:
From a bash script how can I quickly find out whether a port 445

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.