Re: performance in a citrix environment

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Niall (asdf_at_me.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 15:06:48 +1000

The .Net memory profiler is a very useful tool for working out if you have
memory leaks.

Try an approach like this:

- Start your app from the profiler.
- Take a memory snapshot in the profiler
- Open a form in the app and do some work, then close the form
- Presumably, the form and everything it allocated should now be eligable
for garbage collection
- Take another snapshot in the profiler
- Choose View->Class Filter->Show Classes With New Or Removed Instances from
the menu

Now you can see what objects have been created between the first and second
snapshots and are still alive. If you can see your form or your data objects
in there, you have a memory leak, and then you can hunt it down.

Be aware of the effects of scaling the application. Clients think "The
average user has (maybe) a 2Ghz machine with 512MB of RAM." So they get
themselves a dual 3.2GHz machine with 4GB of RAM. Fine so far... Then they
think "Wow, we have this super computer, lets put 100 concurrent users of an
enterprise scale application on it." This is where they need a reality
check. They have 8 times the RAM of a normal computer and perhaps around 3-4
times the processing power. So if your app does any serious work at all,
50-100 users is just never going to fly.

With 100 users on a 4GB machine, you have a max of 40MB of memory per user
to play with. This is not much for a gui app. Also take into consideration
that if it is the type of Citrix site where the users have dumb terminals
and do everything off the server, the users then go and run Outlook/Lotus
Notes, and then go browse the web on the same machine. So your memory and
CPU slices are quickly shrinking.

Of course, convincing the client that the machine that they can't spend $10K
on a server and expect it to run heavy work for 100 users will be harder
than finding the memory leaks, so I'd start with the profiler :P

Niall

"Josh" <jcarlisle@nospam-removeme.viewfusion.com> wrote in message
news:OJEgvIlLEHA.2976@TK2MSFTNGP10.phx.gbl...
> We have a winform based application (Multiple tiers) that will be running
on
> a citrix server(s). I've been mostly involved with the business layer and
> server portions of the project but I recently got involved with the UI in
> the last few days as concerns have grown over it's performance. I haven't
> yet gotten deep into it but they're initial complaints are of excessive
CPU
> spikes of between 10-40% but I'm suspecting memory usage is also a
problem.
> On a normal system that's concerning but not the end of the world but when
> you want 50-100 users on a server it can be a problem.
>
> I plan to start profiling the application tomorrow to try to at least get
a
> handle on the situation. I plan to use the .NET Memory Profiler
(evaluation
> verson for now), the CLR profiler, and possible Red-Gate's .NET profiler.
In
> addition I'm going to be taking a look at the .NET perfmon counters
although
> I'm not quite sure yet which ones and to which thresholds to look at. Can
> anyone tell me if I'm on the right track for starting to debug this issue?
> Are there some better tools out there? Does anyone know of any tools that
> can relate particular sections of code to CPU spikes (seems like most are
> just time snapshots)? Anyone have any links/info on what perf counters I
> should be watching? Any advice would be greatly appreciated. Thanks.
>
> Josh
>
>



Relevant Pages