This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Jakarta Commons Httpclient multi-threading problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Jakarta Commons Httpclient multi-threading problem" Watch "Jakarta Commons Httpclient multi-threading problem" New topic
Author

Jakarta Commons Httpclient multi-threading problem

William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

I have a client which is able to create multiple threads, each thread sends a POST. I am able to run up to 50 threads with out a problem with my current version of the client. I want to use Httpclient but this version of the client code give an error which says:

I don't generate this error and don't know where it is coming from, or what is generating it. The threads write their output to output files, each thread has its own output file. I get one of these errors for each thread I run over 10. So if I run 15 threads I get 4 of these messages. The only major differance between the two versions of the clients is the Httpclient code. The other strange thing is that all of the threads run successfully, and the output files contain the correct data.


Please ignore post, I have no idea what I am talking about.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

It appears I was not using the "multithreaded" connection manager. The default connection manager don't do multithreading good.
Jakarta Commons Httpclient MultithreadedHttpConnectionManager documentation
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Jakarta Commons Httpclient multi-threading problem
 
Similar Threads
Threading discrepancies
Design Questions
Readers, writers, and blocking
http client + thread save conn manager + execute get request time problems
Readers, writers, and blocking