Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

App slow executing jobs

 
Robert Siqueira
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

Thanks,

Regards,

Robert
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic