This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to implement this  RSS feed

 
Walter Andresen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is one more problem that I've got. I am invoking a third party webservice that has a limitation: I can call it not more than 20 times per second in 10 threads max. How can I implement this?
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Walter Andresen wrote:here is one more problem that I've got. I am invoking a third party webservice that has a limitation: I can call it not more than 20 times per second in 10 threads max. How can I implement this?


I am assuming that you are following up on this topic?

http://www.coderanch.com/t/649857/threads/java/Data-conversion-multiple-threads

If so, then remember in that topic, I said ...

Henry Wong wrote:
I am not convinced that it will be that easy -- after all we are talking about from doing 2400 transactions in an hour to 100000 transactions in an hour. That's is an increase in load for 42 times!!

In my opinion, at best, there will be a latency change in the web service to more than 1.5 seconds per call (which may mean the load has to be increased again). And at worst, the web service will no longer report an answer (responding with an error, or not responding at all).



Anyway, there is a famous statement, that is a little sexist, but seems to apply here ... "nine women can't make a baby in one month". If you need to improve on this, you will need to find the bottleneck in the web service (and make changes in the service).

Henry
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

BTW, following up on the math ... 20 calls per second times 10 threads equals 200 calls per second. Doesn't that work out to 360,000 calls per hour, which meets your requirement of 100,000 calls per hour?

Henry
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!