• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scheduled Thread running after 8 hours, Performance Impcat  RSS feed

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I build an web app using JSP, Struts1.3.8 , running on tomcat 6.0.14 , on windows 2003 server, 512 RAM, 1.6 GHz system

In my application I scheduled some thread using Quartz, which runs after each 8 hrs( 3 times in a day). Now Will this thread running doins some IO (hitting URl), and some DB operations, usally they are taking 30-45 seconds each to execute and they are excecuting in same JVM.

now suggest me, How can I dispatch this threads from may main tomcat server.
(Or If I posted it in wrong forum , Moderator, Pleas move it into suitable forum )
Thanks,
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you probably should have asked this in the Tomcat forum.

However, Quartz is quite usable inside Tomcat - in fact I used to work at a place where they had a master scheduler webapp that allowed people to use a web interface to schedule work to be done as threads within a webapp.

Since you probably want the scheduler to start immediately, create a dummy servlet with no doGet/doPost routines and set up Quartz in its init() method.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for the reply ,

precisely, I want to know the performance impact of this threads running in server. If a request for a page comes(static or dynamic) and at the same time my this Quartz Job Thread are executing in same JVM space, what will be my servers(tomcat) performance then?
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The overhead for Quartz itself is pretty light, although if you schedule thousands of discrete event types I'd expect them to add up. Most of the time, the Quartz dispatcher should be sleeping, so it's many just how much memory it needs.

The dispatched threads are your responsibility. Even without Quartz, a hungry thread is a hungry thread, so you'll have to design accordingly, including possibly tuning the thread priority.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for the explanation, Tim.
As I have only two threads running , I don't suppose that they are reason to panic, But If by God grace (and with effort from our Marketing team) traffic increases on my site, I have to run more thread than this, then I will come straight to you having some urgent Thread problems to be optimized and performance problems to be solved!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!