It's not a secret anymore!
The moose likes Performance and the fly likes App slow executing jobs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "App slow executing jobs" Watch "App slow executing jobs" New topic

App slow executing jobs

Robert Siqueira
Ranch Hand

Joined: Jan 21, 2008
Posts: 38
Hi !
I have an application which read a database and write files. Current I have at least 64.000 records in the table.

I decided to use a queue to process this records and write the file. The problem is that the process have been using just 50% of my CPU and this process is very slow. Sometimes I get a "Connection closed" from hibernate.

Basically, the process in MDB executes queries and do updates, and after, write the file.

What I should do to start a tunning in this process, in order to process faster ? increase MDB threads ?



Joe Ess

Joined: Oct 29, 2001
Posts: 9154

Robert Siqueira wrote: the process have been using just 50% of my CPU and this process is very slow.

What this usually means is that your process has one CPU (or core) locked up on a 2-CPU machine. Check whatever process monitor your OS has. It may be possible to create multiple threads for processing to spread the CPU load around. You'll have to figure out how to get them to collaborate writing a single file, of course.
You'll want to check and see if you have free memory too, as running out of memory will cause the OS to start swapping memory to disk which makes more work for the CPU.
Do you have the database on the same machine? That's a bad idea as your app and the database will be competing for the same resources.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: App slow executing jobs
It's not a secret anymore!