How to send traffic to CloudFront host using tsung

110 Views Asked by At

How to send traffic to CloudFront host using tsung? Tsung mandates port number for sending traffic, but CloudFront doesn't have one. If we using host:port to send traffic, CloudFront is rejecting that traffic.

1

There are 1 best solutions below

0
z5ottu On

I have a working tsung config for CloudFront traffic test. (Tsung version 1.6.1_git) I hope this will help you. But keep in mind that CloudFront has advanced DDoS protection.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info" dumptraffic="true">
    <clients>
        <client host="t1" maxusers="5000" cpu="4">
        </client>
    </clients>

    <servers>
        <server host="[YOUR.CF.SUBDOMAIN].cloudfront.net" port="80" type="tcp"></server>
    </servers>

     <load>
         <arrivalphase phase="1" duration="10" unit="second">
             <users interarrival="1" unit="second"></users>
         </arrivalphase>
     </load>

    <sessions>
        <session name='cloudfront' probability='100'  type='ts_http'>
            <request>
                <http url='/65.png' version='1.1' method='GET' />
            </request>
        </session>
    </sessions>
</tsung>

You need an ip record in your host file. t1 in this case.
(Unix: /etc/hosts, MS: windows/system32/drivers/etc/host)

[YOU_IP_ADDRESS]    t1