Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Mirroring Graphs To Reduce Load

Hybrid View

  1. #1

    Lightbulb Mirroring Graphs To Reduce Load

    Everyone,

    I remember on 11/5 ronpaulgraphs.com got hammered from everyone wanting to look at the charts. I propose people volunteer mirroring.

    I wrote a simple script below that can be run on Unix or cygwin servers. This will download the daily graph every 5 minutes. Nothing fancy. I don't have a server at the moment that I can make public, but others feel free to use it. If you don't have wget you might try curl or lwp-download (perl).

    Please reply with a reply with a URL if you mirror so everyone knows. I propose a sticky.

    Commands to run:

    Code:
    $ nohup ./get_graph.sh &
    $ exit
    Keep in mind this will continue to run in the background until it is killed!! Leave out the nohup if you want it in the foreground.

    ------ script -----
    Code:
    #!/bin/bash
    
    # edit globals to your liking
    
    #PATH=$PATH:/usr/local/bin
    
    URL="http://www.ronpaulgraphs.com/yesterday_vs_today_line.png"
    IMG=`basename $URL`
    PUBLIC_HTML=/home/foobar/public_html
    WGET="wget -q -O $IMG.$$ $URL"
    CURL="curl -so $IMG.$$ $URL"
    
    cd $PUBLIC_HTML
    
    while [ 1 -eq 1 ]; do
    
            $WGET && mv $IMG.$$ $IMG || rm $IMG.$$ 2>/dev/null
    
            sleep 300
    done
    -- end

    PS: Maybe someone could attach some html that will refresh this image every 5 minutes.

    Edit: Added curl and error correction for wget/curl
    Last edited by Ronin; 12-15-2007 at 11:45 AM.



  • #2

    Default

    Unfortunately, I think if I was to mirror, my poor site would use up all its bandwidth in an hour.

    Great idea though, with some caveats:
    More people have curl than wget installed, so you might want to provide a script for that.
    Don't alter other people's paths, it's impolite. If a Unix admin is installing this, they know where their own curl or wget is (even if they don't know how to use it) and can modify the script accordingly.
    Ambassador from The Wordforge

  • #3

    Default

    Don't forget http://paulcash.slact.net/ !

    That's where I ended up going on 11/5 when http://www.ronpaulgraphs.com/ was overloaded...

  • #4

    Default

    I have a small VPS I purchased to test things, I may try to get this up and running. THANKS!

  • #5

    Default

    Quote Originally Posted by Kacela View Post
    Don't forget http://paulcash.slact.net/ !

    That's where I ended up going on 11/5 when http://www.ronpaulgraphs.com/ was overloaded...
    Personally, I like paulcash better for monitoring one day's donations. I like ronpaulgraphs for looking at trends over time.

  • #6

    Default

    I just added the official widget and paulcash mirror too. Can't be too safe

    Mirror here: http://ronpaul.xnamatrix.com/

  • #7

    Default

    You can also download the firefox extension widget to monitor the donations.

    http://ok4ronpaul.ashlux.com/wiki/in...efox_Extension

  • #8

    Default

    Hi, I've set up a mirror here: http://ronpaul.xnamatrix.com/

    Got plenty of bandwidth to spare I used crontab instead of a script since I'm not sure if my host allows stray processes running around.

  • #9

    Default

    I'm setting up a mirror right now.

    Maybe we should let Dan know once we have a few mirrors ready so that he can do round-robin dns for the main domain name. I'll post an update when I have a url ready.

    -Paul

  • #10

    Default

    g'day. i'm the guy that runs paulcash. I've tested it through and through, and I'm 95% confident that i will have absolutely no trouble coping with the traffic.
    paulcash.slact.net
    donation graphs, rates, stats

  • Page 1 of 3 123 LastLast

    Posting Permissions

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