亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2556 | 回復(fù): 5
打印 上一主題 下一主題

[proxy] squid限速問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2015-09-09 09:20 |只看該作者 |倒序瀏覽
squid和nat結(jié)合的形式做了一個服務(wù)器,為什么限速不成功代碼如下


visible_hostname NAT162

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT


delay_pools 1     
delay_class 1 1
delay_access 1 allow all
delay_parameters 1 50000/50000 # 限制網(wǎng)速在50K以內(nèi)
delay_initial_bucket_level 50


#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
#http_access deny all

http_access allow all

# Squid normally listens to port 3128
#http_port 3128

http_port 3128 transparent

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

論壇徽章:
154
2022北京冬奧會紀(jì)念版徽章
日期:2015-08-07 17:10:5720周年集字徽章-年
日期:2022-10-26 16:44:2015-16賽季CBA聯(lián)賽之深圳
日期:2022-11-02 14:02:4515-16賽季CBA聯(lián)賽之八一
日期:2022-11-28 12:07:4820周年集字徽章-20	
日期:2023-07-19 08:49:4515-16賽季CBA聯(lián)賽之八一
日期:2023-11-04 19:23:5115-16賽季CBA聯(lián)賽之廣夏
日期:2023-12-13 18:09:34
2 [報告]
發(fā)表于 2015-09-09 22:13 來自手機(jī) |只看該作者
本帖最后由 shang2010 于 2015-09-09 22:15 編輯

對不起,限速在iptable里面實現(xiàn)的啊
因為nat都抽象屏蔽掉了

論壇徽章:
0
3 [報告]
發(fā)表于 2015-09-10 10:00 |只看該作者
回復(fù) 2# shang2010


不明白。難道透明代理做不了限速嗎?

   

論壇徽章:
154
2022北京冬奧會紀(jì)念版徽章
日期:2015-08-07 17:10:5720周年集字徽章-年
日期:2022-10-26 16:44:2015-16賽季CBA聯(lián)賽之深圳
日期:2022-11-02 14:02:4515-16賽季CBA聯(lián)賽之八一
日期:2022-11-28 12:07:4820周年集字徽章-20	
日期:2023-07-19 08:49:4515-16賽季CBA聯(lián)賽之八一
日期:2023-11-04 19:23:5115-16賽季CBA聯(lián)賽之廣夏
日期:2023-12-13 18:09:34
4 [報告]
發(fā)表于 2015-09-10 11:25 |只看該作者
回復(fù) 3# mengcun123


    不明白,沒有研究過

squid基本不做限速,本來就是個鏡像服務(wù)器的

論壇徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-11-26 06:20:00操作系統(tǒng)版塊每月發(fā)帖之星
日期:2015-12-02 14:57:54IT運(yùn)維版塊每月發(fā)帖之星
日期:2016-01-07 23:01:56IT運(yùn)維版塊每周發(fā)帖之星
日期:2016-01-07 23:04:2615-16賽季CBA聯(lián)賽之青島
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之北控
日期:2016-03-23 14:20:06IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-04-01 06:20:0015-16賽季CBA聯(lián)賽之吉林
日期:2016-06-28 13:51:54IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-01 06:20:00IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-11-23 06:20:00
5 [報告]
發(fā)表于 2015-09-14 11:01 |只看該作者
本帖最后由 woxizishen 于 2015-09-14 11:04 編輯

流量通過squid的絕對能限速,如果經(jīng)過iptables里直接nat出去的話,你那個限速參數(shù)就沒作用啊。不管你squid結(jié)合什么玩意nat。沒經(jīng)過squid出去的流量,squid他就管不到。


另外squid限速有一個過程:
筆者親測試,這個功能完全可以勝任企業(yè)里的帶寬限速功能。說不準(zhǔn)確的用戶,八成是沒有測試仔細(xì),squid進(jìn)行帶寬限速時候,不會因為用戶使用超過他的最大限定帶寬時候,就會立即把這些用戶加起來的總帶寬限制到最大帶寬以下,他會有一個調(diào)整過程,筆者觀察到squid需要一段時間后,會把帶寬降低到最大帶寬以下。所以既然squid開發(fā)了這個功能,有對公司帶寬質(zhì)量穩(wěn)定性比較在乎的,還是需要開啟這個功能的。筆者就打個比方,有一次公司高層開遠(yuǎn)程視頻會議,就因為一個用戶下載一個幾GB數(shù)據(jù),造成遠(yuǎn)程視頻會議奇卡,雖然找到了這個用戶,但是我們不可能每次都問題發(fā)生了再去找原因吧,所以最好的處理問題方式就是預(yù)防問題的發(fā)生,也就是俗話說的未雨綢繆。

不過如果你公司有硬件防火墻的話,就在防火墻上做就行了。有硬的就不要軟,多此一舉。

論壇徽章:
0
6 [報告]
發(fā)表于 2015-09-14 13:19 |只看該作者
回復(fù) 5# woxizishen


領(lǐng)悟了,我做普通squid代理的時候的確限制的很好,限制到200k就是200k,不會有什么問題,后來做透明代理的時候, 發(fā)現(xiàn)了問題,現(xiàn)在想來的確是的。我們公司有還有一條電信線路,這條線路是不是經(jīng)過防火墻的,只是通過路由上網(wǎng)到該線路,所以沒有限制,導(dǎo)致經(jīng)常性的卡,也沒法限制客戶,所以才想通過squid透明代理限速,看起來不起作用。


   
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP