Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Architect , +
Hi,
I have an architecture question:
I wrote an enterprise 3-tier application, DDD approach, it runs in IIS and I have problems with this because:
 
1) Memory limit: my application work with huge images, and IIS is memory limited.
2) Long running task: somethime a task run for 30-40 minutes (doing tons of query processing loads of data ecc) this is an issue with IIS.
 
I like to divide the application "somehow" in 2 modules:
1) web UI that get user request and call the other module
2) server module that get the calls from web ui.
 
So, my questions: how can I do this? and: it is a good approach?
 
Mainly I have issues with the server module: It have to be a windows service? Some other kind os application?
Posted 3-Dec-12 23:20pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use web service/WCF service.
Use SQL query optimization techniques.
  Permalink  
Comments
Luca Dominici at 6-Dec-12 11:52am
   
ok for the WCF service, but I still miss some point... : WCF are hosted in iis or windows service or...? I have heard of appfabric.. But I really don't know where to start with those technology... Any help?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Start by instantiating a ServiceHost class in a windows service. Then, on the service interface, define a method that would kick off your long running process. You can use the leaders-followers pattern to service requests using multiple threads. Alternatively, use a One-way method on your service interface so that the requestors don't wait for the windows service to spin up a thread or whatever it would do. Using a One-way method you must then queue requests on your service.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I suppose, the basic scenario is like following:
1) user initiates a the process, gives parameters - let' call it job
2) your application is starting to do the job, and creates the desired output
3) user is happy with he output Smile | :)
I also suppose, that your server does not have unlimited resources, thus a heavy load would inrease even more processing time measured during single request.
 
Now, in this situation I suggest the following approach:
1) Separate your user interface in two: job initiation and "inbox" for handing over finished jobs
2) Create a job model and a queue based on that model. This can be a simple database table, but something more complicated something for a complex job. Don't forget to link the job to the initiator user.
3) Create a windows service that looks for jobs in the queue, does the job and stores the result attached to the job in the queue.
4) The finished job is added to the inbox of the user. You can use ajax calls to refresh inbox on client side and/or send out email to notify user.
5) You have to choose the level of parallelism implemented in the windows service based on the job in general, the concrete job parameters and the load on the server.
6) You can even inform the user about the status of his jobs, by updating some sort of status or progress information on the job itself and the UI.
 
You could create and call a separate application from asp.net, by spawning a process - and thus escaping the limitations you know. But this way you could not schedule the jobs and the overall resource limits would impact performance. WCF can handle async calls, but you still have to handle asynchronicity on client side, and I think a windows service is more appropriate for such scenarios.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Prakriti Goyal 302
2 Yogesh Kumar Tyagi 224
3 Maciej Los 185
4 Sergey Alexandrovich Kryukov 167
0 OriginalGriff 6,652
1 Sergey Alexandrovich Kryukov 5,449
2 Maciej Los 3,474
3 Peter Leow 3,303
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100