How can I detect and survive being “Slashdotted”?

前端 未结 24 1863
半阙折子戏
半阙折子戏 2021-01-29 21:19

What\'s a good way to survive abnormally high traffic spikes?

My thought is that at some trigger, my website should temporarily switch into a \"low bandwidth\" mode: swi

24条回答
  •  暖寄归人
    2021-01-29 21:51

    I rewrite all URLs referred by several popular sites to be redirected through the coralCDN.

    An example for Apache:

    
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_USER_AGENT} !^Googlebot
    RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
    RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?digg\.com [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?slashdot\.org [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?slashdot\.com [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?fark\.com [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?somethingawful\.com [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?kuro5hin\.org [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?engadget\.com [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?boingboing\.net [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?del\.icio\.us [OR]
    RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?delicious\.com
    RewriteRule ^(.*)?$ http://example.com.nyud.net/$1 [R,L]
    
    

提交回复
热议问题