number of layers in mapfile

Fawcett, David David.Fawcett at STATE.MN.US
Mon Aug 27 10:19:27 EDT 2007


I think that the summary is that conclusion is that a map file with 500
layers is going to be significantly more expensive than a map file with
five layers.  Even with all of the possible optimization tricks.  

If you really need to have a map file with 500 layers (e.g. you need all
500 layers to draw one map), you will likely have to deal with slower
performance.  

The bigger question to me is, do you really need 500 layers?!  I can't
imagine a lot of applications that would.  

There are people who have lot's of possible data layers, but really only
need a dozen or so at a time.  They are using the INCLUDE option or a C
pre-processor to custom build map files on the fly.  

I would first try to figure out if you really needed such a giant map
file.  

David.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Stephen Woodbridge
Sent: Monday, August 27, 2007 8:40 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] number of layers in mapfile


Eric Lemoine wrote:
> Hi
> 
> I've observed that mapserv image rendering performance decreases 
> significantly with the number of layers. I currently have 500+ layers 
> in my mapfile and I see a huge performance hit if I decrease this 
> number to around 10. Is this expected? I use mapserver 4.10.
> 
> Thanks,
> 
> Sorry if this question has already been answered.
> 
> --
> Eric

Eric,

I think Ed McNierney did some performance tests on this issue (you might

be able to find it in the archives).

Anyway the up shot is that you have to parse and allocate objects for 
all the layers, symbols, styles, etc that are defined in all the layers 
and this takes time.

There is also a performance hit if you are using projection definitions 
because parsing all the projection init definitions is very time 
consuming. Frank W. might have more info on this. I think some people 
have made stripped down projection files with only the projections that 
they are using, to speed this up for production use.

-Steve W



More information about the mapserver-users mailing list