[Mono-list] Heavy loaded web-site on Mono

Maxim Karavaev makska at yandex.ru
Mon May 21 10:52:29 EDT 2007


> > Hello!
> Hello,
> > Now I'm trying to launch big web-site consists of about 100.000 dynamic
> > web-pages (about 100kb each without images) which has about 50.000 hits per
> > day.
> > 
> > I've got some difficulties launching this web-site on FreeBSD with Mono 1.2.3:
> > 
> > 1. Uncontrolled grow of used memory. After about hour or two mono process
> > grows up to 2-3Gb and goes down (visitors get "Service temporary unavailable"
> > error). Web-application didn't contain any big object in memory, just 100-200
> > entries in Cache object with sliding expiration. Web-pages are simple too: 5
> > aspx pages with several user controls. Is the reason of this situation in
> > non-compactiong GC in Mono or in possible programmers errors?
> As Miguel advised in another post, could you run your application with
> heap-shot and post the results?
I've tried to get heap-shot, but didn't understand how to do it exactly.
I was trying to add "--profile=heap-shot" to file /usr/bin/mod-mono-server2, also I've tried to set variable $MONO_OPTIONS to --profile=heap-shot.
But results are the same: heap-shot-gui didn't "see" mod-mono process and command kill -PROF <pid> just killed the process without dumping memory to file.
What do I wrong?

Also I've found that huge grow of memory accurs only with 'trace enabled="true"' option in web.config. After turning it off and swicthing off session state web-application works well enougth for me.
But anyway it seems like size of mod-mono process never decreases. Also real size of mod-mono process is bigger than value reported by GC.GetTotalMemory();


> > 2. Behavior of Cache object. Value of Cache.Count variable is in about 2
> > times higher than number of Keys available via Cache.GetEnumerator(). Even
> > when I didn't add any object to Cache, Cache.Count indicates 20-30 entries
> > which are unavailable via enumerator.
> The difference is actually a small bug in the cache implementation. Our cache
> contains both public (set by the application) and private (used by, e.g., the
> ASP.NET compiler) entries. When you ask for Cache.Count, an internal count of
> the hashtable used by the cache to hold the data is returned - this count
> includes the private members. When, however, you request the enumerator, only
> the public members are returned (the enumerator to a dynamically allocated
> ArrayList is returned, not to the underlying hashtable). I will probably
> separate the private cache from the public one to get rid of that discrepancy.
Thanks for explanation, I'll know.


All the best,

Max Karavaev


More information about the Mono-list mailing list