KOHA
Koha performance: Revision 1

Ova stranica dokumentira naša podešavanja (i pokušaje) za što bržom Koha instalacijom.



Apache deflate kompresija

Smanjuje veličinu stranice koja se isporučije browersu.

  • apache2

    deflate-test.sh

    apache2/deflate-test.sh
    #!/bin/sh
    
    if [ -z "$1" ] ; then
    	echo "Usage: $0 http://www.example.com/"
    	exit 1
    else
    	url=$1
    fi
    
    time wget $url -O /tmp/foo
    echo
    time wget --header="Accept-Encoding: gzip" $url -O /tmp/foo.gz
    echo
    
    orig_size=`ls -al /tmp/foo    | awk '{ print $5 }'`
    comp_size=`ls -al /tmp/foo.gz | awk '{ print $5 }'`
    
    if [ $comp_size -lt $orig_size ] ; then
    	echo "OK $comp_size < $orig_size";
    else
    	echo "ERROR: no visible compression benefits"
    fi
    
    #ls -al /tmp/foo /tmp/foo.gz

    deflate.conf

    apache2/deflate.conf
    # /etc/apache2/conf.d/deflate.conf
    
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/html text/plain text/xml
    
    	SetOutputFilter DEFLATE
    	SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ 			no-gzip dont-vary
    	SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$	no-gzip dont-vary
    	SetEnvIfNoCase Request_URI \.pdf$							no-gzip dont-vary
    
    	BrowserMatch ^Mozilla/4 gzip-only-text/html
    	BrowserMatch ^Mozilla/4\.0[678] no-gzip
    	BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
    	DeflateFilterNote Input input_info
    	DeflateFilterNote Output output_info
    	DeflateFilterNote Ratio ratio_info
    	LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
    	CustomLog /var/log/apache2/deflate.log deflate
    </IfModule>

    server-status.conf

    apache2/server-status.conf
    <IfModule mod_status.c>
    
    # munin needs ExtededStatus
    ExtendedStatus On
    
    <Location /server-status>
    	SetHandler server-status
    	Order deny,allow
    	Deny from all
    #	Allow from all
    	Allow from 127.0.0.1
    	Allow from .ffzg.hr
    </Location>
    
    </IfModule>