MySQL Forums
Forum List  »  Connector/JDBC and Java

Re: Java and mysql high concurrency bottlenecks solutions
Posted by: Filipe Silva
Date: June 29, 2017 05:08AM

Hi,

A thread pool is already a type of queue. Incoming new requests block until there is a free thread. The time each thread consumes is what you need to lower to the minimum. At some point it doesn't matter if you increase the number of threads in the thread pool or not, its just a matter of hitting one or another bottleneck.

I think it all comes down to how much work can be done in each worker thread and what can be deferred to later, and analyze if doing bulk operations in the database really pays off.

I'd say you should start with the obvious implementation and then grow from there as needed. Try different pools settings, different approaches and measure time. Mind that creating threads in Java is expensive, so, having in mind your problem, you really need a good thread pool. Using a good connection pool is also inescapable.

I hope that helps.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.