简体   繁体   中英

Running task as windows service out of band of iis

We have a web app in which a request for a long running or high processor process is called.

We want to create a windows service to off-load this from the IIS servers. We will install this service on multiple machines to lower the wait time for these jobs. One idea we are looking at is serializing the Job object into Sql Server with its JobType as another column.

The job service will claim the job by updating the row with its indicator, this will keep other services from picking it up. Once the job is complete the service removes that entry.

What I am looking for is other, possibly better ideas to accomplish the Job Service Queuing.

I would say this is a great way to handle this issue. The only thing I would add is that while I don't know what the Job object is or how it is created, you might be able to offload this as well. Instead of creating the object and serializing it to the database, simply store the raw data in SQL. Let the Services handle building the Job object themselves from the ground up. That way you cut the serialization out of the mix. However, if this isn't possible, I would say that your solution seems to be the most viable.

If you do go this route, you could look into optimization of your Service offloading. For example, you could wake extra services when the load gets busy and then put some to sleep when the load lightens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM