wood burning stoves 2.0*
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700
    
    5

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


My Blog: Down Home Country Coding with Scott Selikoff
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)?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Control DB perfomance separately for two application threads
 
Similar Threads
Controlling Tomcat Response time
adding bean as a JNDI to tomcat
JNDI in Servlets
Java multiprocess communication with each process running multiple threads
Use a singleton or a "purely static" class?