SQUID ·Î±×ÆÄÀÏ Á¤º¸
cache.log : squid¿¡ ´ëÇÑ µ¿ÀÛ Flow¿¡ ´ëÇÑ ·Î±× ÆÄÀÏ
2010/04/05 19:14:17| Config 'request_header_max_size'= 5120 bytes.
2010/04/05 19:14:19| Request header is too large (5840 bytes)
2010/04/05 19:14:19| Config 'request_header_max_size'= 5120 bytes.
2010/04/05 19:43:52| WARNING: Forwarding loop detected for:
Client: 211.119.250.40 http_port: xx.xxx.xxx.40:80
GET
http://xxx.xxx.xxx.40/ HTTP/1.0
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB0.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Accept-Encoding: gzip, deflate
Host: xxx.xxx.xxx.40
Via: 1.1 xxx.xxx.com:80 (squid)
X-Forwarded-For: xxx.xxx.xxx.66
Cache-Control: max-age=259200
Connection: keep-alive
2010/04/05 19:43:52| WARNING: Forwarding loop detected for:
Client: xxx.xxx.xxx.40 http_port: xxx.xxx.xxx.40:80
GET
http://xxx.xxx.xxx.40/ HTTP/1.0
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB0.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Accept-Encoding: gzip, deflate
Host: xxx.xxx.xxx.40
Via: 1.1 xxx.xxx.com:80 (squid), 1.0 xxx.xxx.com:80 (squid)
X-Forwarded-For: xxx.xxx.xxx.66, xxx.xxx.xxx.40
Cache-Control: max-age=259200
Connection: keep-alive
2010/04/05 20:18:33| clientReadRequest: FD 89 (59.xxx.xxx.122:3732) Invalid Request
2010/04/05 20:18:33| clientReadRequest: FD 94 (59.xxx.xxx.122:3737) Invalid Request
2010/04/05 20:18:33| clientReadRequest: FD 96 (59.xxx.xxx.122:3961) Invalid Request
¡Ø cache¿¡ ´ëÇÑ debug logÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
À§ÀÇ OptionÀ» ¼³Á¤ÇÏ¿© cache ±â´ÉÀ» ½ÃÇèÇϸé squidÀÇ Àüü Flow¿¡ ´ëÇÑ debug ¸Þ½ÃÁö¸¦ È®ÀÎÇÒ ¼ö ÀÖ´Ù. ÀÌ ¸Þ½ÃÁö¸¦ »ç¿ëÇÏ¿© »ç¿ëÀÚ´Â debugging ÀÛ¾÷À» ¼öÇàÇÒ ¼ö ÀÖ´Ù
access.log : GET, PUT method¿¡ ´ëÇÑ access °á°ú°¡ Ãâ·Â
¡Ø ÀÌ log File·Î GET±â´É ¼öÇà½Ã CacheµÈ Data°¡ Á¤»óÀûÀ¸·ÎGETµÇ¾ú´ÂÁö¸¦ È®ÀÎÇÒ ¼ö ÀÖ´Ù.
À§ÀÇ ¸Þ½ÃÁö Áß TCP_HIT´Â CacheµÈ URLÀ» GET, TCP_MISS´Â ¿ÜºÎ¿¡¼ URLÀ» GETÇÏ¿´À½À» Ç¥½ÃÇÔ. À§ÀÇ ¸Þ½ÃÁö¸¦ È®ÀÎÇÏ¿© Á¤»óÀûÀ¸·Î GETµÇ¾ú´ÂÁö¸¦ ¾Ë ¼ö ÀÖ´Ù.
Áï TCP_HIT°¡ Ãâ·ÂµÇ¸é Á¤»óÀûÀ¸·Î µ¥ÀÌÅÍ°¡ GETµÈ °ÍÀÌ´Ù. ¸¸¾à TCP_MISS°¡ Ãâ·ÂµÇ¸é ij½ÃµÈ µ¥ÀÌÅÍ°¡ ¾ø´Â °ÍÀÌ´Ù.
store.log : ij½Ã Data¸¦ Swap File¿¡ WriteÇÏ´ÂÁö¿¡ ´ëÇÑ Á¤º¸ Ãâ·Â
¡Ø À§¿¡ RELEASE´Â FILEÀÌ RELEASEµÇ¾ú´Ù´Â °Í, SWAPOUTÀº FileÀÌ »ý¼ºµÇ¾ú´Ù´Â °ÍÀ» ³ªÅ¸³½´Ù. SWAPINÀº File¿¡ Á¢±ÙÇÏ¿´´Ù´Â °ÍÀ» ³ªÅ¸³½´Ù.
SWAPOUTÀÎ °æ¿ì Fileno°¡ 00000015À̸é /usr/local/squid/cache/00/00¿¡ Fileno 00000015 fileÀÌ »ý¼ºµÇ¾ú´Ù´Â ÀǹÌÀÌ´Ù. Á÷Á¢ /usr/local/squid/cache/00/00¿¡ µé¾î°¡ Á¤»óÀûÀ¸·Î ÇØ´ç FileÀÌ »ý¼ºµÇ¾ú´ÂÁö¸¦ È®ÀÎÇÑ´Ù.
¸¸¾à Fileno°¡ 00020017À̸é /usr/local/squid/cache/00/02¿¡ Fileno 00000017 fileÀÌ »ý¼ºµÇ¾ú´Ù´Â ÀǹÌÀÌ´Ù.
squid.pid : µ¿ÀÛÇÏ´Â squidÀÇ pid°¡ Ãâ·Â
cache directory : Swap file¿¡ ´ëÇÑ Á¤º¸
ij½¬±â´É
PUT : URL°ú ÇØ´ç DataÀ» ÀúÀå
Cache ¼¹ö°¡ Proxy·ÎºÎÅÍ URL°ú URLÀÇ Content¸¦ ¼ö½ÅÇÏ¿´À»¶§ ÇØ´ç URL°ú URLÀÇ Content¸¦ ÀúÀåÇÏ´Â ±â´ÉÀÌ´Ù. Cache Server°¡ Proxy Server·ÎºÎÅÍ URL°ú ÇØ´ç URLÀÇContent¸¦ ¼ö½ÅÇÏ¸é ¸ÕÀú ÇØ´ç URLÀÇ Header ºÎºÐÀ» °Ë»çÇÑ´Ù. Header ºÎºÐÀ» °Ë»çÇÏ¿© ij½Ã °¡´ÉÇÑ ContentÀÏ °æ¿ì ÇØ´ç URLÀ» Disk¿¡ ÀúÀåÇÑ´Ù. À̶§ ÄÁÅÙÃ÷ Å©±â°¡ 2048 ÀÌÇÏÀ϶§´Â Ram Disk¿¡ ÀúÀåµÇ°í 2048 ÀÌ»óÀ϶§´Â URL¿¡ ÇØ´çµÇ´Â Content´Â ¹°¸®ÀûÀÎ DiskÀÎ /usr/local/squid/cacheÀÇ µð·ºÅ丮¿¡ ÀúÀåµÈ´Ù. ¸¸¾à ij½Ã°¡´ÉÇÑ µ¥ÀÌÅÍÀε¥µµ ÀúÀå °ø°£ÀÌ ºÎÁ·ÇÒ ½Ã¿¡´Â LRU(Least Recnet Unit) Á¤Ã¥À» µû¶ó °¡Àå ¿À·¡ ÀúÀåµÈ ij½Ãµ¥ÀÌÅÍ°¡ »èÁ¦µÈ´Ù. ¸¸¾à µ¥ÀÌÅÍ°¡ »èÁ¦µÇ¾ú´Âµ¥µµ ³²Àº °ø°£ÀÌ ÄÁÅÙÃ÷ Å©±âº¸´Ù ÀÛÀ¸¸é ±× µ¥ÀÌÅÍ´Â ÀúÀåµÇÁö ¾Ê´Â´Ù.
GET : URL¿¡ ´ëÇÑ µ¥ÀÌÅÍ ¿ä±¸½Ã ÇØ´çµ¥ÀÌÅ͸¦ °Ë»öÇÏ¿© Àü¼Û
GET ±â´ÉÀº cache¿¡ ÀúÀåµÈ URLÀÇ Content¸¦ Proxy Server·Î °¡Á®¿À±â À§ÇÑ ±â´ÉÀÌ´Ù. Proxy Server¿¡¼ URLÀÇ Á¤º¸¸¦ °¡Á®¿À±â À§ÇØ ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÏ¿©¾ß ÇÑ´Ù.
GET URL HTTP/1.0
À§¿Í °°ÀÌ ÀԷ½à Cache Server¿¡ ÇØ´ç URLÀÌ ¾øÀ¸¸é NOK, ÇØ´ç URLÀÌ ÀÖÀ¸¸é Cache Server¿¡¼´Â ÇØ´ç URLÀÌ ÀúÀåµÈ File À§Ä¡¸¦ °Ë»öÇÑ ÈÄ ÇØ´ç File¿¡ ÀúÀåµÇ¾î ÀÖ´Â Content¸¦ Proxy Server·Î Àü¼ÛÇÑ´Ù.
¸¸¾à ÇØ´ç URL°ú URL¿¡ ÇØ´çÇÏ´Â Content°¡ À־ À¯È¿±â°£ÀÌ Áö³ µ¥ÀÌÅ͸¦ ¿ä±¸Çϸé ÇØ´ç URL°ú URL¿¡ ÇØ´çµÇ´Â Content¸¦ »èÁ¦ÇÏ°í Proxy Server·Î NOK ¸Þ½ÃÁö¸¦ Àü¼ÛÇÑ´Ù.