Quartz.NET on a web farm

548 views
Skip to first unread message

charudatta

unread,
Dec 4, 2009, 6:30:28 PM12/4/09
to Quartz.NET
Hi

I am a total newbie to quartz (or quartz.net). Here are my
requirements:

1) Need to send out emails to users in different timezones everyday
(based on their preference). I have several servers in a web farm.
2) I was considering a windows service or cron windows emulator
(pycron or nncron), but I am not so comfortable running services on my
servers due to access issues.

Then I was referred to Quartz.NET, which seems wonderful and kind of
fitting my needs perfectly. However, since my code will be in a web
farm, I dont know how do I make sure that my job is run only once.
Does running jobs with ADO.NET Job Store synchronizes them? or I need
to make sure they are synchronized by either using WCF messaging or
have my job lock a table and whoever locks the table does the job and
everyone else just exits.

Any ideas on synchronizing the jobs might be helpful.

Thanks.

Todd Nine

unread,
Dec 5, 2009, 5:14:01 AM12/5/09
to quar...@googlegroups.com, Quartz.NET
Hello,
I'll try to address your questions as best I can. First, we need to
deal with every possible time zone in our system. Given this issue, we
store everything in UTC and convert it on the fly when we display it
to the user based on their preferences. This may make your scheduling
easier if you can schedule everything in UTC or some other System wide
agreed time zone.

In regards to your cluster, will your nodes share a single db instance
or not? If they share one you should be able to use Istateful to
limit the job to only 1 execution across all nodes (at least that's my
understanding, double check the doc). If not, quartz technically
doesn't support this. We're building a geograhically dispurse system,
so we get around this limitation by heartbeat communication and
realtime data partioning. We also have all triggers ignoring failed
executions. This way all nodes that are online when the job is
scheduled to fire will run and only process their segment of data.

Todd Nine
Senior Software Engineer
Spidertracks Ltd
> --
>
> You received this message because you are subscribed to the Google
> Groups "Quartz.NET" group.
> To post to this group, send email to quar...@googlegroups.com.
> To unsubscribe from this group, send email to quartznet+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/quartznet?hl=en
> .
>
>

Brendan Richards

unread,
Dec 6, 2009, 7:09:46 PM12/6/09
to quar...@googlegroups.com
Hi,

You mentioned that you preferred not to run a windows service but I'd
still recommend a windows service running Quartz rather than just using
Quartz from within a web application.
Your problem with a web app will be that IIS will shutdown idle web
appplications so that your scheduler process will no longer be running.
If this happens on all nodes then no jobs get triggered.

A dodgy work-around for this could be to have some kind of "keep-alive"
client script that repeatedly hits your websites to keep them active but
I think running as a service is a much safer option.

Of course, when running Quartz as a service, the quartz scheduler itself
and the webapp where users input their preferences are completely
separate programs. Fortunately quartz has a number of options for
client-server communication - check out Example 12 (RemoteClientExample
and RemoteServerExample) in the quartz distribution to see how easy it
is to get a client process (your webapp) talking to a separate server
process (the quartz service).

Brendan Richards

charudatta

unread,
Dec 7, 2009, 11:12:06 AM12/7/09
to Quartz.NET
Hi Todd and Brendan

Thanks a lot for your replies. It was very helpful.
~CD
Reply all
Reply to author
Forward
0 new messages