Find the answer to your Linux question:
Results 1 to 5 of 5
Hello everybody, I need to slow considerably down (I plan to something like 56 kbps download speed) a connection with a certain website at a certain time of the day. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    60

    Question Slow down connection speed with a website at a certain time of the day


    Hello everybody,

    I need to slow considerably down (I plan to something like 56 kbps download speed) a connection with a certain website at a certain time of the day. My objective is to discourage the user to browse that website at that period of time. Not to show that the website is not available, no. I want to let the user to navigate in this website, but restrict speed to discourage the use of it.

    For example, slow down the connection with http://www.website.com at 4 am to something like 48 or 56 kbps. And then at 11 am let it flow at the normal speed of the network.

    Graphic:

    4:00 - 11:00 am = connection with http://www.website.com - down speed: 56 kbps.
    rest of the day = connection with http://www.website.com - down speed: normal network speed, unblocked.


    Is this possible to do easily? Will I need to create a complex script (what I'm not capable of) for this? or will any available programs for Linux (I use Ubuntu 10.04 on this computer) help me?

    Sorry for my ignorance, and thank you very much in advance.

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    This is how I found out how this can be done:

    LMGT4U

    However, there are lots of different tools around that more or less do the same:

    apache2 - Apache rate limiting options - Stack Overflow

    .. but as far as I looked into them none implements a bandwidth management based on time scheduling. So maybe you need to make your hands dirty and implement it yourself based on the ideas and work of others. I would start with the source of http://bwmod.sourceforge.net/# and extend it to your needs.

    BTW: are you really sure slow speed is reason enough for users to not browse to your website? What does it change for you if people download your website slowly? Isn't it dangerous for you because most users will start to query your website multiple times and in fact increasing bandwidth with simultaneous requests?

    If a website is slow for me, I would never think of retrying later since I don't know if the server is down or worse. I am in the opinion that transparency is much wiser in every situation. People have brains and they use them every day! That said I believe that if you have a reason that users shouldn't browse your website during a given period of time it would be much wiser to tell them: "hey, this website is down for maintainance every day from 4AM to 5AM UTC, we're sorry to inconvenience You and would like to see You coming by later. Are you unhappy with this? Please read the FAQ or send an email to the administrator." This way they know what's going on and they know that someone has good reasons for testing their patience and they can give you a productive feedback.

    Cheers
    Last edited by Kloschüssel; 02-27-2012 at 08:20 AM.

  3. #3
    Just Joined!
    Join Date
    Feb 2007
    Posts
    60
    Hi Kloschüssel, thank you for trying to help me.

    You misunderstood me completely. I don't own this website. On the contrary, the fact is that there's a kid in my house, and I want to discourage him to use facebook after 4 am.

    Maybe I didn't explain it clear enough. I hope you can understand it now.

    Thank you very much.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Google linux bandwidth throttling. There you should be able to find what your are looking for.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Quote Originally Posted by tauro_kpo View Post
    [...] there's a kid in my house, and I want to discourage him to use facebook after 4 am. [...]
    I assumed your question was kind of work related and this explanation makes your question a lot clearer.

    Does the kid have its own computer? If yes, I would do:

    1] Set up a linux router that handles your house networking
    There are cheap devices like the N16 with a hell lot of good hardware in it. They can be flashed with a linux router firmware like openwrt.

    2] Configure the router DHCP to reuse the same ip address on the MAC address of the kids laptop.

    3] Lets say, the kids laptop is now always assigned the same IP address 192.168.1.200, then you are able to shape its entire inbound and outbound traffic on the router with a script like Traffic Shaping, Bandwidth Shaping, Packet Shaping with Linux tc htb

    4] Since that script can be set up as a startup job you will be able to start and stop it with "/etc/init.d/traffic_shape_kid start|stop". By setting up two cronjobs that invoke exactly that command you are able to schedule when shaping should be enabled. i.e. something like:

    Code:
    $ crontab -e
    # m h  dom mon dow   command
    # start traffic shaping at 4PM
    0 16     *       *       *       /etc/init.d/traffic_shape_kid start
    # stop traffic shaping at 8AM
    0 8     *       *       *       /etc/init.d/traffic_shape_kid stop
    Cheers

    PS: If you wanted to block some content (i.e. adult pages, ..), you could additionally set up squid as a transparent proxy on your router device. You should be able to google that up easily.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •