Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet performance > august 2005 >

dotnet performance : windows service as scheduling engine multithreaded...performance ?


sahridhayan
8/10/2005 9:51:01 PM
we have certain products in c# web/winforms running in same machine..

all the applications has different tasks to be performed on a scheduled time..

so we have different scheduling service (windows service) running...

each one will look for its own database.. table records based on that it
will create a new thread and perform a set of tasks..

some of them might be concurrent..schedules as i said already..

after some hours of usage.. i could see my scheduler service process grows
to 100's MB.. some time stays there for long time ....

is it recommended to have more than one windows service with threads enabled..
interval scheduled tasks may vary from minute to hour, even day..

there is a huge potential possible of concurrent schedules for each
scheduler..

what is the best approach?

any directions would be much helpful

regards
sahridhayan
Henning Krause [MVP - Exchange]
8/12/2005 12:00:00 AM
Hello,

you should not blindly set any variables to null.. this only makes your code
harder to read.

Instead, when objects that implement IDisposable, call the Dispose() method
once you are done with the object. Or better, use the using {} statement.

If your apps are still using vast amount of memory, use a memory profiler
(http://www.microsoft.com/downloads/details.aspx?FamilyId=86CE6052-D7F4-4AEB-9B7A-94635BEEBDDA&displaylang=en
or better, this one http://www.scitech.se/memprofiler/) to track down the
causes...

Greetings,
Henning Krause
MVP - Exchange
http://www.infinitec.de


[quoted text, click to view]

Brendan Whelan
8/12/2005 3:57:04 AM
[quoted text, click to view]

Difficult to say without knowing what is happening within each thread,
but if memory is the issue then you need to ensure that each thread is
keeping resources and objects for the least possible amount of time.

In particular, investigate how the garbage collector works and how you can
help it out by nulling objects, etc. as soon as they are not needed.

sahridhayan
8/12/2005 5:37:41 AM
inside that thread we would call certain dataproviders.. includes.
sql, oracle, db2... and do some db operations and stream out some data
files...to local system folder.. that is all..all code cleaned up to the max..

can u pls tell me where to see gc working (releasing memory)


also is this recommend practice...?

one more query.. is it better to call a remoting (IIS hosted) inside a
windows service..


thank you for your directions

sahridhayan..



[quoted text, click to view]
Brendan Whelan
8/12/2005 8:01:10 AM
[quoted text, click to view]

The .NET CLR Performance counters will help you to track this.

Also, lots of good explanation of gc and how to optimise for it at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt05.asp
in the section on Garbage Collection.

B.
AddThis Social Bookmark Button