Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thrad Pooling

 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My thread pool will hadle 1 Lakh concurrent requests, if if receive 2 Lakhs concurrent request at the particulat point of time, how can i handle?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had to ask somebody down the hall who said 1 lakh == .1 million

Thread pools (and other resource pools) often work with a queue. You put commands into the queue and some number of threads pull commands out of the queue and execute them. If you put commands in faster than the threads can handle them, the commands pile up in the queue and wait.

There are many things you can tune ... Set a max size on the queue, when it's full throw an exception or wait or send a busy reply. Set max & min numbers of threads, start new ones up to the max, stop idle ones down to the min. Set max wait time for queue items and throw exceptions if they're in there too long.

The JDK 5 BlockingQueue and Executors support a lot of options. What thread pool are you using?
[ February 24, 2005: Message edited by: Stan James ]
 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using any Appserver's /third party thread pool. It's my own.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, then it's entirely up to you what happens! Are you using a blocking queue design? It wouldn't hurt to read the JDK 5 and other open source pool docs for some ideas.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic