Throttling apache downloads selectively
        Posted  
        
            by 
                Synchro
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Synchro
        
        
        
        Published on 2011-01-10T12:23:19Z
        Indexed on 
            2011/01/10
            12:55 UTC
        
        
        Read the original article
        Hit count: 324
        
I have a linux box running Debian Sarge (old I know) and apache 2.0.54. It serves two kinds of files - regular web pages and small images, and a lot of large podcast mp3s. The podcast downloads swamp the connection and make the rest of the site unresponsive, so I'm looking to throttle the data transfer rate (not the request rate) of just the podcasts. I've set up haproxy using this technique which does what it says it will, but solves a different problem - even only 5 simultaneous podcast downloads is enough to saturate the link. In a perfect world, haproxy would support per-connection throttling, but it doesn't. So far I've looked at mod_bw (won't compile for me, seems unsupported), mod_cband (unsupported, widely reported as problematic) and iptables using tc. The iptables approach would allow me to throttle things, but would not be at all selective, slowing down everything on the server, not just the podcasts, so would just move the bottleneck without changing overall behaviour.
Ideas?
© Server Fault or respective owner