0

Is jobs in quartz are executed as process or thread?

If it is executed as a thread then will it effect the performance of quartz scheduler when heavy jobs or time consuming jobs are executed.

If so then please suggest the solution.

If we execute 10 time consuming jobs simultaneously what is the effect?

I read the tutorials but didnt find the solution. Please suggest the solution.

Thanks.

Nikita
  • 33
  • 1
  • 6
  • possible duplicate of [How to scale the Quartz scheduler?](http://stackoverflow.com/questions/931662/how-to-scale-the-quartz-scheduler) –  Dec 02 '14 at 06:51

1 Answers1

0

Read the documentation regarding Configuring the thread pool which explains how the quartz thread pool can be suited for your needs. More specifically the org.quartz.threadPool.threadCount configuration property can be set according to your needs as the documentation explains:

The number of threads available for concurrent execution of jobs. You can specify any positive integer, although only numbers between 1 and 100 are practical. If you only have a few jobs that fire a few times a day, then one thread is plenty. If you have tens of thousands of jobs, with many firing every minute, then you want a thread count more like 50 or 100 (this highly depends on the nature of the work that your jobs perform, and your systems resources).

In the specific example you mentioned regarding 10 jobs firing simultaneously, if you have configured above property with more than 10 threads, then each job will run concurrently on its own thread. Otherwise if you have configured less, some will start first, and the others will wait for threads to become available. If no threads become available until a configured period of time, the misfire instructions you have set will handle the action to be taken, which usually is to trigger delayed jobs as soon as possible but this is also a configurable setting.

Marios
  • 1,947
  • 1
  • 15
  • 24
  • No. I am not sure why you would like to do this. Are you sure you are fully aware of the difference? Threads are lightweight, and processes need their own memory space and you would actually have multiple jvms running in order to have multiple java processes. Check https://docs.oracle.com/javase/tutorial/essential/concurrency/procthread.html and http://java67.blogspot.gr/2012/12/what-is-difference-between-thread-vs-process-java.html – Marios Dec 05 '14 at 10:23
  • Ya I know the differences between the thread and process. But my requirement is like If one thread is time consuming or hanged then my other jobs should not be affected. – Nikita Dec 09 '14 at 06:08
  • If suppose if my scheduler goes slow due to one of the threads, will it affect other jobs. – Nikita Dec 09 '14 at 06:10