{"id":898,"date":"2012-08-02T15:42:01","date_gmt":"2012-08-02T07:42:01","guid":{"rendered":"http:\/\/rmohan.com\/?p=898"},"modified":"2012-08-02T15:43:57","modified_gmt":"2012-08-02T07:43:57","slug":"mod_cband-apache-2-module-of-the-traffic-control-like-mod_throttle-mod_bandwidth-usage","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=898","title":{"rendered":"mod_cband (Apache 2 module of the traffic control like mod_throttle &#038; mod_bandwidth) usage"},"content":{"rendered":"<p>As in the past to apache 1 mod_throttle gasanghoseuteubyeol the measure and limit traffic was possible.<br \/>\nLimiting the traffic to the hosting is required. Used in any domain that<br \/>\nKnowing very important job. But,<br \/>\napache2 could only give this guy writes. Is search. cband found.<br \/>\nmod_throttle and function and the structure and almost identical, mod_bandwidth including the functions of, and<br \/>\nContinued performance improvements have been developed recently was becoming.<br \/>\nThan flattering,? Xml glue that, if data are available in the form of xml,<br \/>\nFor hosting a really good module.<br \/>\n[Note] cband the apache 2 module. is not easy apache 1.3.XX 1.3.XX mod_throttle use!<\/p>\n<p>[Feature]<br \/>\n* Apache2 module for traffic restrictions Lightweight<br \/>\n* Per-user bandwidth limit<br \/>\n* Gasanghoseuteubyeol bandwidth limit<br \/>\n* The purpose-specific bandwidth limit<br \/>\n* Limit:<br \/>\nAll user bandwidth limit o<br \/>\no limit download sokje<br \/>\no Fresh water limit requests per second<br \/>\no IP vs. Small Areas limit<br \/>\n* Support for virtualhosts<br \/>\n* Support for defined users<br \/>\n* Limit the results confirm a Web-based (\/ cband-status)<br \/>\n* Check the results for each user limit (\/ cband-status-me)<\/p>\n<p>A. How to Install<br \/>\ncd \/ usr \/ local<br \/>\nwget http:\/\/cband.linux.pl\/download\/mod-cband-0.9.7.4.tgz<br \/>\ntar xvfpz mod-cband-0.9.7.4.tgz<br \/>\ncd mod-cband-0.9.7.4<br \/>\n. \/ Configure &#8211; with-apxs = \/ usr \/ local \/ apache \/ bin \/ apxs<br \/>\n# # Option Description<br \/>\n# # &#8211; With-apxs = \/ usr \/ local \/ apache \/ bin \/ apxs: apache apxs to specify the path.<br \/>\nmake<br \/>\nmake install<\/p>\n<p>Two. Verifying the Installation<br \/>\n&#8211; Httpd.conf file<br \/>\nLoadModule cband_module modules \/ mod_cband.so<br \/>\nYou can see that the added lines.<br \/>\n&#8211; Apache \/ modules directory<br \/>\nmod_cband.so<br \/>\nYou can see what files are added.<\/p>\n<p>Three. The default setting<\/p>\n<p>====================================<br \/>\n&lt;Location \/cband-status&gt;<br \/>\nSetHandler cband-status<br \/>\nOrder deny, allow<br \/>\nDeny from all<br \/>\nAllow from IP to open up<br \/>\n&lt;\/ Location&gt;<\/p>\n<p>&lt;Location \/cband-status-me&gt;<br \/>\nSetHandler cband-status-me<br \/>\n&lt;\/ Location&gt;<\/p>\n<p>&lt;VirtualHost *&gt;<br \/>\nServerName gnux.co.kr<br \/>\nDocument \/ home \/ gnux \/ www<br \/>\nCBandLimit 300Mi<br \/>\nCBandPeriod 1D<br \/>\nCBandExceededURL http:\/\/manager.gnux.co.kr\/traffic_exceeded.html<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n======================================<br \/>\nThe configuration file in the domain of gnux.co.kr<br \/>\nDay, 300M (300 * 1024 * 1024byte) is set to provide the traffic.<br \/>\nIn terms of as a bit, 2.4Gbit \/ is to provide a traffic.<br \/>\nIf you exceed 300M in one day, &#8220;http:\/\/manager.gnux.co.kr\/traffic_exceeded.html&#8221;<br \/>\nPop up page, if you did not give 503 error page will appear.<br \/>\nYou! If you want to without restriction in infants, CBandPeriod like portion is deleted.<\/p>\n<p>Four. Contextual Setting<br \/>\n1) Media Speed Limit<br \/>\n==============================<br \/>\n&lt;VirtualHost *&gt;<br \/>\nServerName rmohan.com<br \/>\nDocument \/ home \/ gnux \/ file<br \/>\nCBandSpeed 1024 10 30<br \/>\nCBandRemoteSpeed 20kb \/ s 3 30<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n==============================<br \/>\nFile rmohan.com above settings for the domain<br \/>\nSpeed is limited to 1024kbps, and 10 times per second connection,<br \/>\nAn example of concurrent users is limited to 30.<\/p>\n<p>2) provide users and ilteuraepik yeongyeolsu limit is exceeded.<br \/>\n==============================<br \/>\n&lt;VirtualHost *&gt;<br \/>\nServerName\u00a0 rmohan.com<br \/>\nDocument \/ home \/ gnux \/ doly<br \/>\nCBandLimit 100Mi<br \/>\nCBandExceededSpeed 128 5 15<br \/>\nCBandPeriod 1D<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n==============================<br \/>\nrmohan.com\u00a0 above settings for a domain<br \/>\nDay of 100Mbyte provide traffic and<br \/>\nIf the second 100M,<br \/>\nLimited to 128bps rate, five times per second connection,<br \/>\nAn example of concurrent users is limited to 15.<\/p>\n<p>3) If a user has multiple domains?<br \/>\n==============================<br \/>\n&lt;CBandUser Host_user1&gt;<br \/>\nCBandUserLimit 100Mi<br \/>\nCBandUserPeriod 1D<br \/>\n&lt;\/ CBandUser&gt;<br \/>\n&lt;VirtualHost *&gt;<br \/>\nServerName rmohan.com<br \/>\nDocument \/ home\/host_user1\/aaa<br \/>\nCBandUser host_user1<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n&lt;VirtualHost *&gt;<br \/>\nServerName rmohan.com<br \/>\nDocument \/ home\/host_user1\/bbb<br \/>\nCBandUser host_user1<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n==============================<br \/>\nSet of virtual users to specify that the host_user1 a following.<br \/>\nThe user is enables the use of a day 100Mbyte.<br \/>\nThen, aaa.co.kr, bbb.co.kr all of host_user1<br \/>\nTraffic has been set to use.<\/p>\n<p>4) IP range, depending on if you want to limit the speed?<br \/>\n==============================================<br \/>\n&lt;CBandClass Class_1&gt;<br \/>\nCBandClassDst 192.168.0.0\/24<br \/>\n&lt;\/ CBandClass&gt;<br \/>\n&lt;CBandClass Class_2&gt;<br \/>\nCBandClassDst 222.97.189.0\/24<br \/>\n&lt;\/ CBandClass&gt;<\/p>\n<p>&lt;VirtualHost *&gt;<br \/>\nServerName rmohan.com<br \/>\nDocument \/ home \/ gnux \/ intranet<br \/>\nCBandClassRemoteSpeed class_1 50Mbps 10 30<br \/>\nCBandClassRemoteSpeed class_2 300kbps 10 30<br \/>\n&lt;\/ VirtualHost&gt;<br \/>\n==============================================<br \/>\nFor the above configuration, the internal IP 192.168.0.XXX, in<br \/>\nThe bandwidth of 50Mbps, and 10 times per second the request, a setting of 30 concurrent users, and<br \/>\nIn a different ip range 222.97.189.XXX<br \/>\n300kpbs, one request per second, 30 sets of concurrent users.<\/p>\n<p>5 Check usage.<br \/>\nhttp:\/\/ domain \/ cband-status<br \/>\nhttp:\/\/ domain \/ cband-status-me<\/p>\n<p>6. Indicators and unit description (if applicable huge!)<\/p>\n<div id=\"gt-c\">\n<div id=\"gt-form-c\">\n<form id=\"gt-form\" action=\"\" method=\"post\" name=\"text_form\" enctype=\"application\/x-www-form-urlencoded\" target=\"\">\n<div id=\"gt-text-all\">\n<div id=\"gt-text-c\">\n<div id=\"gt-res-c\">\n<div id=\"gt-res-p\">\n<div id=\"gt-res-data\">\n<div id=\"gt-res-wrap\">\n<div id=\"gt-res-content\">\n<div dir=\"ltr\">\u00a0\u00a01) unit.<br \/>\n* Transfer speed unit<br \/>\no kbps, Mbps, Gbps &#8211; bits per second: 1024, 1024 * 1024, 1024 * 1024 * 1024 bps<br \/>\no kb \/ s, Mb \/ s, Gb \/ s &#8211; bytes per second: 1024, 1024 * 1024, 1024 * 1024 * 1024 b \/ s<br \/>\no Default: kbps<\/p>\n<p>* Traffic quota units<br \/>\no K, M, G &#8211; bytes: 1000, 1000 * 1000, 1000 * 1000 * 1000 bytes<br \/>\no Ki, Mi, Gi &#8211; bytes: 1024, 1024 * 1024, 1024 * 1024 * 1024 bytes<br \/>\no base: K<\/p>\n<p>* Time (period), the unit<br \/>\no S, M, H, D, W &#8211; seconds, minutes, hours, days, weeks<br \/>\no Default: S<\/p>\n<p>2) Directives<br \/>\n(1) Name: CBandDefaultExceededURL<br \/>\nDescription: When limit is exceeded, show URL (If you do not specify the error page 503)<br \/>\nContext: Server config<br \/>\nGrammar: CBandDefaultExceededURL URL<\/p>\n<p>(2) Name: CBandDefaultExceededCode<br \/>\nDescription: show an error code when the limit has been exceeded<br \/>\nContext: Server config<br \/>\nGrammar: CBandDefaultExceededCode HTTP_CODE<br \/>\nExample: CBandDefaultExceededCode 509<\/p>\n<p>(3) Name: CBandScoreFlushPeriod<br \/>\nDescription: scoreboard file record number of requests, mod_cband affects performance.<br \/>\nDefault: 1<br \/>\nContext: Server config<br \/>\nGrammar: CBandScoreFlushPeriod number of requests<br \/>\nExample: CBandScoreFlushPeriod 100 (one request every scoreboard every 100 records on file)<\/p>\n<p>(4) Name: CBandSpeed<br \/>\nDescription: The maximum speed of the virtual host domain, the number of requests, number of connections set<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandSpeed kbps rps max_conn<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<br \/>\nExample: CBandSpeed 1024 10 30<br \/>\nThe maximum transfer rate is limited to 1024kbps, handle 10 requests per second, a limit of 30 simultaneous connections.<\/p>\n<p>(5) Name: CBandRemoteSpeed<br \/>\nDescription: The visitor (IP) of the maximum speed, number of requests, number of connections limit (CBandSpeed and similar, but per-connection settings)<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandRemoteSpeed kbps rps max_conn<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<br \/>\nExample: CBandRemoteSpeed 20kb \/ s 3 3<br \/>\nSplice (ip) advised on the maximum 20kb \/ s, 3 requests per second, limited to 3 simultaneous connections.<\/p>\n<p>(6) Name: CBandClassRemoteSpeed<br \/>\nExplanation: The defined class (ip ranges) for the maximum speed, number of requests, number of connections limit<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandClassRemoteSpeed class_name kbps rps<br \/>\nclass_name &#8211; class name is already defined (IP range)<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<br \/>\nExample: &lt;CBandClass googlebot_class&gt;<br \/>\nCBandClassDst 66.249.64\/24<br \/>\nCBandClassDst 66.249.65\/24<br \/>\nCBandClassDst 66.249.79\/24<br \/>\n&lt;\/ CBandClass&gt;<br \/>\nCBandClassRemoteSpeed googlebot_class 20kb \/ s 2 3<br \/>\nClass defined above (googlebot_class) The request of 20kb \/ s transfer rate,<br \/>\nThree requests per second, limited to three simultaneous connections.<\/p>\n<p>(7) Name: CBandRandomPulse<br \/>\nDescription: The speed limit in order to generate arbitrary waveforms, the following is how to handle the processing of mod_cband.<br \/>\nWhen there are too many men is the Auto Off.<br \/>\nContext: Global<br \/>\nGrammar: CBandRandomPulse On \/ Off<\/p>\n<p>(8) Name: CBandLimit<br \/>\nDescription: Sets the limit throughput. (The period set in the CBandPeriod)<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandLimit limit<br \/>\nlimit &#8211; throughput, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)<br \/>\nExample: CBandLimit 10M<br \/>\nTransfer the amount of 10M (10 * 1000 * 1000bytes) is limited to.<br \/>\nCBandLimit 10Mi<br \/>\nTransfer the amount of 10M (10 * 1024 * 1024bytes) is limited to.<\/p>\n<p>(9) Name: CBandClassLimit<br \/>\nExplanation: The defined class (ip ranges) throughput for a set limit.<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandClassLimit class_name limit<br \/>\nclass_name &#8211; class name is already defined (ip ranges)<br \/>\nlimit &#8211; throughput, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)<\/p>\n<p>(10) Name: CBandExceededURL<br \/>\nDescription: The limit has been exceeded during show URL, if you do not specify a 503 error (virtual host).<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandExceededURL URL<\/p>\n<p>(11) Name: CBandExceededSpeed<br \/>\nDescription: The transfer would exceed the amount of time, transfer rate limiting.<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandExceededSpeed kbps rps max_conn<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<\/p>\n<p>(12) Name: CBandScoreboard<br \/>\nDescription: Specifies the virtual host of the scoreboard file. (Required for better performance)<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandScoreboard path<br \/>\n(Path of the Apache (nobody or apache) authority must be writable)<\/p>\n<p>(13) Name: CBandPeriod<br \/>\nDescription: The capacity limitations period (After this period, which was measured capacity is cleared.)<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandPeriod period<br \/>\nperiod &#8211; use the units: S (seconds), M (minute), H (hour), D (a), W (weeks)<br \/>\nExample: CBandPeriod 1W (1 Sunday)<br \/>\nCBandPeriod 14D (14 days)<br \/>\nCBandPeriod 60M (60 minutes)<\/p>\n<p>(14) Name: CBandPeriodSlice<br \/>\nDescription: The period gilttae shall specify the period of the share.<br \/>\nDefaults: slice_len = limit<br \/>\nContext: &lt;Virtualhost&gt;<br \/>\nGrammar: CBandPeriodSlice slice_length<br \/>\nExample: CBandLimit 100G<br \/>\nCBandPeriod 4W<br \/>\nCBandPeriodSlice 1W<br \/>\nWhich is divided into four units per week (4W\/1W = 4). Capacity of 100G \/ 4 = 25G<br \/>\n1 week, 25G, 2 weeks, this split is processed 50G.<\/p>\n<p>(15) Name: &lt;CBandUser&gt;<br \/>\nDescription: A new set of virtual users cband<br \/>\nContext: Server config<br \/>\nGrammar: &lt;CBandUser user_name&gt;<\/p>\n<p>(16) Name: CBandUserSpeed<br \/>\nDescription: cband virtual user&#8217;s speed, the number of requests, limiting the number of simultaneous connections<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserSpeed kbps rps max_conn<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<br \/>\nExample: CBandUserSpeed 100kb \/ s 10 5<\/p>\n<p>(17) Name: CBandUserLimit<br \/>\nDescription: cband jeosong capacity limitations of virtual users.<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserLimit limit<br \/>\nlimit &#8211; use the capacity, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)<br \/>\nExample: CBandUserLimit 10M<br \/>\nCBandUserLimit 10Mi<\/p>\n<p>(18) Name: CBandUserClassLimit<br \/>\nDescription: cband virtual user-defined class (ip ranges) throughput limit set for<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserClassLimit class_name limit<br \/>\nclass_name &#8211; the specified class (IP range) Name<br \/>\nlimit &#8211; use the capacity, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)<\/p>\n<p>(19) Name: CBandUserExceededURL<br \/>\nDescription: cband virtual users, to show the limit has been exceeded at URL,<br \/>\nIf you do not specify a 503 error (virtual host).<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserExceededURL URL<\/p>\n<p>(20) Name: CBandUserExceededSpeed<br \/>\nDescription: cband virtual users, would exceed the amount of transmission time, transmission rate limiting.<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserExceededSpeed kbps rps max_conn<br \/>\nkbps &#8211; maximum transfer rate per second<br \/>\nrps &#8211; the maximum number of requests per second<br \/>\nmax_conn &#8211; the maximum number of simultaneous connections<\/p>\n<p>(21) Name: CBandUserScoreboard<br \/>\nDescription: cband virtual users, scoreboard file specification.<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserScoreboard path<br \/>\n(Path of the Apache (nobody or apache) authority must be writable)<\/p>\n<p>(22) Name: CBandUserPeriod<br \/>\nDescription: cband virtual users, capacity limitations period (After this period, which was measured capacity is cleared.)<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserPeriod period<br \/>\nperiod &#8211; use the units: S (seconds), M (minute), H (hour), D (a), W (weeks)<br \/>\nExample: CBandUserPeriod 1W<br \/>\nCBandUserPeriod 14D<br \/>\nCBandUserPeriod 60M<\/p>\n<p>(23) Name: CBandUserPeriodSlice<br \/>\nDescription: cband virtual users, the period stated period divided<br \/>\nDefaults: slice_len = limit<br \/>\nContext: &lt;CBandUser&gt;<br \/>\nGrammar: CBandUserPeriodSlice slice_length<br \/>\nExample: CBandUserLimit 100G<br \/>\nCBandUserPeriod 4W<br \/>\nCBandUserPeriodSlice 1W<br \/>\nWhich is divided into four units per week (4W\/1W = 4). Capacity of 100G \/ 4 = 25G<br \/>\n1 week, 25G, 2 weeks, this split is processed 50G.<\/p>\n<p>7 Enough.<br \/>\nThis is the latest version of the current mod_cband installation and operation, detailed description of the directive is the end of the course.<br \/>\nWhen first discovered, this module gippeotgo so too, has been tested by applying it.<br \/>\nIn particular, it can extract the data to xml processing as it was very, very convenient.<br \/>\nYet excesses in the domestic mod_cband course many people do not have<\/p>\n<p><strong># # See the document<\/strong><br \/>\nhttp:\/\/cband.linux.pl<br \/>\nhttp:\/\/www.howtoforge.com\/mod_cband_apache2_bandwidth_quota_throttling<\/div>\n<\/div>\n<\/div>\n<div id=\"gt-ft-res\">New! Click the words above to edit and view alternate translations.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/form>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>As in the past to apache 1 mod_throttle gasanghoseuteubyeol the measure and limit traffic was possible. Limiting the traffic to the hosting is required. Used in any domain that Knowing very important job. But, apache2 could only give this guy writes. Is search. cband found. mod_throttle and function and the structure and almost identical, mod_bandwidth [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/898"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=898"}],"version-history":[{"count":3,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/898\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/898\/revisions\/900"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}