1 / 33

Proxy Server 規劃管理

臺灣學術網路竹苗區域網路中心 89 年網路教育推廣訓練課程. Proxy Server 規劃管理. 主講人:葉致偉 交大校園網路策進會 cwyeh@ccca.nctu.edu.tw. 上路之前. 瞭解 Proxy 的運作原理和架構. 為什麼需要 Proxy ?. 節省頻寬 減少等待時間 增加安全性 頻寬的使用可以公開化、公平化 網路中斷仍可部份使用. 有什麼壞處?. 資料不一定是最正確的 設定不當反而會增加等待時間 使用不當容易造成效能下降. 基本觀念. 階層式的架構 Parent/child -- parent 要幫 child 代抓資料

bonnie
Download Presentation

Proxy Server 規劃管理

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 臺灣學術網路竹苗區域網路中心 89年網路教育推廣訓練課程 Proxy Server 規劃管理 主講人:葉致偉 交大校園網路策進會 cwyeh@ccca.nctu.edu.tw

  2. 上路之前 瞭解Proxy的運作原理和架構

  3. 為什麼需要Proxy? • 節省頻寬 • 減少等待時間 • 增加安全性 • 頻寬的使用可以公開化、公平化 • 網路中斷仍可部份使用

  4. 有什麼壞處? • 資料不一定是最正確的 • 設定不當反而會增加等待時間 • 使用不當容易造成效能下降

  5. 基本觀念 • 階層式的架構 • Parent/child-- parent 要幫 child 代抓資料 • Siblings-- 相互支援,互通有無,不代抓資料 • 階層關係是相對的,並非絕對的

  6. Parent/child • 通常Parent離目的地較近、較快 • 對不同的目的地可以有不同的Parent • Parent有時也可能變成Child

  7. Siblings • Siblings彼此的地位是對等的 • Siblings之間互通有無,但是不幫忙代抓 • 詢問時送出ICP (Internet Cache Protocol)

  8. Internet 2a 3b TANet Gateway X 2b • 163.28.xxx.yyy Proxy/caching server HD cache 1a 4b 1b PC client • TANet 區域網路使用者 Fig. 1 Proxy/caching server 運作示意圖

  9. 交大Proxy Server架構

  10. 區網下游單位Proxy架構

  11. 各大區網Proxy架構圖

  12. Proxy的效率 • Hit Rate-- By Objects/By Bytes-- 國外網頁約在 30-45% 之間-- 國內網頁約在 50-70% 之間 • Response Time-- 受硬體、網路影響較大

  13. Proxy Server 所需的硬體 • 硬碟越快越好-- 大不一定好,搜尋時間比較重要 • 記憶體越大、越快越好 • CPU的要求並不特別高 • 網路卡要穩定

  14. 架設Proxy Server 使用 squid proxy server

  15. 規畫您的Proxy Server • 有多少使用者? • 經常存取的網頁有哪些? • 哪些時段會是尖峰時段? • 有多少預算? • 連往內部(Intranet)還是外部(Internet)? • 希望達到什麼目標?

  16. NCTU Proxy Server 規畫 • 經常使用之節點約 6000 個 • 提供竹苗區下游單位使用 • 總流量約40Gb/day • 提供數位電子圖書館期刊專用

  17. NCTU Proxy Server 規畫 • 三台PC Server分別負責不同區域-- Pentium II 400 MHz CPU-- 9GB UW-SCSI x 8-- 1GB RAM-- 10/100M Network Interface Card(Intel)-- FreeBSD 4.0-stable-- Squid 2.3.STABLE2

  18. What is squid?(1) • 高效能的免費 Proxy Server • 架設在 FreeBSD、Linux、Solaris等UNIX Server 上 • 提供相當有彈性的access list 設定方式 • 提供加權的ICP設定,可以讓 Proxy 的架構更有彈性 • 本身即附有DNS Client以供查詢Domain Name

  19. What is squid?(2) • 可以將數台 squid server 排成階層狀,也可以排成網狀 • 支援 SSL,安全不成問題 • 利用 RAM 來存放熱門資訊,減少硬碟存取次數

  20. 取得Squid軟體 • 原始站台-- ftp://ftp.squid-cache.org/(原始站)-- http://proxy.nctu.edu.tw/tech/source/ • 安裝步驟-- 參考 http://www.squid-cache.org-- FAQ -- User Guide

  21. Squid 2.X 的組成 • Squid – 主要 Proxy 程式 • dnsserver – 外掛的 DNS 查詢程式(在 2.3-STABLE 以後改成內建) • client – 可供測試用的簡易http client • 其他管理工具

  22. Squid-2的建置與設定 • 取得並編譯軟體% tar xvzf squid-2.3.x.src.tar.gz% cd squid-2.2-x% ./configure –prefix=/home/squid% make% make install • ./configure –help 有許多選項,可參考FAQ的2.6 有詳細的說明 • 建議值./configure –prefix=/home/squid –enable-regex –enable-delay-pools –enable-cache-digests --enable-err-language=Traditional_Chinese

  23. Squid中標準的目錄結構 • 若以 –prefix=/home/squid 為參數,則以下目錄都在 /home/squid 下:- bin,etc,log- 主要設定檔位於 etc/ 目錄下‧squid.conf, mime.conf, mib.txt, errors/- 系統記錄檔放在 logs/ 目錄下‧access.log, cache.log,…

  24. 停止 squid server • 若有跑 RunCache,先停掉 RunCache% ps –ax |grep RunCache 找出 pid% kill $pid% bin/squid –k shutdown • 若不先停掉 RunCache, squid 會自動重生 • Squid 最好透過 squid –k shutdown 這個指令停止,不要直接砍 pid

  25. 啟動squid server • 若採用預設值不更動,則需要先建立一個 cache/ 目錄,並執行% chown –R nobody cache • 建立 cache/ 目錄下的次目錄% bin/squid –z • 執行 RunCache 以啟動 squid% bin/RunCache &

  26. 設定 squid.conf • cache_mem 建議設定為系統記憶體的1/3 • 使用 acl 和 http_access 設定proxy階層 • 參考 http://proxy.nctu.edu.tw的下游設定

  27. 程式不正常時…. • 用 tail –f access.log 觀察是否送到正確的機器 • 用 tail –f cache.log 觀察是否有錯誤訊息 • cache_dir 是否滿了? • 使用 cachemgr 來觀察系統狀況

  28. CacheFlow Proxy 的另一種選擇

  29. 什麼是CacheFlow? • 整合性的Proxy/Cache Server • 省去硬體/作業系統維護的麻煩 • 方便的Web-based管理介面 • 減少網路延遲 • 加強的抓取網頁功能- Pipe-line 技術- Refresh 機制 • 加強的儲存系統

  30. 管理介面 • 採用http的方式更新設定檔 • 系統可以從網路上升級 • 系統log可在Web上直接看到 • 要分析詳細log要用 ftp upload 到特定機器

  31. 技術以外…. 法律相關問題

  32. 使用者隱私權問題 • 使用者公約 • 分析統計流量 • 超量使用的處理方式

  33. 參考資料 • http://www.squid-cache.org • http://proxy.nctu.edu.tw • http://proxy.nsysu.edu.tw • http://www.cacheflow.com

More Related