aspose file tools
The moose likes JDBC and Relational Databases and the fly likes Control DB perfomance separately for two application threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Control DB perfomance separately for two application threads" Watch "Control DB perfomance separately for two application threads" New topic
Author

Control DB perfomance separately for two application threads

Lukas Benberg
Ranch Hand

Joined: Jan 03, 2007
Posts: 45
Hi,
I run a Web application that constantly imports data to my DB. This import thread brings lots of reads and writes to my DB. The same Web application sends user requests (user search queries from a website) to the DB.

Problem: user requests get slower due to reads and writes to the DB by the import thread.

I wonder if I could assign a certain limit of e.g. JDBC maxThreads for each of the processes to control the performance for both processes separately. For example, does it make sense to configure two JDBC resources (connecting to the same DB) with limited maxThreads set for the import process to keep DB performance for the user requests?

Thanks for any input on this!
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3739
    
  10

Have you considered a caching mechanism where database writes are delayed and centralized to a single thread?


[OCA 8 Book] [Blog]
Lukas Benberg
Ranch Hand

Joined: Jan 03, 2007
Posts: 45
Hi Scott,
this is probably sort of the thing I had in mind. I didn't work a lot with JDBC yet, so the question for me is *how* to I centralize part of my writes to one DB thread. Is it done by putting them on a single application thread (i.e. a Class that extends Thread)?
 
jQuery in Action, 2nd edition
 
subject: Control DB perfomance separately for two application threads