Online Test of blog site CDN speed

Source: Internet
Author: User

Recently, it was found that the attachment download speed of the blog garden is much faster. It is said that the website has been migrated to the new IDC. So I wrote a little stuff to test the download speed of a single thread.

  

 

After one night, share the test result-the CDN bandwidth seems not cheap ~~ We will not waste so much in the future :)

Everyone is interested in testing to see how fast it is.

You can also test static resources of other websites, but they must be JPG, PNG, GIF, and SwF resource files.

Because it is downloaded through a single connection, fewer bytes are transferred at the moment of sending/responding to the request, so select a large file as much as possible.

The test script is very simple. paste it by the way ~

VaR TXT: textfield = new textfield (); var Loader: loader = new loader (); var Timer: timer = new timer (1000); var NF: numberformatter = new numberformatter (localeid. default); NF. fractionaldigits = 0; var lastdlbytes: int; var curdlbytes: int; var totaldlbytes: int; var running: Boolean; var sec: int; var sum: Number = 0; Init (); function Init (): void {security. allowdomain ("*"); stage. align = stagealign. top_left; stage. Scalemode = stagescalemode. no_scale; loader. contentloaderinfo. addeventlistener (progressevent. progress, onprogress); loader. contentloaderinfo. addeventlistener (ioerrorevent. io_error, onerror); loader. contentloaderinfo. addeventlistener (event. complete, oncomplete); timer. addeventlistener (timerevent. timer, ontimer);} function ontimer (E: Event): void {var secbytes: Int = curdlbytes-lastdlbytes; lastdlb Ytes = curdlbytes; sum + = secbytes; SEC ++; txtspeed. TEXT = int (secbytes/1024) + "kb/s (current)" + "/" + int (sum/SEC/1024) + "kb/s (average )"; txtinfo. TEXT = NF. formatnumber (SUM) + "Byte @" + sec + "second";} function onprogress (E: progressevent): void {curdlbytes = E. bytesloaded; If (curdlbytes/e. bytestotal> 0.95) {reload () ;}} function onerror (E: ioerrorevent): void {trace ("onerror"); reload ();} f Unction oncomplete (E: Event): void {trace ("oncomplete"); reload ();} function reload (): void {var URL: String = txturl. Text + "? V = "+ int (1e6 * Math. random (); trace (URL); curdlbytes = lastdlbytes = 0; loader. load (New URLRequest (URL);} mctoggle. gotoandstop (1); mctoggle. addeventlistener (mouseevent. click, function () {running =! Running; mctoggle. gotoandstop (running? 2: 1); If (running) {timer. Start (); reload () ;}else {timer. Stop ();}});

To prevent the downloaded data from being cached in the local hard disk, It is interrupted at around 95% and the download starts again (it seems that some browsers are still cached and are not carefully tested ).

It can be seen that CDN that supports external links still has some security risks.

Attackers can find some large image files embedded in forums or emails. When pages embedded with these resources are opened, traffic is also consumed.

It is easier to have a large number of controllable slave hosts, because HTTP refer can be forged, so the external chain is not easy to prevent.

In simple calculations, if there are only 1000 controllable computers with an average speed of KB, MB of traffic can be consumed per second and GB of traffic can be consumed per hour! If the traffic is charged, the attack can also cause great losses.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.