<div dir="ltr">Nice, glad to hear! The overhead starting a new process for each request is a huge performance hit. Would be interesting to see a plot of performance benchmarks comparing all your setups.<div><br></div><div>Cheers,</div><div>Pete</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 9:10 PM James Gardner <<a href="mailto:jsg@internode.on.net">jsg@internode.on.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>that setup, on my home machine, answers twice as many requests in
      10 minutes, as my 'best' setup using apache2 and mod_cgi</p>
    <p>i think i am getting such poor performance with fcgiwrap because
      it needs to spawn a new mapserver process for each request... but
      because it has 'fast' in the name, i simply assume its going to be
      'fast'... oh well.. i know better now.. .</p>
    <p>Thanks Peter!</p>
    <p>   James Gardner</p>
    <p><br>
    </p>
    <div>On 5/4/20 10:32 am, Peter Schmitt
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">Hi James,
          <div><br>
          </div>
          <div>I am not familiar with fcgiwrap.  Here's what my setup
            looks like:</div>
          <div>Nginx proxies to MapServer listening on a unix socket.  <a href="https://github.com/pedros007/debian-mapserver/blob/master/etc/nginx/sites-available/mapserver_proxy.conf" target="_blank">https://github.com/pedros007/debian-mapserver/blob/master/etc/nginx/sites-available/mapserver_proxy.conf</a> 
            This looks pretty similar to your nginx conf: </div>
          <div><a href="https://github.com/kalessine/mapserver-benchmark/blob/c7927f9482b28cce2e2585296f760c2ba3547ca5/nginx-fcgiwrap/default#L56-L69" target="_blank">https://github.com/kalessine/mapserver-benchmark/blob/c7927f9482b28cce2e2585296f760c2ba3547ca5/nginx-fcgiwrap/default#L56-L69</a></div>
          <div><br>
          </div>
          <div>I use supervisord to start 8 mapserv processes listening
            on the above socket.  Here's my supervisord config: <a href="https://github.com/pedros007/debian-mapserver/blob/master/etc/supervisor/conf.d/supervisord.conf" target="_blank">https://github.com/pedros007/debian-mapserver/blob/master/etc/supervisor/conf.d/supervisord.conf</a></div>
          <div>Supervisor starts both nginx and the 8 mapserv
            processes.  This really simplifies server startup in my
            Dockerfile:</div>
          <div><a href="https://github.com/pedros007/debian-mapserver/blob/88ef21ae0846db5732e782a2dd56e925c149acd8/Dockerfile#L72" target="_blank">https://github.com/pedros007/debian-mapserver/blob/88ef21ae0846db5732e782a2dd56e925c149acd8/Dockerfile#L72</a><br>
          </div>
          <div><br>
          </div>
          <div>I haven't done much benchmarking on this in several
            years. At one point I did experiment with Apache mod_fcgi
            and got pretty good performance. From what I recall this was
            ever so slightly faster. In any case, when my Docker
            container runs on an AWS EC2 instance,  MapServer returns
            256x256 raster jpgs from GeoTIFFs stored in an AWS S3 Bucket
            in about 300-500 ms under reasonable loads.  Local optimized
            GeoTIFFs can be much faster, especially on SSDs (less than
            100ms) using this setup.</div>
          <div><br>
          </div>
          <div>Hope that helps!</div>
          <div>Pete</div>
          <div> </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 8:18
            AM James Gardner <<a href="mailto:jsg@internode.on.net" target="_blank">jsg@internode.on.net</a>> wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
            <br>
            I have done some preliminary work on a mapserver
            benchmarking project....<br>
            <br>
            <a href="http://github.com/kalessine/mapserver-benchmark/" rel="noreferrer" target="_blank">github.com/kalessine/mapserver-benchmark/</a><br>
            <br>
            documentation is sparse at the moment, but i'll do some more
            work on <br>
            this next week...<br>
            <br>
            my initial tests show that mapserv called by fcgiwrap from
            nginx is <br>
            quite slow :( there seems to be<br>
            <br>
            an additional 1 second of latency added to each request...
            if anyone <br>
            knowledgeable on ubuntu 18.04, nginx, fcgiwrap and mapserv
            could have a <br>
            look at my server script (under
            mapserver-benchmark/nginx-fcgiwrap/ and <br>
            give me some advice as to where i'm going wrong...<br>
            <br>
            i'm thinking it may be in the fastcgi_params file that comes
            stock with <br>
            nginx..<br>
            <br>
            apache2 responds to requests much (6x requests in 10mins)
            faster...<br>
            <br>
            suggestions welcome!<br>
            <br>
            Thanks,<br>
            <br>
                James Gardner<br>
            <br>
            <br>
            <br>
            _______________________________________________<br>
            mapserver-users mailing list<br>
            <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
            <a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></blockquote>
        </div>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr">Pete</div>
      </div>
    </blockquote>
  </div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Pete</div>