The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon Module: mod_bandwidth

Discussion in 'cPanel Developers' started by cPanelBilly, Sep 23, 2004.

  1. cPanelBilly

    cPanelBilly Guest

    What is Mod_Bandwidth?
    How do I enable it for a domain
    In root shell type: /scripts/setbwlimit then follow the instructions (remember you are setting the limit based on bytes per second so 1024 = 1kb sec and that is to all users)

    Where can I read more about it?
    http://www.cohprog.com/mod_bandwidth.html
     
  2. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Hi.

    Can this be done from WHM ... perhaps a Feature Request. Long back i had been on WireX Immunix and their control panel had this feature of defining/editing the Bandwidth Limits during Account Setup/Editing Later on.

    If this could be done as a Part of Account Functions, in WHM, it would be good.

    Anup
     
  3. cPanelBilly

    cPanelBilly Guest

    That is already being coded.
     
  4. DomineauX

    DomineauX Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    414
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Great Idea! Very useful
     
  5. hfweb

    hfweb Registered

    Joined:
    Apr 30, 2004
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    how do i limit maximum sconnections of an ip with this, these download managers are killing me!
     
  6. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    See if mod_throttle can be of any help...

    http://www.snert.com/Software/mod_throttle/

    Anup
     
    #6 anup123, Oct 10, 2004
    Last edited: Oct 10, 2004
  7. kalnet4u

    kalnet4u Member

    Joined:
    Jul 8, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Plymouth, UK
    I have installed the bandwidth module, which went smoothly. I also went in to SSH and followed the instructions.

    I also, just to make sure everything is ok, restarted apache for good luck and touched wood (yes I am a novice, lol)

    I can see the entries added into httpd.conf, it looks ok? I have tried it on a shared IP domain and also a dedicated IP domain. I have restarted apache several times.

    IT DOES NOT WORK!

    Please can someone tell me what is going wrong.

    Many Thanks
    Kev
     
  8. cPanelBilly

    cPanelBilly Guest

    Please expalin what you mean, We have done test showing it does work internally, but if there is an issue I need a way to replicate it.
     
  9. kalnet4u

    kalnet4u Member

    Joined:
    Jul 8, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Plymouth, UK
    Hi,

    I installed it through “Addon Modules” in WHM.

    I received the successful installed messages, telling me to go in to SSH to enable it on domains.

    Went in to SSH, typed in the command. Was requested for the domain name, entered it, then the speed, I typed in 1024, to ensure I would notice a BIG difference.
    Confirmation message saying it had been added.

    Tried the domain, still as fast as before, well over 1k. I tried restarting Apache, still the same result. I also tried it on another domain, however with the same result, absolutely no reduction in speed.

    I looked in HTTPD.CONF, new entries had been entered in for the domains and for the module. I have no idea what I am doing wrong, I have followed the instructions carefully.

    Many thanks for your help.

    Warm Regards
    Kevin
     
  10. kalnet4u

    kalnet4u Member

    Joined:
    Jul 8, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Plymouth, UK
    Hi,

    Before I start messing with the system again, could it be that because I have GZip compression installed (through apache Upgrade in WHM), it is somehow disabling its affects?

    Thanks
     
  11. kalnet4u

    kalnet4u Member

    Joined:
    Jul 8, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Plymouth, UK
    Hi Everyone,

    Many of you now probably think I am mad, seemingly having a conversation with myself, since CPanel now seem to have gone quiet. However this may not have been in vain, since I have solved the problem.

    chown nobody:nobody -R /var/cpanel/apachebw

    All I needed to do is type the command in above, simple! A permission error!

    I also needed to make a couple of amendments in httpd.conf also, to make it work. The first being the addition of “BandWidthModule On”.

    Also the auto set-up script of bandwidth seems to add the wrong code. It does indeed add some code just before the </virtualhost>, however it doesn’t do anything. Anyway I am manually adding in the restrictions for the time being, only being a couple of accounts, not a huge problem.

    Some of you may find this guide an interesting read too, this is what helped me solve my problem.

    http://www.crucialparadigm.com/reso...mod_bandwidth-apache-untilization-control.php

    CPanel, if you want an in depth guide to what went wrong, please do not hesitate to e-mail me.
     
  12. cPanelBilly

    cPanelBilly Guest

    Thanks for the fix, it is still beta and issues can arrise :)
    This is actually already in the install script, do you know what the permissions were before?
    btw we were not ignoring you, all development staff had to work on an exploit that was released to the public before released to us.
     
  13. stratagem

    stratagem Member

    Joined:
    Jul 10, 2003
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Tried installing it an hour ago.
    - The shell script does not add 'BandWidthModule On'
    - The proper directories are added, and referenced in httpd.conf, but have root ownership

    Inserting the mentioned directive per virtual host and setting the ownership of the temp dir to nobody gets things running. You can also just turn it on outside a virtual host and it stays on.
    - Needs a(n easy) method of setting a redirect page when max connections are reached.
    - Easy to work around, from an account holder view, without further apache restrictions

    whm v9.9.3, cp v9.9.6r10, mod_bandwidth addon v2.0.4-0.7
     
  14. Norman

    Norman Well-Known Member

    Joined:
    Sep 20, 2004
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    6
    Billy,

    Here are what my perms were before chowning them as stated above:
    Code:
    drwxr-xr-x    4 root     root         4.0K Sep 27 10:39 apachebw/
     
  15. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    Have these problems been ironed out?
     
  16. EDevil

    EDevil Member

    Joined:
    Feb 17, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Last time I checked, no. The dir was still created with the wrong permissions.

    This was about 2 weeks ago.
     
  17. bmuthig

    bmuthig Member
    PartnerNOC

    Joined:
    Feb 15, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, MI
    cPanel Access Level:
    DataCenter Provider
    Script is still broken... EXAMPLE USAGE INCLUDED!

    FYI to anybody looking for this. The script still seems broken. Would suggest adding manually ... for example within the virthost you want to put in:

    <IfModule mod_bandwidth.c>
    BandWidthModule On
    <Directory "/home/xxxxxx/public_html">
    # BandWidth all 30720
    LargeFileLimit 1024 61440
    </Directory>
    </IfModule>

    http://www.cohprog.com/v3/bandwidth/doc-en.html

    For all the options...

    LargeFileLimit is a good one to keep people from sucking all the bandwidth when people are downloading huge files.... I DID notice though the LargeFileLimit bandwidth rate seems to be only about half of what you put there. I had to compensate to get it to work right. Not sure why... pipe in if you know!
     
  18. kalnet4u

    kalnet4u Member

    Joined:
    Jul 8, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Plymouth, UK
    Hi bmuthig,

    We have had exactly the same problems with the bandwidth acting strangely. Although we compensated to begin with, you will find if you start two downloads going at the same time, it will complete throw that theory right out of the window.

    We added the “BandWidthPulse” command, set to 1 second, this seems to have solved the problem.

    <IfModule mod_bandwidth.c>
    <Directory /home/xxxxxxxx/public_html>
    BandWidthModule On
    BandWidth all 30720
    BandWidthPulse 1000000
    </Directory>
    </IfModule>

    Bye!
     
  19. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    nope, not yet.
     
  20. quadrahost

    quadrahost Active Member

    Joined:
    Jul 17, 2003
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    I am having the same issue and will try the temp fix tonight. Thanks
     
Loading...

Share This Page