[mapserver-users] mapserver on apache

Daniel Morissette morissette at dmsolutions.ca
Fri Apr 20 09:12:17 EDT 2001


Gert-Jan van der Weijden wrote:
> 
> I've got some additional information:
> When running Apache from inetd instead of standalone the problem doesn't
> occur.
> The same for running the whole thing with another webserver (WN).
> 

I'm very surprised of this, but it would kind of confirm the theory of
some memory/resource leak or a buffer overflow somewhere and it may
quite well not be in php_mapscript.so.  Which other modules do you use? 
You don't use php_proj.so by any chance?  I think it has a small leak in
it... probably not enough to justify what happens here though.

The reason why I think it's a leak of some sort is that when apache is
run from inetd it is restarted for every request and the whole process
dies after so leaks can't persist.  Similar thing must happen with the
WN server where you probably had to configure PHP as a CGI instead of as
a module... so the PHP CGI restarts for every request and leaks cannot
persist in that case either.

Short term solution (i.e. workaround!) with Apache: you could configure
PHP as a CGI under Apache and you probably would not get that error any
more.

Now, there is obviously a problem somewhere that is triggered by
something you do or something you use in your script... without access
to the scripts/mapfile/data I can't be of more help.

> Could it be something like the mapfile gets locked by Apache ?
> 

No.  However it could be a leak of file handles in the first 4 requests
that makes it impossible to open the mapfile on the 5th request because
you ran out of available file handles.

Maybe something you can try is to monitor the number of opened file
handles after each request and see if it increases dramatically.  Run
the following command after each call to your script:

  $ lsof -c httpd | wc

(list file handles opened by processes running the command httpd)

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list