varnish configuration sample

backend master {
   set backend.host = "Primary server IP";
   set backend.port = "80";
}

backend slave {
   set backend.host = "Slave Server Ip";
   set backend.port = "80";
}

sub vcl_recv {
    if (req.http.host ~ "^media.slrclub.com") {
        set req.backend = slave;
    } elsif (req.http.host ~ "^(img01.)?slrclub.com$") {
        set req.backend = master;
    } elsif (req.http.host ~ "^(img02.)?slrclub.com$") {
        set req.backend = master;
    } else {
       error 200 "go way";
    }

   if ( req.http.host ~ "^mediat.slrclub.com" && req.url ~ "/thumb/" ) {
       lookup;
   } elsif (req.request == "GET" && req.http.Referer ~ "^http://www.slrclub.com" ) {
       lookup;
   } else {
       error 401 "Access Denied";
   }
}

sub vcl_hit {
   if (!obj.cacheable) {
       pass;
   }
   deliver;
}

sub vcl_miss {
   fetch;
}

sub vcl_fetch {
   set obj.ttl = 86400s;
   if (!obj.valid) {
       error;
   }
   if (!obj.cacheable) {
       insert_pass;
   }
   insert;
}

sub vcl_timeout {
   discard;
}

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by LeCieL

2007/01/21 23:57 2007/01/21 23:57
, , , ,
Response
No Trackback , No Comment
RSS :
http://cl.dgtalx.net/rss/response/91

Reverse Proxing for Highspeed Content Delivery

Delivery Condition :

delivery size : 10~500K (avg 300KB) file
total file size : 1TB
Request per sec -
Minimum : 3000 Requests / sec
Average : 9000 requests / sec
Peak : 36000 Requests / sec
Inactconn : 150,000 / Average
enforce object ttl : 1Day (NO REFRESH/MODIFIED ignore)
daily cache average area size (following ttl time) : most 8.2GB
peak transmit rate : 400MBps
Memory : 16GB

Additional Information
Storage : 3ware sata raid5
capacity : 4TB
Transferating Speed :  READ 190MB/s / ( actually most 30MB/s  left bandwidth for handle cache server, we have a lot of writing, and reading for another service.)


Current Configuration
Using Squid
only first level caching on memory
no secondary level caching

Problem : never cache again when the object has been expired.
1day -> cached object -> 1days over(2days) -> cached object has been expire also purge memory -> 2Days after -> the object never cache again -> user request this -> direct pass throught to origin server

We got a serveral I/O hazard when the expired object is issued in our site by users.

Tried aufs secondary level caching with async i/o , but the result is very poor.
if you have setting like that, you cannot make a traffic over 250Mbps

I'll trying to install squid version 3.
Actually there is no solutions, except zeus web server.
(i saw the report which zeus performance results, it is good for this case,
but still have memory caching problems for seperate process sharing)

Tried Solutions
varnishd - it supporting useful configuration, the vcl have much feather than squid's.
but we got a serveral memory bugs. it isn't perfect yet. do not use to production.
and there is no cache replacement logics such like as LRU, Greedy dual size freqs.
this is very important logic when you operating over memory only system.

lighttpd - too very slow. that is not optimized for cache usage

apache - don't think.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by LeCieL

2007/01/21 03:31 2007/01/21 03:31
, , , , , , , ,
Response
No Trackback , No Comment
RSS :
http://cl.dgtalx.net/rss/response/90


Archives

Calendar

«   2010/09   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30