iuaheiuaheiuhaieuh....carak....moh mauCitação:
Postado originalmente por gmlinux
Versão Imprimível
iuaheiuaheiuhaieuh....carak....moh mauCitação:
Postado originalmente por gmlinux
Viu nada, eu ainda aplico políticas de banda bem baixa (delay pools) em sites que não posso bloquear e que possuem características de consumir banda....
Isso é interessante :) faz um tuto sobre isso ae pra galera cara ;) não tenho visto muito material bom sobre isso por ae
issu seria legal bagarai... ter um tutuCitação:
Postado originalmente por 1c3_m4n
:good:
Não tenho a manha de fazer tuto e o assunto é tranquilo.
Na verdade peguei o arquivo comentado do squid e praticamente só descomentei as opções e adicionei meus próprios comentários. :D
# TAG: delay_pools
# This represents the number of delay pools to be used. For example,
# if you have one class 2 delay pool and one class 3 delays pool, you
# have a total of 2 delay pools.
# vou usar 2 neste exemplo
delay_pools 2
# TAG: delay_class
# This defines the class of each delay pool. There must be exactly one
# delay_class line for each delay pool. For example, to define two
# delay pools, one of class 2 and one of class 3, the settings above
# and here would be:
# The delay pool classes are:
# class 1 Everything is limited by a single aggregate
# bucket.
# class 2 Everything is limited by a single aggregate
# bucket as well as an "individual" bucket chosen
# from bits 25 through 32 of the IP address.
# class 3 Everything is limited by a single aggregate
# bucket as well as a "network" bucket chosen
# from bits 17 through 24 of the IP address and a
# "individual" bucket chosen from bits 17 through
# 32 of the IP address.
# NOTE: If an IP address is a.b.c.d
# -> bits 25 through 32 are "d"
# -> bits 17 through 24 are "c"
# -> bits 17 through 32 are "c * 256 + d"
# usei class 2 para ambos os delay pools para o exemplo ficar simples
delay_class 1 2
delay_class 2 2
# TAG: delay_access
# This is used to determine which delay pool a request falls into.
# The first matched delay pool is always used, i.e., if a request falls
# into delay pool number one, no more delay are checked, otherwise the
# rest are checked in order of their delay pool number until they have
# all been checked. For example, if you want some_big_clients in delay
# pool 1 and lotsa_little_clients in delay pool 2:
#Aqui esta as regras, sites_abusivos e palavras_abusivas são ACLs
#pode ser por user ou outro critério de ACL
delay_access 2 allow sites_abusivos palavras_abusivas
delay_access 2 deny all
delay_access 1 allow ALL
delay_access 1 deny all
# TAG: delay_parameters
# This defines the parameters for a delay pool. Each delay pool has
# a number of "buckets" associated with it, as explained in the
# description of delay_class.
# For a class 1 delay pool, the syntax is:
#delay_parameters pool aggregate
# For a class 2 delay pool:
#delay_parameters pool aggregate individual
# For a class 3 delay pool:
#delay_parameters pool aggregate network individual
# The variables here are:
# pool a pool number - ie, a number between 1 and the
# number specified in delay_pools as used in
# delay_class lines.
# aggregate the "delay parameters" for the aggregate bucket
# (class 1, 2, 3).
# individual the "delay parameters" for the individual
# buckets (class 2, 3).
# network the "delay parameters" for the network buckets
# (class 3).
# A pair of delay parameters is written restore/maximum, where restore is
# the number of bytes (not bits - modem and network speeds are usually
# quoted in bits) per second placed into the bucket, and maximum is the
# maximum number of bytes which can be in the bucket at any time.
#
# For example, if delay pool number 1 is a class 2 delay pool as in the
# above example, and is being used to strictly limit each host to 64kbps
# (plus overheads), with no overall limit, the line is:
#
# os sites de abuso, individualmente pode usar 500*8=4kbps e
# juntos 5000*8=40kbps (eles ficam lentos hehehe sobretudo quando
# a galera acessa)
delay_parameters 2 5000/5000 500/500
# o restante dos sites, individualmente 10000*8=80kbps e juntos esta sem limite
delay_parameters 1 -1/-1 10000/10000
# Note that the figure -1 is used to represent "unlimited".
# And, if delay pool number 2 is a class 3 delay pool as in the above
# example, and you want to limit it to a total of 256kbps (strict limit)
# with each 8-bit network permitted 64kbps (strict limit) and each
# individual host permitted 4800bps with a bucket maximum size of 64kb
# to permit a decent web page to be downloaded at a decent speed
# (if the network is not being limited due to overuse) but slow down
# large downloads more significantly:
#delay_parameters 2 32000/32000 8000/8000 600/8000
# There must be one delay_parameters line for each delay pool.
# TAG: delay_initial_bucket_level (percent, 0-100)
# The initial bucket percentage is used to determine how much is put
# in each bucket when squid starts, is reconfigured, or first notices
# a host accessing it (in class 2 and class 3, individual hosts and
# networks only have buckets associated with them once they have been
# "seen" by squid).
delay_initial_bucket_level 50