Solved

creating 200 instances of httpclient

Posted on 2013-06-04
2
256 Views
Last Modified: 2013-06-27
Hi all,
My java application needs to read data from ~200 end-points hosted on different servers . Should I have an instance of httpClient for each end-point or use a application wide client.  Although the user guide suggests having one http client per application, I would like to have a  separate client for each URL to be able to fine tune for optimization. So here is my question: is is practical to create many (around 200) http clients? the creation will be done during startup so I am not worried about performance cost associated to instantiating the clients.
0
Comment
Question by:hamid441
2 Comments
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 250 total points
ID: 39219953
I don't think it would be a problem -- it depends on what you're doing, of course.

It's also very easy to try -- why don't you do that if you have specific concerns?
0
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 250 total points
ID: 39224819
In my opinion it will slow down the application. creating such huge number of HttpClients will create a lot ot respective pools intended to support connection managment. So switching between such huge number ot threads will slow down the JVM, because most of the time will be consumed by swithing between thread contexts.
Anyway, as "mrcoffee365" said, just try, it's easy!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now