Server Tuning: How to speed up your TinyOWS server

Tips and Tricks for PostgreSQL / PostGIS databases

Tips and Tricks for Apache

Using Fast-CGI

  • Check that your TinyOWS is compiled with FastCGI support:

    [user@host mapserver]$ tinyows --check
    TinyOWS version:   1.1.0
    FCGI support:      Yes

Fast-CGI in Apache

  • In Apache, activate mod_fastcgi

    $ sudo apt-get install -y libapache2-mod-fastcgi
    $ sudo a2enmod fastcgi
  • Apache fast-cgi configuration:

    #in your cgi-bin directive, add the following to run all cgi-bin using FastCGI
    SetHandler fastcgi-script
    #in your FastCGI config file (typically something like /etc/apache2/mods-enabled/fastcgi.conf)
    FastCgiServer /usr/lib/cgi-bin/tinyows.fcgi -processes 10

Fast-CGI in MS4W

  • Please refer to the fastcgi doc in ms4w

  • Add the following 2 lines:

    DefaultInitEnv TINYOWS_CONFIG_FILE "/ms4w/apps/tinyows/config.xml"
    DefaultInitEnv TINYOWS_SCHEMA_DIR "/ms4w/apps/tinyows/schema/"

HTTP GZip compression

  • In Apache, activate mod_deflate

  • Deflate basic configuration, (note we’re including xml so gml and json):

    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/json