Hello fellow monks,
I am current implementing a system where a CGI requests can
initiated a long running operation. This operation involves sending or retrieving data from other systems using web services. It don't know exactly the amount of time the operation will take, but I expect that it can take anything from 1 - 30 minutes split over several smaller operations.
A simple way to implements this seems to be to put all the operations in a queue that is implemented as a database table. A separate task on the web server will be responsible for checking the queue and if there are any operations in the queue, it will perform the operation. If there are no more operations in the queue it will just wait.
So far so good. The problem is implementing the task on the web server that will check the queue. I could implement this as a client (CGI request) and server (task checking queue) or as a form of periodic script initiated by some service, but what is the common way to do this? If anyone has experience with this type of thing and know of any best practices I would like to hear them before I start.
Some requirements that must be taken into account to some degree:
-
Responsive. The user should not have to wait for a long time for the task to start. (more than one minute is probably to long.)
-
Easy to monitor. If should be easy to check whether the server task is running or not.
-
Easy to implement. I have limited time to implement this and it is for only one customer, so that the solution is easy to implement is more important than that it is flexible.
-
Robust w.r.t system restarts. If the system restarts the server task should be online at the same time as the web server becomes available.
BTW, the application will run on Windows and IIS, so Unix solutions will not help me much.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.