¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 111°Ç
   
SQUID ·Î±×Á¤º¸
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2010-04-06 (È­) 10:09 Á¶È¸ : 19451
±ÛÁÖ¼Ò :
                             

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 °á°ú°¡ Ãâ·Â

1270530049.102      2 59.xxx.xxx.171 TCP_MISS/200 509 GET http://www.xxx.xxx/skin/default/xxx_img/bottom_top.gif - DIRECT/218.xxx.xxx.75 image/gif
1270530049.102      2 59.xxx.xxx.171 TCP_MISS/200 5222 GET http://www.xxx.xxx/skin/default/xxx/cot.js - DIRECT/218.xxx.xxx.75 application/x-javascript
1270530049.104      3 59.xxx.xxx.171 TCP_MISS/200 13887 GET http://www.xxx.xxx/skin/default/xxx_img/bottom.gif - DIRECT/218.xxx.xxx.75 image/gif
1270530049.169    146 59.xxx.xxx.171 TCP_HIT/200 387129 GET http://www.xxx.xxx/skin/default/xxx/flash/shopping_bt.swf - NONE/- application/x-shockwave-flash
1270530049.211     42 59.xxx.xxx.171 TCP_MISS/200 20659 GET http://www.xxx.xxx/skin/default/xxx/cornertrust.gif - DIRECT/218.xxx.xxx.75 image/gif

¡Ø ÀÌ 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ÇÏ´ÂÁö¿¡ ´ëÇÑ Á¤º¸ Ãâ·Â

1270530382.338 RELEASE -1 FFFFFFFF BD5ECFF9774ACD7FD3A962DE8122E94F  200 1270516697 1187020999 1585876697 image/gif 74/74 GET http://www.xxx.xxx/skin/default/main_img/bottom_line.gif
1270530382.339 RELEASE -1 FFFFFFFF E72A4DC9B6AEB52332DB71357AB1F06E  200 1270516697 1187020997 1585876697 image/gif 253/253 GET http://www.xxx.xxx/skin/default/main_img/bottom_01.gif
1270530382.339 RELEASE -1 FFFFFFFF F7BD7B9833828825B7C1FF39F2DC3B1B  200 1270516697 1187020998 1585876697 image/gif 274/274 GET http://www.xxx.xxx/skin/default/main_img/bottom_02.gif
1270530382.340 RELEASE -1 FFFFFFFF F94C7769A23531A747006C190D64DEA8  200 1270516697 1187020998 1585876697 image/gif 271/271 GET http://www.xxx.xxx/skin/default/main_img/bottom_04.gif
1270530382.340 RELEASE -1 FFFFFFFF 482001A3F340F6AB92DCA2C67C2D4D4E  200 1270516697 1187020998 1585876697 image/gif 504/504 GET http://www.xxx.xxx/skin/default/main_img/bottom_05.gif
1270530382.341 RELEASE -1 FFFFFFFF 4D600ECB599D84466EC708EEC2126169  200 1270516697 1187020999 1585876697 image/gif 138/138 GET http://www.xxx.xxx/skin/default/main_img/bottom_top.gif
1270530382.341 RELEASE -1 FFFFFFFF BE59C755D0F1C34F3282B16B25D2A416  200 1270516697 1192757856 1585876697 image/gif 432/432 GET http://www.xxx.xxx/skin/default/main_img/bottom_03.gif
1270530382.342 RELEASE -1 FFFFFFFF A3709B8709FF81AF217CF536C23AF6A8  200 1270516697 1253358658 1585876697 application/x-javascript 4835/4835 GET http://www.xxx.xxx/skin/default/script/cot.js

¡Ø À§¿¡ 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 ¸Þ½ÃÁö¸¦ Àü¼ÛÇÑ´Ù.


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.