[mapserver-users] Scalability and Mapscript running PHP as a module NOT CGI

Daniel Morissette morissette at dmsolutions.ca
Tue Jul 16 14:00:05 EDT 2002


Mark Cave-Ayland wrote:
> 
> What is the current state of Mapscript being used as when running PHP
> as an Apache module instead of a CGI (see
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI for
> more info)?
> 

This PHP CGI issue is still present in 3.6 and is being worked on for
3.7 (as a lower priority task), we hope to have PHP MapScript working
with the PHP Apache module for 3.7, but there is no guarantee yet that
all thread-safety issues will be resolved by then.  Of course if someone
is interested in funding this work then it can become a higher priority.


> Currently we are looking at a system that can support 500 simultaneous
> users without a problem.  From what I
> understand, the performance would be increased substantially running
> as a module as there is no need to launch a new process when
> executing the PHP script. If it is not yet supported in this configuration,
> would the CGI version scale to 500 users on a single machine (how
> many maps per second have people managed to obtain on various
> hardware etc.), and if not, how much work would be required to make
> the necessary modifications to Mapscript to run with PHP as a module
> to get the best performance possible?
> 

500 users?  How many map draws per user?  What kind of data are you
mapping?  

I think a better measure is number of maps per day.  To give you an
idea, a PIII 1GHz, IDE HD, 512MB RAM running Linux could easily serve
30,000 hits per day on our GMap PHP MapScript application (that's 1
hit/second at peak times, 20 hits/minute average).

Of course it all depends on how much load drawing a single map puts on
your server, some apps will suck several seconds of CPU per map draw,
others will draw a map in a fraction of a second.  So you need to
benchmark how much time a single hit takes with your specific
application, and do the maths yourself.  

Now, this being said, the PHP/CGI overhead is relatively small if your
maps take 3 seconds to draw anyway... so you should look at how you can
tune your map data with tile indexes and shptree before worrying too
much about the PHP CGI issue.

I hope that helps,

Daniel
-- 
------------------------------------------------------------
 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