Gentoo 实践显存加速Squid

上一篇 / 下一篇  2007-11-12 21:06:32 / 个人分类:Linux 笔记

照着这个做的 http://gentoo-wiki.com/TIP_Use_memory_on_video_card_as_swap 
把文档中的 swap 改成 squid 的 cache ,就完成了将显存作为cache 给 squid 加速网页浏览的效果了 
在 /etc/conf.d/local.start 加入这些来建立 MTD 
------------------------------------------------------------------------------------------------
# Mount mtd as squid cache 
/sbin/modprobe slram map=VRAM,0xf0400000,+0x7c00000 
/sbin/modprobe mtdchar 
/sbin/modprobe mtdblock 
/sbin/mkfs.reiser4 -y /dev/mtdblock0 
/bin/mount /dev/mtdblock0 /var/tmp/squid 
/bin/chmod 777 /var/tmp/squid 
/etc/init.d/squid start
 
------------------------------------------------------------------------------------------------
 
使用了124Mbyte显存空间来做cache,在 /etc/squid/squid.conf 里做相应配置
 
-----------------------------------------------------------------------------------------------
http_port 192.168.0.1:3128 transparent
cache_dir ufs /var/tmp/squid 100 16 256
visible_hostname Home_cache
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /dev/null squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
acl all src 0.0.0.0/0.0.0.0
acl localnet src 192.168.0.0/255.255.255.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all
forwarded_for off
coredump_dir /var/cache/squid
cache_mem 32 MB
error_directory /usr/share/squid/errors/Simplify_Chinese
-----------------------------------------------------------------------------------------
 

TAG: gentoo linux squid MTD

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-07  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 657
  • 日志数: 10
  • 建立时间: 2007-09-05
  • 更新时间: 2008-04-22

RSS订阅

Open Toolbar