Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:apache_http_server_-_mod_cband_-_bandbreitenbeschraenkung

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:apache_http_server_-_mod_cband_-_bandbreitenbeschraenkung [2012/06/11 13:20] klaustachtler:apache_http_server_-_mod_cband_-_bandbreitenbeschraenkung [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1
Zeile 1: Zeile 1:
-====== Apache HTTP Server - mod_cband - Bandbreitenbeschränkung ====== 
- 
-Das ''mod_cband'' ist ein [[http://httpd.apache.org|Apache HTTP Server]] 2 Modul, welches das Problem der Bandbreitenbeschränkung, das Limitieren von gleichzeitig agierenden Benutzers und ebenfalls das Beschränken der Bandbreite einzelner "virtueller Hosts" zu lösen vermag. Die aktuelle Version kann Bandbreitenbeschränkungen für "virtuelle Hosts" und gleichzeitig agierende Benutzer realisieren, die maximale Download-Geschwindigkeit limitieren (wie z.B. ''mod_bandwidth''), die Anzahl der Anfragen pro Sekunde einschränken und die maximale Anzahl gleichzeitiger IP-Verbindungen (wie bei 'mod_limitipconn') regeln.  
- 
-===== Herunterladen ===== 
- 
-Das [[http://httpd.apache.org|Apache HTTP Server]] 2 Modul - ''mod_cband'' kann unter folgendem Link heruntergeladen werden: 
- 
-  * [[http://codee.pl/cband.html|mod_cband - Download]] 
- 
-Die aktuelle Version bei der Erstellung dieses Artikels ist ''mod-cband-0.9.7.5.tgz''. 
- 
-===== Installieren ===== 
- 
-Nach dem herunterladen einer Version von [[http://codee.pl/cband.html|mod_cband]] in z.B. das Verzeichnis ''/tmp'' auf den lokalen Rechner, sollte sich folgende Datei  
-<code> 
-mod-cband-0.9.7.5.tgz 
-</code> 
-im Verzeichnis ''/tmp'' befinden. 
- 
-Das heruntergeladene //Archiv// mit dem Namen ''mod-cband-0.9.7.5.tgz'' kann mit folgendem Befehl //entpackt// werden: 
-<code> 
-$ tar xvfz mod-cband-0.9.7.5.tgz 
-</code> 
- 
-Anschließend sollte sich ein Verzeichnis mit dem Namen ''mod-cband-0.9.7.5.tgz'' im Verzeichnis ''/tmp'' befinden: 
-<code> 
-# ll /tmp/ 
-... 
-drwxr-xr-x 5 root root  4096 Nov 14  2006 mod-cband-0.9.7.5 
--rw-r--r-- 1 root root 70713 Jun  1 22:38 mod-cband-0.9.7.5.tgz 
-... 
-</code> 
- 
-Abschliessend kann das heruntergeladene //Archiv// ''mod-cband-0.9.7.5.tgz'' mit folgendem Befehl gelöscht werden: 
-<code> 
-$ rm /tmp/mod-cband-0.9.7.5.tgz 
-</code> 
- 
-Ab hier werden ''root''-Rechte zur Ausführung der nachfolgenden Befehle benötigt. Um ''root'' zu werden geben Sie bitte folgenden Befehl ein: 
-<code> 
-$ su - 
-Password:  
-</code> 
- 
-Mit nachfolgendem Befehl ist nun eine Wechsel ins Verzeichnis ''/tmp/mod_cband-0.9.7.5'' erforderlich: 
-<code> 
-# cd /tmp/mod-cband-0.9.7.5 
-</code> 
- 
-==== httpd-devel installieren ==== 
- 
-:!: **WICHTIG** - Bevor mit dem nächsten Schritt, der Kompilation von [[http://codee.pl/cband.html|mod_cband]] begonnen werden kann, ist es erforderlich, dass das RPM-Paket 
-  * httpd-devel 
-installiert ist. Dies kann mit nachfolgendem Befehl überprüft werden: 
- 
-**Paket installiert** 
-<code> 
-Loaded plugins: fastestmirror, priorities 
-Loading mirror speeds from cached hostfile 
- * rpmforge: ftp-stud.fht-esslingen.de 
- * base: centos.intergenia.de 
- * updates: centos.intergenia.de 
- * addons: centos.intergenia.de 
- * extras: centos.intergenia.de 
-424 packages excluded due to repository priority protections 
-Installed Packages 
-httpd-devel.i386                  2.2.3-22.el5.centos.2                installed 
-</code> 
- 
-**Paket NICHT installiert** 
-<code> 
-# yum list httpd-devel 
-Loaded plugins: fastestmirror, priorities 
-Loading mirror speeds from cached hostfile 
- * rpmforge: ftp-stud.fht-esslingen.de 
- * base: centos.intergenia.de 
- * updates: centos.intergenia.de 
- * addons: centos.intergenia.de 
- * extras: centos.intergenia.de 
-424 packages excluded due to repository priority protections 
-Available Packages 
-httpd-devel.i386                  2.2.3-22.el5.centos.2                  updates 
-</code> 
- 
-Falls wie hier am **Ende der letzten Zeile** wie oben gezeigt **updates** und **NICHT** - **installed** steht, ist mit nachfolgendem Befehl, noch das Paket ''httpd-devel'' zu installieren: 
-<code> 
-# yum install httpd-devel 
-Loaded plugins: fastestmirror, priorities 
-Loading mirror speeds from cached hostfile 
- * rpmforge: ftp-stud.fht-esslingen.de 
- * base: centos.intergenia.de 
- * updates: centos.intergenia.de 
- * addons: centos.intergenia.de 
- * extras: centos.intergenia.de 
-424 packages excluded due to repository priority protections 
-Setting up Install Process 
-Parsing package install arguments 
-Resolving Dependencies 
---> Running transaction check 
----> Package httpd-devel.i386 0:2.2.3-22.el5.centos.2 set to be updated 
---> Processing Dependency: apr-devel for package: httpd-devel 
---> Processing Dependency: apr-util-devel for package: httpd-devel 
---> Running transaction check 
----> Package apr-devel.i386 0:1.2.7-11.el5_3.1 set to be updated 
----> Package apr-util-devel.i386 0:1.2.7-7.el5_3.2 set to be updated 
---> Finished Dependency Resolution 
- 
-Dependencies Resolved 
- 
-================================================================================ 
- Package             Arch      Version                       Repository    Size 
-================================================================================ 
-Installing: 
- httpd-devel         i386      2.2.3-22.el5.centos.2         updates      145 k 
-Installing for dependencies: 
- apr-devel           i386      1.2.7-11.el5_3.1              updates      231 k 
- apr-util-devel      i386      1.2.7-7.el5_3.2               updates       53 k 
- 
-Transaction Summary 
-================================================================================ 
-Install      3 Package(s)          
-Update       0 Package(s)          
-Remove       0 Package(s)          
- 
-Total download size: 429 k 
-Is this ok [y/N]: y 
-Downloading Packages: 
-(1/3): apr-util-devel-1.2.7-7.el5_3.2.i386.rpm            53 kB     00:00      
-(2/3): httpd-devel-2.2.3-22.el5.centos.2.i386.rpm        | 145 kB     00:00      
-(3/3): apr-devel-1.2.7-11.el5_3.1.i386.rpm               | 231 kB     00:00      
--------------------------------------------------------------------------------- 
-Total                                           423 kB/s | 429 kB     00:01      
-Running rpm_check_debug 
-Running Transaction Test 
-Finished Transaction Test 
-Transaction Test Succeeded 
-Running Transaction 
-  Installing     : apr-devel                                         [1/3]  
-  Installing     : apr-util-devel                                    [2/3]  
-  Installing     : httpd-devel                                       [3/3]  
- 
-Installed: httpd-devel.i386 0:2.2.3-22.el5.centos.2 
-Dependency Installed: apr-devel.i386 0:1.2.7-11.el5_3.1 apr-util-devel.i386 0:1.2.7-7.el5_3.2 
-Complete! 
-</code> 
- 
-==== mod_cband kompilieren ==== 
- 
-Der nächste Schritt wäre nun die Überprüfung, welche **//Optional Features//** für das Kompilieren von [[http://codee.pl/cband.html|mod_cband]] zur Verfügung stehen und welche davon bei der Kompilation Verwendung finden sollen. Da aber aktuelle **keine optionalen Features** verfügbar sind, kann nachfolgender Befehl zur Kompilation verwendet werden: 
-<code> 
-# ./configure  
-</code> 
- 
-Die Anzeige sollte nach vielen Ausgaben, welche z.B. wie folgt aussehen: 
-<code> 
-checking for gcc... gcc 
-checking for C compiler default output file name... a.out 
-checking whether the C compiler works... yes 
-... 
-</code> 
-und mit einer Anzeige enden, die in etwa wie folgt aussieht: 
-<code> 
-... 
-configure: creating ./config.status 
-config.status: creating Makefile 
-</code> 
- 
-Jetzt kann das "eigentliche" Kompilieren von [[http://codee.pl/cband.html|mod_cband]] erfolgen. Dies sollte in folgenden Schritten durchgeführt werden: 
-<code> 
-# make 
- 
-apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c 
-/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
---param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT  
--D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -Wall -DDST_CLASS=3   
--c -o src/mod_cband.lo 
-src/mod_cband.c && touch src/mod_cband.slo 
-src/mod_cband.c:81: warning: type qualifiers ignored on function return type 
-/usr/lib/apr-1/build/libtool --silent --mode=link gcc -o src/mod_cband.la  -rpath /usr/lib/httpd/modules -module -avoid-version     
-src/mod_cband.lo 
- 
-write "make install" to install module 
- 
-</code> 
-Falls keine Fehler aufgetreten sein sollten, kann abschließend dann die eigentliche Installation mit folgendem Befehl durchgeführt werden: 
-<code> 
-# make install 
-apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -i -a -n cband src/mod_cband.la 
-/usr/lib/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib/apr-1/build/libtool' src/mod_cband.la /usr/lib/httpd/modules 
-/usr/lib/apr-1/build/libtool --mode=install cp src/mod_cband.la /usr/lib/httpd/modules/ 
-cp src/.libs/mod_cband.so /usr/lib/httpd/modules/mod_cband.so 
-cp src/.libs/mod_cband.lai /usr/lib/httpd/modules/mod_cband.la 
-cp src/.libs/mod_cband.a /usr/lib/httpd/modules/mod_cband.a 
-chmod 644 /usr/lib/httpd/modules/mod_cband.a 
-ranlib /usr/lib/httpd/modules/mod_cband.a 
-PATH="$PATH:/sbin" ldconfig -n /usr/lib/httpd/modules 
----------------------------------------------------------------------- 
-Libraries have been installed in: 
-   /usr/lib/httpd/modules 
- 
-If you ever happen to want to link against installed libraries 
-in a given directory, LIBDIR, you must either use libtool, and 
-specify the full pathname of the library, or use the `-LLIBDIR' 
-flag during linking and do at least one of the following: 
-   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable 
-     during execution 
-   - add LIBDIR to the `LD_RUN_PATH' environment variable 
-     during linking 
-   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag 
-   - have your system administrator add LIBDIR to `/etc/ld.so.conf' 
- 
-See any operating system documentation about shared libraries for 
-more information, such as the ld(1) and ld.so(8) manual pages. 
----------------------------------------------------------------------- 
-chmod 755 /usr/lib/httpd/modules/mod_cband.so 
-[activating module `cband' in /etc/httpd/conf/httpd.conf] 
-</code> 
- 
-===== Konfiguration ===== 
- 
-Die Konfiguration von [[http://codee.pl/cband.html|mod_cband]] ist in der Hauptkonfigurationsdatei des [[http://httpd.apache.org|Apache HTTP Servers]] und in den "virtuellen Hosts" durchzuführen: 
- 
-==== /etc/httpd/conf/httpd.conf ==== 
- 
-Folgende zusätzlich Eintragungen in der Konfigurationsdatei ''/etc/httpd/conf/httpd.conf'' des [[http://httpd.apache.org|Apache HTTP Servers]] sind notwendig, um das Modul [[http://codee.pl/cband.html|mod_cband]] zu einzubinden und zu laden (**nur relevanter Ausschnitt**): 
-<code apache> 
-... 
-# 
-# Dynamic Shared Object (DSO) Support 
-# 
-# To be able to use the functionality of a module which was built as a DSO you 
-# have to place corresponding `LoadModule' lines at this location so the 
-# directives contained in it are actually available _before_ they are used. 
-# Statically compiled modules (those listed by `httpd -l') do not need 
-# to be loaded here. 
-# 
-# Example: 
-# LoadModule foo_module modules/mod_foo.so 
-# 
-... 
-... 
-... 
-LoadModule cband_module modules/mod_cband.so 
-... 
-</code> 
- 
-Um die **Performance** von [[http://codee.pl/cband.html|mod_cband]] zu steigern, kann folgende Direktive ebenfalls noch verwendet werden: 
-<code apache> 
-... 
-CBandRandomPulse On 
-... 
-</code> 
- 
-**Erklärung** 
-^ Bescheibung  ^ Erklärung                                                                                  ^ 
-| Name         | **CBandRandomPulse**                                                                       | 
-| Description  | Turns On or Off the random pulse generator for data sending                                | 
-|              | Random pulse generator is a part of the speed-limiting implementation of mod_cband. \\ This directive changes the way a connection's speed is determined and enforced. \\ The connections' speeds are measured within some time period and then provided for in  \\ that period. When r.p.g. is enabled this period is chosen randomly, \\ providing for a statisticaly saner load distribution. Disabling this causes spikes both in \\ bandwidth and cpu usages |               
-| Context      | Global                                                                                     | 
-| Syntax       | CBandRandomPulse On/Off                                                                    | 
- 
-==== /etc/httpd/conf.d/vhost.conf ==== 
- 
-Eine mögliche Konfiguration eines "virtuellen Hosts" könnte in etwa wie nachfolgend am "virtuellen Host" - [[http://www.dokuwiki.tachtler.net|http://www.dokuwiki.tachtler.net]] dargestellt aussehen. 
- 
-Folgende Bandbreitenbeschränkungen sollen dabei zum Einsatz kommen: 
- 
-  * Banbreitenbeschränkung für ''localhost'' - **Bandbreite 1024kbps, 12 Anfragen pro Sekunde, 10 gleichzeitige Verbindungen** 
-  * Banbreitenbeschränkung für das interne Netzwerk ''internal_network'' - **Bandbreite 1024kbps, 12 Anfragen pro Sekunde, 10 gleichzeitige Verbindungen** 
-  * Banbreitenbeschränkung für die externe IP-Adresse ''external_network'' - **Bandbreite 1024kbps, 12 Anfragen pro Sekunde, 10 gleichzeitige Verbindungen** 
-  * Banbreitenbeschränkung für alle anderen - **Bandbreite 512kbps, 10 Anfragen pro Sekunde, 8 gleichzeitige Verbindungen** 
- 
-Bevor wir jedoch mit dem Konfigurieren des "virtuellen Hosts" beginnen, ist es erforderlich eine sog. ''scoreboard''-Datei anzulegen, in die [[http://codee.pl/cband.html|mod_cband]] Statistik-Daten ablegen kann. Dies kann mit nachfolgendem Befehl realisiert werden. 
-<code> 
-# touch /var/www/html/dokuwiki/mod_cband_scoreboard_file 
-</code> 
- 
-:!: **WICHTIG** - Die Datei muss für den Benutzer, welcher für den [[http://httpd.apache.org|Apache HTTP Server]] derfiniert ist - hier ''apache'' **beschreibbar** sein! 
- 
-Um die Besitz- und Zugriffsrechte richtig zu setzen sind nachfolgende Befehle notwendig. Zum setzen der richtigen Besitzrechte: 
-<code> 
-# chown apache.apache /var/www/html/dokuwiki/mod_cband_scoreboard_file 
-</code> 
-und der richtigen Schreibrechte: 
-<code> 
-# chmod 740 /var/www/html/dokuwiki/mod_cband_scoreboard_file 
-</code> 
- 
-Nach der Anlage der Statistik-Datei, könnte eine Definition einen "virtuellen Hosts" wie folgt aussehen (**nur relevander Ausschnitt**): 
-<code apache> 
-# 
-# Tachtler 
-# Configuration global settings mod_cband 
-# 
-<IfModule mod_cband.c> 
-        <CBandClass class_localhost> 
-                CBandClassDst 127.0.0.0/8 
-        </CBandClass> 
- 
-        <CBandClass class_internal_network> 
-                CBandClassDst 192.168.0.0/24 
-        </CBandClass> 
- 
-        <CBandClass class_external_network> 
-                CBandClassDst 88.217.171.167/32 
-        </CBandClass> 
-</IfModule> 
-... 
-... 
-... 
-# 
-# dokuwiki.tachtler.net 
-# 
-<VirtualHost *:80> 
-        ServerAdmin webmaster@tachtler.net 
-        ServerName dokuwiki.tachtler.net 
-        ServerAlias www.dokuwiki.tachtler.net 
-        ServerPath / 
-        DocumentRoot "/var/www/html/dokuwiki" 
-        <Directory "/var/www/html/dokuwiki"> 
-                Options FollowSymLinks 
-                AllowOverride None 
-                Order allow,deny  
-                Allow from all 
-        </Directory> 
-        DirectoryIndex index.php 
-        ErrorLog logs/error.log 
-        CustomLog logs/access.log combined 
- 
-        # Tachtler (mod_cband) 
-        <IfModule mod_cband.c> 
-                # Specifies maximal speed for any remote client from some destination class 
-                # CBandClassRemoteSpeed class_name kbps rps 
-                # class_name - name of defined destination class 
-                # kbps - maximal transfer speed in kbps or kB/s 
-                # rps - maximal requests per second 
-                # max_conn - maximal number of simultaneous connections 
-                CBandClassRemoteSpeed class_localhost 1024kbps 12 10 
-                CBandClassRemoteSpeed class_internal_network 1024kbps 12 10 
-                CBandClassRemoteSpeed class_external_network 1024kbps 12 10 
- 
-                # Specifies a maximal speed for a virtualhost 
-                # kbps - maximal transfer speed in kbps or kB/s 
-                # rps - maximal requests per second 
-                # max_conn - maximal number of simultaneous connections 
-                CBandSpeed 512kbps 10 8 
- 
-                # Specifies virtualhost's scoreboard file 
-                CBandScoreBoard /var/www/html/dokuwiki/mod_cband_scoreboard_file 
-        </IfModule> 
- 
-</VirtualHost> 
-... 
-</code> 
- 
-==== /cband-status ==== 
- 
-[[http://codee.pl/cband.html|mod_cband]] besitzt die Möglichkeit den aktuellen Status abzufragen. 
- 
-Dafür muss die Definition innerhalb der Konfigurationsdatei ''/etc/httpd/conf.d/vhost.conf'' nur geringfügig angepasst werden, damit alle "virtuellen Hosts", welche eine Definition für [[http://codee.pl/cband.html|mod_cband]] enthalten, auch die Status-Informationen preis geben können. 
- 
-Folgende Anpassung an ''/etc/httpd/conf.d/vhost.conf'' ist erforderlich (**nur relevanter Ausschnitt**): 
-<code apache> 
-... 
-        <Location /cband-status> 
-                SetHandler cband-status 
-        </Location> 
-... 
-</code> 
- 
-Der komplette "Absatz" in der Konfigurationsdatei ''/etc/httpd/conf.d/vhost.conf'', sollte dann wie folgt aussehen (**nur relevanter Ausschnitt**): 
-<code apache> 
-# 
-# Tachtler 
-# Configuration global settings mod_cband 
-# 
-<IfModule mod_cband.c> 
-        <CBandClass class_localhost> 
-                CBandClassDst 127.0.0.0/8 
-        </CBandClass> 
- 
-        <CBandClass class_internal_network> 
-                CBandClassDst 192.168.0.0/28 
-        </CBandClass>  
- 
-        <CBandClass class_external_network> 
-                CBandClassDst 88.217.171.167/32 
-        </CBandClass> 
-</IfModule> 
-... 
-... 
-... 
-# 
-# dokuwiki.tachtler.net 
-# 
-<VirtualHost *:80> 
-        ServerAdmin webmaster@tachtler.net 
-        ServerName dokuwiki.tachtler.net 
-        ServerAlias www.dokuwiki.tachtler.net 
-... 
-        <Location /cband-status> 
-                SetHandler cband-status 
-        </Location> 
-... 
-</VirtualHost> 
-</code> 
- 
-Der Aufruf kann dann durch anhängen an die Adresse des "virtuellens Hosts" von ''/cband-status'' erfolgen. Hier ein Beispiel: 
-  * [[http://www.dokuwiki.tachtler.net/cband-status|http://www.dokuwiki.tachtler.net/cband-status]] 
- 
-{{:tachtler:mod_cband-status.png?892x424|mod_cband-status}} 
- 
-===== Neustart Apache HTTP Server ===== 
- 
-Ein erneuter oder erster Start des [[http://httpd.apache.org/|Apache HTTP Server]] mit folgenden Befehl für eine erstmaligen Start 
-<code> 
-# service httpd start 
-</code> 
-oder einen erneuten Start des [[http://httpd.apache.org/|Apache HTTP Server]] mit folgendem Befehl 
-<code> 
-# service httpd restart 
-</code> 
-macht die oben beschriebenen Konfigurationen für den [[http://httpd.apache.org/|Apache HTTP Server]] wirksam. 
- 
-===== Dokumentation mod_cband ===== 
- 
-Die Dokumentation von [[http://codee.pl/cband.html|mod_cband]] kann auch unter ''/tmp/mod-cband-0.9.7.5/doc'' gefunden werden und liegt in der Datei: 
-  * **''/tmp/mod-cband-0.9.7.5/doc/documentation.txt''** 
- 
-:!: Nachfolgend der Auszüge aus ''''/tmp/mod-cband-0.9.7.5/doc/documentation.txt'' - **im englischen Original** 
- 
-==== Units accepted in various directives ==== 
- 
-<code> 
-    * transfer speeds: 
-          o kbps, Mbps, Gbps - multiples of "bits per second", respectively: 1024, 1024*1024 and 1024*1024*1024 bps 
-          o kb/s, Mb/s, Gb/s - multiples of "bytes per second", respectively: 1024, 1024*1024 and 1024*1024*1024 b/s 
-          o defaults to kbps 
- 
-    * transfer quotas: 
-          o K, M, G - multiples of bytes, respectively: 1000, 1000*1000 and 1000*1000*1000 bytes 
-          o Ki, Mi, Gi - multiples of bytes, respectively: 1024, 1024*1024 and 1024*1024*1024 bytes 
-          o defaults to K 
- 
-    * time periods: 
-          o S, M, H, D, W - multiples of seconds: Seconds, Minutes, Hours, Days, Weeks; respectively: 1, 60, 3600, 86400, 604800 seconds 
-          o defaults to S 
-</code> 
- 
-==== Directives ==== 
- 
-<code> 
-Name            CBandDefaultExceededURL 
-Description     Default URL where mod_cband should redirect all requests to the virtualhost or  
-                user when the configured transfer limit is exceeded 
-NOTE:           If you don't specify the exceeded URL location then standard 503 Service Unavailable  
-                will be sent 
-Context         Server config 
-Syntax          CBandDefaultExceededURL URL 
-</code> 
-<code> 
-Name            CBandDefaultExceededCode 
-Description     The http code sent to the user when the configured transfer is exceeded 
-Context         Server config 
-Syntax          CBandDefaultExceededCode HTTP_CODE 
-Example         CBandDefaultExceededCode 509 
-</code> 
-<code> 
-Name            CBandScoreFlushPeriod 
-Description     Specifies a period after which the score for the virtualhost or user is written to the scoreboard file.  
-                Use this to improve mod_cband's performance 
-Default         1 
-Context         Server config 
-Syntax          CBandScoreFlushPeriod number_of_requests 
-Example         CBandScoreFlushPeriod 100 
-                Any virtualhost's or user's scoreboard will be saved after 100 requests 
-</code> 
-<code> 
-Name            CBandSpeed 
-Description     Specifies a maximal speed for a virtualhost 
-Context         <Virtualhost> 
-Syntax          CBandSpeed kbps rps max_conn 
-                kbps - maximal transfer speed in [kMG]bps or [kMG]B/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-Example         CBandSpeed 1024 10 30 
-                Specifies maximal speed 1024kbps (1024 * 1024 bits per second),  
-                maximal 10 requests per second and with a maximum of 30 open connections 
-NOTE:           This feature is available from version 0.9.6.0 
-</code> 
-<code> 
-Name            CBandRemoteSpeed 
-Description     Specifies maximal speed for any remote client 
-Context         <Virtualhost> 
-Syntax          CBandRemoteSpeed kbps rps max_conn 
-                kbps - maximal transfer speed in [kMG]bps or [kMG]B/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-Example         CBandRemoteSpeed 20kb/s 3 3 
-                Specifies maximal speed 20kB/s (20 * 1024 bytes per second),  
-                maximal 3 requests per second and 3 open connections for any remote client 
-NOTE:           This feature is available from version 0.9.6.1-rc2 
-</code> 
-<code> 
-Name            CBandClassRemoteSpeed 
-Description     Specifies maximal speed for any remote client from some destination class 
-Context         <Virtualhost> 
-Syntax          CBandClassRemoteSpeed class_name kbps rps 
-                class_name - name of defined destination class 
-                kbps - maximal transfer speed in kbps or kB/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-Example         <CBandClass googlebot_class> 
-                    CBandClassDst 66.249.64/24 
-                    CBandClassDst 66.249.65/24 
-                    CBandClassDst 66.249.79/24 
-                </CBandClass> 
-                CBandClassRemoteSpeed googlebot_class 20kb/s 2 3 
- 
-                Specifies maximal speed 20kB/s (20 * 1024 bytes per second),  
-                maximal 2 requests per second and 3 open connections for any remote client from  
-                class googlebot_class 
-NOTE:           This feature is available from version 0.9.6.1-rc2 
-</code> 
-<code> 
-Name            CBandRandomPulse 
-Description     Turns On or Off the random pulse generator for data sending 
-                Random pulse generator is a part of the speed-limiting implementation of mod_cband.  
-                This directive changes the way a connection's speed is determined and enforced.  
-                The connections' speeds are measured within some time period and then provided for in  
-                that period. When r.p.g. is enabled this period is chosen randomly,  
-                providing for a statisticaly saner load distribution. Disabling this causes spikes both in  
-                bandwidth and cpu usages 
-Context         Global 
-Syntax          CBandRandomPulse On/Off 
-</code> 
-<code> 
-Name            CBandLimit 
-Description     Specifies bandwidth limit for virtualhost 
-Context         <Virtualhost> 
-Syntax          CBandLimit limit 
-                limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi),  
-                Mi (mebi), Gi (gibi) 
-Example         CBandLimit 10M 
-                Specifies 10 * 1000 * 1000 bytes bandwidth quota 
- 
-                CBandLimit 10Mi 
-                Specifies 10 * 1024 * 1024 bytes bandwidth quota 
-</code> 
-<code> 
-Name            CBandClassLimit 
-Description     Specifies bandwidth limit for virtualhost's destination class 
-Context         <Virtualhost> 
-Syntax          CBandClassLimit class_name limit 
-                class_name - the name of defined class 
-                limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi),  
-                Mi (mebi), Gi (gibi) 
-</code> 
-<code> 
-Name            CBandExceededURL 
-Description     Specifies a URL where mod_cband should redirect all requests to a virtualhost when the  
-                configured transfer limit is exceeded  
-                 
-                NOTE: If you don't specify the exceeded URL location then standard 503 Service Unavailable will be sent 
- 
-Context         <Virtualhost> 
-Syntax          CBandExceededURL URL 
-</code> 
-<code> 
-Name            CBandExceededSpeed 
-Description     Specifies maximal speed to which mod_cband slows down a virtualhost when the configured transfer limit is exceeded 
-Context         <Virtualhost> 
-Syntax          CBandExceededSpeed kbps rps max_conn 
-                kbps - maximal transfer speed in kbps or kB/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-NOTE:           This feature is available from version 0.9.6.0 
-</code> 
-<code> 
-Name            CBandScoreboard 
-Description     Specifies virtualhost's scoreboard file 
-Context         <Virtualhost> 
-Syntax          CBandScoreboard path 
-NOTE:           The path must be writeable for the apache-user 
-</code> 
-<code> 
-Name            CBandPeriod 
-Description     Specifies a period after which a virtualhost's usages are cleared 
-Context         <Virtualhost> 
-Syntax          CBandPeriod period 
-                period - available units: S (seconds), M (minutes), H (hours), D (days), W (weeks) 
-Example         CBandPeriod 1W 
-                CBandPeriod 14D 
-                CBandPeriod 60M 
-</code> 
-<code> 
-Name            CBandPeriodSlice 
-Description     Specifies the period slice length 
-Default         slice_len = limit 
-Context         <Virtualhost> 
-Syntax          CBandPeriodSlice slice_length 
-Example         CBandLimit 100G 
-                CBandPeriod 4W 
-                CBandPeriodSlice 1W 
-                A period will be divided into 4 small slices (4W/1W = 4). Each slice has 100G/4=25G  
-                bandwidth limit. After 1W slice limit will be 50G, after 2W will be 75G ... 
-</code> 
-<code> 
-Name            <CBandUser> 
-Description     Define a new cband user 
-Context         Server config 
-Syntax          <CBandUser user_name> 
-</code> 
-<code> 
-Name            CBandUserSpeed 
-Description     Specifies maximal speed for a cband user 
-Context         <CBandUser> 
-Syntax          CBandUserSpeed kbps rps max_conn 
-                kbps - maximal transfer speed in kbps or kB/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-Example         CBandUserSpeed 100kb/s 10 5 
-                Specifies maximal speed 100 kB/s (100 * 1024 bytes per second),  
-                maximal 10 requests per second and 5 open connections 
-NOTE:           This feature is available from version 0.9.6.0 
-</code> 
-<code> 
-Name            CBandUserLimit 
-Description     Specifies bandwidth limit for a cband user 
-Context         <CBandUser> 
-Syntax          CBandUserLimit limit 
-                limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi),  
-                Mi (mebi), Gi (gibi) 
-Example         CBandUserLimit 10M 
-                Specifies 10 * 1000 * 1000 bytes bandwidth quota 
- 
-                CBandUserLimit 10Mi 
-                Specifies 10 * 1024 * 1024 bytes bandwidth quota 
-</code> 
-<code> 
-Name            CBandUserClassLimit 
-Description     Specifies bandwidth limit for a cband user's destination class 
-Context         <CBandUser> 
-Syntax          CBandUserClassLimit class_name limit 
-                class_name - the name of defined class 
-                limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi),  
-                Mi (mebi), Gi (gibi) 
-</code> 
-<code> 
-Name            CBandUserExceededURL 
-Description     Specifies a URL where mod_cband should redirect all requests to user's virtualhost when the  
-                configured transfer limit is exceeded 
- 
-                NOTE: If you don't specify the exceeded URL location then standard 503 Service Unavailable will be sent 
- 
-Context         <CBandUser> 
-Syntax          CBandUserExceededURL URL 
-</code> 
-<code> 
-Name            CBandUserExceededSpeed 
-Description     Specifies maximal speed to which mod_cband slows down user when the configured transfer limit is exceeded 
-NOTE:           CBandUserExceededURL must not be used if you want to only slow down user's pages with  
-                CBandUserExceededSpeed directive 
-Context         <CBandUser> 
-Syntax          CBandUserExceededSpeed kbps rps max_conn 
-                kbps - maximal transfer speed in kbps or kB/s 
-                rps - maximal requests per second 
-                max_conn - maximal number of simultaneous connections 
-NOTE:           This feature is available from version 0.9.6.0 
-</code> 
-<code> 
-Name            CBandUserScoreboard 
-Description     Specifies a user's scoreboard file 
-Context         <CBandUser> 
-Syntax          CBandUserScoreboard path 
-NOTE:           The path must be writeable for the apache-user 
-</code> 
-<code> 
-Name            CBandUserPeriod 
-Description     Specifies a period after which a user's usages are cleared 
-Context         <CBandUser> 
-Syntax          CBandUserPeriod period 
-                period - available units: S (seconds), M (minutes), H (hours), D (days), W (weeks) 
-Example         CBandUserPeriod 1W 
-                CBandUserPeriod 14D 
-                CBandUserPeriod 60M 
-</code> 
-<code> 
-Name            CBandUserPeriodSlice 
-Description     Specifies a period slice length 
-Default         slice_len = limit 
-Context         <CBandUser> 
-Syntax          CBandUserPeriodSlice slice_length 
-Example         CBandUserLimit 100G 
-                CBandUserPeriod 4W 
-                CBandUserPeriodSlice 1W 
-                A period will be divided into 4 small slices (4W/1W = 4). Each slice has 100G/4=25G  
-                bandwidth limit. After 1W slice limit will be 50G, after 2W will be 75G ... 
-</code> 
- 
-==== Status Handler Configuration Example ==== 
- 
-<code apache> 
-To view actual bandwidth limits, usages, users, scoreboards, add the following lines into the config file: 
- 
-<Location /cband-status>  
-SetHandler cband-status 
-</Location>  
- 
-<Location /cband-status-me>  
-SetHandler cband-status-me 
-</Location>  
- 
-Then you can access the status page with a URL like: 
-http://server_name/cband-status 
-http://server_name/cband-status-me 
-</code> 
- 
-<code> 
-In versions >=0.9.5-rc1 you can also view /cband-status handler in the XML format: 
- 
-http://server_name/cband-status?xml 
-http://server_name/cband-status-me?xml 
-</code> 
  
tachtler/apache_http_server_-_mod_cband_-_bandbreitenbeschraenkung.1339413658.txt.gz · Zuletzt geändert: 2012/06/11 13:20 von klaus