Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [Resolvido] Squid não faz cache em disco.

    Scheduled Pinned Locked Moved Portuguese
    17 Posts 3 Posters 7.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      johnnybe
      last edited by

      @Vashe:

      Tenho o pfsense com squid e squid3 instalado. Configurei as opções de cache em disco mas ele não armazena nada no HD, só na memoria RAM.

      E quais são as especificações de seu hardware?  ???

      you would not believe the view up here

      1 Reply Last reply Reply Quote 0
      • V Offline
        Vashe
        last edited by

        Itautec Infoway SM 3322
        Processador amd athlon X2 dual core 2.8 GHz
        2GB de memoria
        320 GB de HD
        Rede realtek rtl 8139 e rtl 8111c

        1 Reply Last reply Reply Quote 0
        • V Offline
          Vashe
          last edited by

          Segue abaixo o squid.conf

          This file is automatically generated by pfSense

          Do not edit manually !

          http_port 10.114.0.254:3128
          http_port 127.0.0.1:3128 intercept
          icp_port 7
          dns_v4_first off
          pid_filename /var/run/squid.pid
          cache_effective_user proxy
          cache_effective_group proxy
          error_default_language Portuguese
          icon_directory /usr/local/etc/squid/icons
          visible_hostname pfsense
          cache_mgr admin@localhost
          access_log /var/squid/logs/access.log
          cache_log /var/squid/logs/cache.log
          cache_store_log none
          sslcrtd_children 0
          logfile_rotate 0
          shutdown_lifetime 3 seconds

          Allow local network(s) on interface(s)

          acl localnet src  10.114.0.0/24
          uri_whitespace strip

          Break HTTP standard for flash videos. Keep them in cache even if asked not to.

          refresh_pattern -i .flv$ 10080 90% 999999 ignore-no-cache override-expire ignore-private

          Let the clients favorite video site through with full caching

          acl youtube dstdomain .youtube.com
          cache allow youtube

          Windows Update refresh_pattern

          range_offset_limit -1
          refresh_pattern -i microsoft.com/..(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
          refresh_pattern -i windowsupdate.com/.
          .(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
          refresh_pattern -i my.windowsupdate.website.com/.*.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims

          Symantec refresh_pattern

          range_offset_limit -1
          refresh_pattern liveupdate.symantecliveupdate.com/..(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
          refresh_pattern symantecliveupdate.com/.
          .(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims

          Avast refresh_pattern

          range_offset_limit -1
          refresh_pattern avast.com/.*.(vpu|cab|stamp|exe) 10080 100% 43200 reload-into-ims

          Avira refresh_pattern

          range_offset_limit -1
          refresh_pattern personal.avira-update.com/.*.(cab|exe|dll|msi|gz) 10080 100% 43200 reload-into-ims
          cache_mem 1024 MB
          maximum_object_size_in_memory 64 KB
          memory_replacement_policy heap GDSF
          cache_replacement_policy heap LFUDA
          cache_dir ufs /var/squid/cache 4096 16 256
          minimum_object_size 0 KB
          maximum_object_size 20480 KB
          offline_mode offcache_swap_low 90
          cache_swap_high 95

          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

          No redirector configured

          #Remote proxies

          Setup some default acls

          acl allsrc src all
          acl localhost src 127.0.0.1/32
          acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901  3128 1025-65535
          acl sslports port 443 563 
          acl manager proto cache_object
          acl purge method PURGE
          acl connect method CONNECT

          acl blacklist dstdom_regex -i "/var/squid/acl/blacklist.acl"
          http_access allow manager localhost

          Allow external cache managers

          acl ext_manager src 127.0.0.1
          acl ext_manager src 10.114.0.254
          acl ext_manager src
          http_access allow manager ext_manager

          http_access deny manager
          http_access allow purge localhost
          http_access deny purge
          http_access deny !safeports
          http_access deny CONNECT !sslports

          Always allow localhost connections

          http_access allow localhost

          quick_abort_min 0 KB
          quick_abort_max 0 KB
          request_body_max_size 20480 KB
          reply_body_max_size 20480 KB allsrc
          delay_pools 1
          delay_class 1 2
          delay_parameters 1 -1/-1 -1/-1
          delay_initial_bucket_level 100

          Throttle extensions matched in the url

          acl throttle_exts urlpath_regex -i "/var/squid/acl/throttle_exts.acl"
          delay_access 1 allow throttle_exts
          delay_access 1 deny allsrc

          Reverse Proxy settings

          Package Integration

          refresh_pattern ([^.]+.|)avast.com/..(vpu|vpaa) 4320 100% 43200 reload-into-imsrefresh_pattern ([^.]+.|)avg.com/..(bin) 4320 100% 43200 reload-into-ims
          redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squidGuard/squidGuard.conf
          redirector_bypass on
          redirect_children 3

          Custom options

          Block access to blacklist domains

          http_access deny blacklist

          Setup allowed acls

          Allow local network(s) on interface(s)

          http_access allow localnet

          Default block all to be sure

          http_access deny allsrc

          1 Reply Last reply Reply Quote 0
          • marcellocM Offline
            marcelloc
            last edited by

            tenta desabilitar o cache do youtube para sumir com estas  linhas do arquivo de configuração:

            Let the clients favorite video site through with full caching

            acl youtube dstdomain .youtube.com
            cache allow youtube

            Treinamentos de Elite: http://sys-squad.com

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • V Offline
              Vashe
              last edited by

              Fiz a alteração mas o erro persiste.  :'(

              $ df -hT
              Filesystem  Type    Size    Used  Avail Capacity  Mounted on
              /dev/ad4s1a  ufs      53G    1.6G    47G    3%    /
              devfs        devfs    1.0K    1.0K      0B  100%    /dev
              /dev/md0    ufs      3.6M    38K    3.3M    1%    /var/run
              /dev/ad4s1d  ufs      44G    4.0K    40G    0%    /VAR
              /dev/ad4s1e  ufs      44G    272M    40G    1%    /usr
              devfs        devfs    1.0K    1.0K      0B  100%    /var/dhcpd/dev

              1 Reply Last reply Reply Quote 0
              • marcellocM Offline
                marcelloc
                last edited by

                voce criou o /var com letras maiusculas?

                Treinamentos de Elite: http://sys-squad.com

                Help a community developer! ;D

                1 Reply Last reply Reply Quote 0
                • V Offline
                  Vashe
                  last edited by

                  Na verdade a partição para cache é a /. Ela está em 3% desde o inicio da instalação.

                  $ df -hT
                  Filesystem  Type    Size    Used  Avail Capacity  Mounted on
                  /dev/ad4s1a  ufs      53G    1.6G    47G    3%    /
                  devfs        devfs    1.0K    1.0K      0B  100%    /dev
                  /dev/md0    ufs      3.6M    38K    3.3M    1%    /var/run
                  /dev/ad4s1d  ufs      44G    4.0K    40G    0%    /VAR
                  /dev/ad4s1e  ufs      44G    272M    40G    1%    /usr
                  devfs        devfs    1.0K    1.0K      0B  100%    /var/dhcpd/dev

                  1 Reply Last reply Reply Quote 0
                  • marcellocM Offline
                    marcelloc
                    last edited by

                    Já tentou monitorar de uma forma menos cega?

                    Monitorando cache do Squid com Navegador

                    Este é o primeiro link de proxy na parte de tutorias, da uma olhada lá de vez em quando…

                    Treinamentos de Elite: http://sys-squad.com

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • V Offline
                      Vashe
                      last edited by

                      Boa noite,

                      Mudei a partição /VAR para /var e agora está armazenando em disco.

                      PS: Eu já monitorava o cache pelo navegador.

                      Obrigado pela atenção.

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        johnnybe
                        last edited by

                        @Vashe:

                        Mudei a partição /VAR para /var e agora está armazenando em disco.

                        Em sistemas "Unix like" como Linux, OpenBSD, FreeBSD o caminho é muito sensitivo: De /VAR para /var, existe uma grande diferença. E, no próprio Squid por padrão, nota-se que na aba Cache Mgmt, opção Hard disk cache location que o caminho é /var/squid/cache.  :)
                        E se você tivesse reescrito, nessa opção, /VAR/squid/cache? Nunca precisei alterar isso mas seria para funcionar.

                        you would not believe the view up here

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.