"Out of Band" Processing Techiniques for asp.net applications
Asked Answered
R

9

12

Jeff has previously blogged about using the cache to perform "out of band" processing on his websites, however I was wondering what other techniques people are using to process these sorts of tasks?

Rosemari answered 3/9, 2008 at 23:25 Comment(0)
S
7

Years ago, I saw Rob Howard describe a way to use an HttpModule to process tasks in the background. It doesn't seem as slick as using the Cache, but it might be better for certain circumstances.

This blog post has the details, and there are many others that capture the same information if you look around.

Slovenia answered 3/9, 2008 at 23:32 Comment(0)
K
4

Windows Service

Kurtz answered 3/9, 2008 at 23:27 Comment(0)
H
3

You may want to look at how DotNetNuke does it. I know it is written in VB.NET, but I retrofitted the code into C#. I was perusing the source and noticed they had a feature in their admin area to setup scheduled tasks. These tasks get setup thru the admin interface and stored in the database. When the site starts, thru the Global.asax file, they either created another thread to run this service that then runs the scheduled tasks at their scheduled time. I can't remember the exact logic, it's been a while, but it is definitely a good resource on how other people have done out of band processes for Asp.Net applications. This technique still keeps the logic within the Asp.Net application, but it runs out of band in my opinion.

Hufnagel answered 4/9, 2008 at 0:43 Comment(0)
P
1

if it's primarily data processing tasks and you're using MSSQL, how about scheduled SSIS tasks?

Penitent answered 3/9, 2008 at 23:37 Comment(0)
D
0

Scheduled tasks, or cron jobs.

Donald answered 3/9, 2008 at 23:32 Comment(0)
U
0

The problem with scheduled tasks or cron jobs is that they don't share memory space with the web server. You could set up a scheduled task that requested pages from the web server, but that might create problems with long running tasks. It would be nice to have some low priority threads running on the actual ASP.Net application stack to do simple utility tasks like cleaning up caches, monitoring resources, and just to deal with general housekeeping.

Unmoved answered 3/9, 2008 at 23:38 Comment(0)
U
0

Simple queue files along with a separate agent. For each type of out of band process write a separate agent .exe which watches a directory for queue files that include whatever data is needed to perform the specified process.

This may seem dirty but in the real world I find it gives a lot of flexibility, you aren't doing a lot of processing in ASP.net process space and you could easily adapt this style to farm processing out to cheap Linux servers running the agent process on Mono for when you start needing more RAM/CPU/disk.

Ulloa answered 4/9, 2008 at 1:0 Comment(0)
C
0

If you are most comfortable with asp.net pages you can write a small app to handle your job and then "ping" the app with an outside service that monitors your web site. This will keep the app alive.

Campo answered 6/9, 2008 at 15:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.