Re: [mapserver-users] Mapserver crashes with large number of layers

2010-12-10 Thread Oliver Wesp
Thanks anyone for the help.

We didn't actually solved the problem but we found out how to avoid
it. First thing we found out was that the map was succesfully drawn
and that mapserver stucks after that. I tried it with mapscript and
the map image gets written to disk and after that php cgi stucks the
same way mapserver cgi does before. We didn't find out what exactly
happens but it's seems mapserver stucks when writing to the log files.
When we did some try and error with the logging mechanism we found out
(by accident) that everything is fine as soon as we turn of debugging
in the mapfile. For the moment I'm fine with this workaround but I
will try to get a small demo together as soon as as possible so maybe
somebody can have a look at it.

Best regards ,
Oliver

2010/12/8 Umberto Nicoletti umberto.nicole...@gmail.com:


 Looks like a deadlock to me.
 If you have msvc on the machine try to attach the debugger to the
 process and see where it's stuck by requesting a stacktrace for
 example. If msvc is not available I'd try ProcessMonitor from
 sysinternals and last but not least good ole gdb (yes it does run on
 Windows).

 Recompile mapserver with debugging symbols to get accurate function
 names and line numbers from the debugger.

 Last step: verify that the mapserv process ran by apache is not
 loading different dlls from the command line you used to test it.

 HTH,
 Umberto


 all. If I terminate the process using the task manager Premature end
 of script headers: mapserv.exe is written to the apache error.log and
 the client shows Internal Server Error.

 Right know we have no idea of what to look at. If anybody has any hint
 what might goes wrong we maybe would be able to look at it and maybe
 fix it. But right now we're stuck.

 Best regards,
 Oliver
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Mapserver crashes with large number of layers

2010-12-08 Thread Oliver Wesp
Dear List,

we're kind of stuck with the following problem:

First of all we are running Mapserver 5.6.5 in CGI Mode on Windows
2003 Server (64bit). Webserver is Apache 2.2.

We have a large Mapfile (seperated into 5 different parts using
INCLUDE) with a total of 571 Layers. The layers have different
MAXSCALEDENOM values  so not all of them are drawn at all scales. The
layers are referencing the DATA via TILEINDEX (it's S-57 data read
through OGR). Most of the layers cover only a small area, so if I zoom
in to the map more and more layers must be taken into account of
drawing but only a small number must be drawn. All of the layers are
divided into three groups using the GROUP parameter.
What happens if I zoom in to the map at some point mapserver crashes
(actually it's not crashing it just stucks). If I reduce the total
number of layers (by commenting out parts of the mapfile) the map will
be drawn again. So my guess is that there is a problem with the number
of layers (or styles?, or symbols?, or number of layers per group?)
included.
I turned on debugging on all of my layers but that didn't helped. If I
check the taskmanager mapserver.exe goes to 100% cpu usage and goes
back to zero after a few seconds but it's not being terminated. It's
still running in the process list. Debug output stops right in the
middle of the line. No error message is send to the client or written
to any of the logfiles. Actually no response is send to the client at
all. If I terminate the process using the task manager Premature end
of script headers: mapserv.exe is written to the apache error.log and
the client shows Internal Server Error.

Right know we have no idea of what to look at. If anybody has any hint
what might goes wrong we maybe would be able to look at it and maybe
fix it. But right now we're stuck.

Best regards,
Oliver
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver crashes with large number of layers

2010-12-08 Thread Yves Moisan

Dear List,

we're kind of stuck with the following problem:

First of all we are running Mapserver 5.6.5 in CGI Mode on Windows
2003 Server (64bit).

Hi,

I would first try to run it in FastCGI.  We also found running PHP (if 
you are using MS4W for instance) in FastCGI helps.

  Webserver is Apache 2.2.

We have a large Mapfile (seperated into 5 different parts using
INCLUDE) with a total of 571 Layers.
Try to keep separate mapfiles.  The shorter they are the better.  We 
also found putting STATUS OFF helps.

The layers have different
MAXSCALEDENOM values  so not all of them are drawn at all scales. The
layers are referencing the DATA via TILEINDEX (it's S-57 data read
through OGR). Most of the layers cover only a small area, so if I zoom
in to the map more and more layers must be taken into account of
drawing but only a small number must be drawn. All of the layers are
divided into three groups using the GROUP parameter.
What happens if I zoom in to the map at some point mapserver crashes
(actually it's not crashing it just stucks). If I reduce the total
number of layers (by commenting out parts of the mapfile) the map will
be drawn again. So my guess is that there is a problem with the number
of layers (or styles?, or symbols?, or number of layers per group?)
included.

Keep mapfiles small is what we found was most useful.

I turned on debugging on all of my layers but that didn't helped. If I
check the taskmanager mapserver.exe goes to 100% cpu usage and goes
back to zero after a few seconds but it's not being terminated. It's
still running in the process list. Debug output stops right in the
middle of the line. No error message is send to the client or written
to any of the logfiles. Actually no response is send to the client at
all. If I terminate the process using the task manager Premature end
of script headers: mapserv.exe is written to the apache error.log and
the client shows Internal Server Error.
I've had premature end os script headers from time to time.  I have no 
idea what triggers that.


HTH,

Yves

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver crashes with large number of layers

2010-12-08 Thread Oliver Wesp
Hello,

thanks for your help. Like you recommended I tried the request through
the commandline hoping for some kind of new error messages. Instead
the request just did what it should und returned the png without any
error. So it  works through commandline and crashes through cgi.

I also made a test on a 32bit machine and it shows the same behaviour.
And indeed we build mapserver by ourself but we can replicate the
problem with the binary from MS4W.

Best regards,
Oliver

 2010/12/8 Jeff McKenna jmcke...@gatewaygeomatics.com:
 Hello,

 I can give you the steps that I would do in this situation:

 - test this on a different machine
 - test on a 32bit machine
 - test on a Linux machine
 - if you build mapserv yourself, test with a binary/package (MS4W, FGS) and
 see if you can replicate the problem
 - convert your layers to shapefiles and retest (in other words see if
 avoiding using OGR helps at all)
 - get the exact CGI query string that causes problems in your browser and
 then try that same command through the commandline (examples at:
 http://www.mapserver.org/cgi/mapserv.html)...actually I would try that test
 first (because an error might be shown at the commandline, that is not
 displayed through the browser)
 - test with one big mapfile (avoid using includes just to see if that is the
 issue)
 - it might be an issue with tileindex on a layer...so if possible test
 without using a tileindex
 - but really, the best test is to start reducing the number of layers until
 you find the minimum number of layers that still cause the problem..then
 focus your testing on those few layers that are causing troubles (I often do
 this, and yes it takes time)

 Those are my initial thoughts.

 -jeff



 --
 Jeff McKenna
 MapServer Consulting and Training Services
 http://www.gatewaygeomatics.com/





 On 10-12-08 10:58 AM, Oliver Wesp wrote:

 Dear List,

 we're kind of stuck with the following problem:

 First of all we are running Mapserver 5.6.5 in CGI Mode on Windows
 2003 Server (64bit). Webserver is Apache 2.2.

 We have a large Mapfile (seperated into 5 different parts using
 INCLUDE) with a total of 571 Layers. The layers have different
 MAXSCALEDENOM values  so not all of them are drawn at all scales. The
 layers are referencing the DATA via TILEINDEX (it's S-57 data read
 through OGR). Most of the layers cover only a small area, so if I zoom
 in to the map more and more layers must be taken into account of
 drawing but only a small number must be drawn. All of the layers are
 divided into three groups using the GROUP parameter.
 What happens if I zoom in to the map at some point mapserver crashes
 (actually it's not crashing it just stucks). If I reduce the total
 number of layers (by commenting out parts of the mapfile) the map will
 be drawn again. So my guess is that there is a problem with the number
 of layers (or styles?, or symbols?, or number of layers per group?)
 included.
 I turned on debugging on all of my layers but that didn't helped. If I
 check the taskmanager mapserver.exe goes to 100% cpu usage and goes
 back to zero after a few seconds but it's not being terminated. It's
 still running in the process list. Debug output stops right in the
 middle of the line. No error message is send to the client or written
 to any of the logfiles. Actually no response is send to the client at
 all. If I terminate the process using the task manager Premature end
 of script headers: mapserv.exe is written to the apache error.log and
 the client shows Internal Server Error.

 Right know we have no idea of what to look at. If anybody has any hint
 what might goes wrong we maybe would be able to look at it and maybe
 fix it. But right now we're stuck.


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver crashes with large number of layers

2010-12-08 Thread Umberto Nicoletti
On Wed, Dec 8, 2010 at 3:58 PM, Oliver Wesp oliver.w...@gmail.com wrote:
 Dear List,

 we're kind of stuck with the following problem:

 First of all we are running Mapserver 5.6.5 in CGI Mode on Windows
 2003 Server (64bit). Webserver is Apache 2.2.

 We have a large Mapfile (seperated into 5 different parts using
 INCLUDE) with a total of 571 Layers. The layers have different
 MAXSCALEDENOM values  so not all of them are drawn at all scales. The
 layers are referencing the DATA via TILEINDEX (it's S-57 data read
 through OGR). Most of the layers cover only a small area, so if I zoom
 in to the map more and more layers must be taken into account of
 drawing but only a small number must be drawn. All of the layers are
 divided into three groups using the GROUP parameter.
 What happens if I zoom in to the map at some point mapserver crashes
 (actually it's not crashing it just stucks). If I reduce the total
 number of layers (by commenting out parts of the mapfile) the map will
 be drawn again. So my guess is that there is a problem with the number
 of layers (or styles?, or symbols?, or number of layers per group?)
 included.
 I turned on debugging on all of my layers but that didn't helped. If I
 check the taskmanager mapserver.exe goes to 100% cpu usage and goes
 back to zero after a few seconds but it's not being terminated. It's
 still running in the process list. Debug output stops right in the
 middle of the line. No error message is send to the client or written
 to any of the logfiles. Actually no response is send to the client at

Looks like a deadlock to me.
If you have msvc on the machine try to attach the debugger to the
process and see where it's stuck by requesting a stacktrace for
example. If msvc is not available I'd try ProcessMonitor from
sysinternals and last but not least good ole gdb (yes it does run on
Windows).

Recompile mapserver with debugging symbols to get accurate function
names and line numbers from the debugger.

Last step: verify that the mapserv process ran by apache is not
loading different dlls from the command line you used to test it.

HTH,
Umberto


 all. If I terminate the process using the task manager Premature end
 of script headers: mapserv.exe is written to the apache error.log and
 the client shows Internal Server Error.

 Right know we have no idea of what to look at. If anybody has any hint
 what might goes wrong we maybe would be able to look at it and maybe
 fix it. But right now we're stuck.

 Best regards,
 Oliver
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users