[Mono-aspnet-list] ASP.NET initial compile time on OS X

Francois Rouaix francois.rouaix at gmail.com
Fri Oct 1 22:52:35 EDT 2010


Ok, replying to myself here for the record.
The story seems to be that System.Web depends on System.Drawing, which in
turns requires Gdiplus initialization, which in turn requires some
initialization in fontconfig. The mod-mono-server2 process runs under _www
on Mac OS X. The initialization of fontconfig scans a bunch of cache files
in /usr/X11/var/cache/fontconfig which are root:wheel 644 (directory 755).
All of the "open" system calls on the cache files fail due to permissions
(still unclear to me based on the Instruments trace).

As a workaround, chmod all the cache files to 666 and the directory
/usr/X11/var/cache/fontconfig to 777.
On the first compilation run of an ASP.NET site, all fonts of the system
will be scanned (1+ minute) and the caches will be recreated (unfortunately
they now belong to _www:wheel with 600 permissions again, so who knows what
else is broken?).
Next compilations of ASP.NET sites will now be reasonably fast (in the order
of seconds instead of 1+ minute).

My debugging was on Mac OS X 10.6.4, Mono 2.6.7.
Would still appreciate a better explanation/workaround if available, notably
because I'm not happy with system wide caches belonging to _www with a 600
mask...

HTH,
--f


On Thu, Sep 30, 2010 at 6:43 AM, Francois Rouaix
<francois.rouaix at gmail.com>wrote:

> Hello folks,
> I'm debugging an ASP.NET app on my Mac with mod_mono and was surprised
> with a very high (2 minutes) initial compile time for the first page
> displayed. This is a fairly simple app, which very little logic in ASP.NET pages
> themselves (most of the code is in DLL).
> I ran Instruments on the Mono process running mod-mono-server2 and
> discovered that the top consumers of CPU are TT_Load_Simple_Glyph from
> libfreetype (12 seconds) and inflate_fast in the kernel (8 seconds)  - which
> I presume has to do with font file decompression of font files.
> I'm running 2.6.7.
> Any clue of why I should be spending 20 seconds in reading font files for a
> web app? (the total cost is most likely much high due to IO on all the
> fonts).
> --f
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20101001/fe9eafaa/attachment.html 


More information about the Mono-aspnet-list mailing list