服务器优化:如何加速 TinyOWS 服务器¶
PostgreSQL/PostGIS 数据库的提示和技巧¶
在几何/地理列上使用空间索引 PostGIS Spatial Indexes .
索引任何可以经常用作筛选器的列
Apache的提示和技巧¶
使用 Fast-CGI¶
检查您的 TinyOWS 是否使用 FastCGI 支持编译:
[user@host mapserver]$ tinyows --check TinyOWS version: 1.1.0 FCGI support: Yes ...
Apache中的 Fast-CGI¶
在Apache中,激活 mod_fastcgi
$ sudo apt-get install -y libapache2-mod-fastcgi $ sudo a2enmod fastcgiApache fast-cgi 配置:
#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
MS4W 中的 Fast-CGI¶
添加以下两行:
DefaultInitEnv TINYOWS_CONFIG_FILE "/ms4w/apps/tinyows/config.xml" DefaultInitEnv TINYOWS_SCHEMA_DIR "/ms4w/apps/tinyows/schema/"
HTTP Gzip压缩¶
在Apache中,激活 mod_deflate
deflate基本配置(注意,我们包括 XML 即 gml 和 json):
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/json