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

    Internet Lento + Squid3 + SquidGuard (SOLUCIONADO)

    Scheduled Pinned Locked Moved Español
    19 Posts 3 Posters 10.9k 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.
    • R Offline
      ricardo_1
      last edited by

      Disculpa, al parecer me he dado a entender mal. Detrás del proxy.

      1 Reply Last reply Reply Quote 0
      • perikoP Offline
        periko
        last edited by

        Para crear de nuevo el directorio es algo rapido que tienes que hacer…

        Conectate a la consola y te vas a el directorio:

        cd /var/squid

        Ahi vas a tener un directorio llamado:

        cache

        La cosa es borrarlo y recrearlo, squid tiene manera de hacerlo ya que cuando uno esta configurando el sistema por 1ra vez el lo crea.

        Crear un batch llamado 'borrar.sh" con estos comandos:

        #!/bin/sh

        cd /var/squid
        rm -rf ./cache
        squid -z
        chown -R proxy:proxy cache/

        Le pones la bandera de ejecutable:

        chmod +x batch.sh

        Este batch lo que hace es simple, borra el directorio cache y le dice a squid que vuelva a crear el directorio cache y le pone los permisos de squid.

        Solo asegurate que el directorio 'cache'  exista antes de ejecutarlo, dentro debe haber varios directorios.

        Te lo paso, si lo quieres ejecutar a mano adelante para que lo cales.

        Ahora si, te vas a el GUI->Status->Services

        Apagas el squid.

        Ya que el GUI te diga que esta apagado, te regresas a la consola y ejecutas el batch:

        ./borrar.sh

        Vas a ver como el vuelve a crear los directorios ya que los regresa a pantalla.

        Te lo paso pero asegurate de guardar el batch en la ruta '/var/squid/'

        De ahi ya vuelves a prender el squid y a probar.

        Una vez el servicio en linea, en la consola revisas el log de cache y vas a ver algo similar a esto a el final:

        cat logs/cache.log
        2014/09/24 08:31:15| Starting Squid Cache version 3.1.22 for i386-portbld-freebsd8.3…
        2014/09/24 08:31:15| Process ID 34009
        2014/09/24 08:31:15| With 11095 file descriptors available
        2014/09/24 08:31:15| Initializing IP Cache...
        2014/09/24 08:31:15| DNS Socket created at [::], FD 11
        2014/09/24 08:31:15| DNS Socket created at 0.0.0.0, FD 12
        2014/09/24 08:31:15| Adding domain example.local from /etc/resolv.conf
        2014/09/24 08:31:15| Adding nameserver 192.168.2.4 from /etc/resolv.conf
        2014/09/24 08:31:15| User-Agent logging is disabled.
        2014/09/24 08:31:15| Referer logging is disabled.
        2014/09/24 08:31:15| Unlinkd pipe opened on FD 18
        2014/09/24 08:31:15| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
        2014/09/24 08:31:15| Store logging disabled
        2014/09/24 08:31:15| Swap maxSize 262144 + 131072 KB, estimated 30247 objects
        2014/09/24 08:31:15| Target number of buckets: 1512
        2014/09/24 08:31:15| Using 8192 Store buckets
        2014/09/24 08:31:15| Max Mem  size: 131072 KB
        2014/09/24 08:31:15| Max Swap size: 262144 KB
        2014/09/24 08:31:15| Rebuilding storage in /var/squid/cache (DIRTY)
        2014/09/24 08:31:15| Using Least Load store dir selection
        2014/09/24 08:31:15| Current Directory is /usr/local/www
        2014/09/24 08:31:15| Loaded Icons.
        2014/09/24 08:31:15| helperOpenServers: Starting 0/0 'ssl_crtd' processes
        2014/09/24 08:31:15| helperOpenServers: No 'ssl_crtd' processes needed.
        2014/09/24 08:31:15| Accepting  HTTP connections at 192.168.2.32:3128, FD 22.
        2014/09/24 08:31:15| Accepting ICP messages at [::]:7, FD 23.
        2014/09/24 08:31:15| HTCP Disabled.
        2014/09/24 08:31:15| Ready to serve requests.
        2014/09/24 08:31:15| Done scanning /var/squid/cache swaplog (0 entries)
        2014/09/24 08:31:15| Finished rebuilding storage from disk.
        2014/09/24 08:31:15|        0 Entries scanned
        2014/09/24 08:31:15|        0 Invalid entries.
        2014/09/24 08:31:15|        0 With invalid flags.
        2014/09/24 08:31:15|        0 Objects loaded.
        2014/09/24 08:31:15|        0 Objects expired.
        2014/09/24 08:31:15|        0 Objects cancelled.
        2014/09/24 08:31:15|        0 Duplicate URLs purged.
        2014/09/24 08:31:15|        0 Swapfile clashes avoided.
        2014/09/24 08:31:15|  Took 0.06 seconds (  0.00 objects/sec).
        2014/09/24 08:31:15| Beginning Validation Procedure
        2014/09/24 08:31:15|  Completed Validation Procedure
        2014/09/24 08:31:15|  Validated 25 Entries
        2014/09/24 08:31:15|  store_swap_size = 0
        2014/09/24 08:31:16| storeLateRelease: released 0 objects

        Esto me dice que el cache esta listo para recibir objetos, un padre nuestro y a calarlo, saludos.

        Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
        www.bajaopensolutions.com
        https://www.facebook.com/BajaOpenSolutions
        Quieres aprender PfSense, visita mi canal de youtube:
        https://www.youtube.com/c/PedroMorenoBOS

        1 Reply Last reply Reply Quote 0
        • R Offline
          ricardo_1
          last edited by

          Voy a probar lo que me has recomendado Periko. Sinceramente no tengo conocimientos en Linux, comandos básicos ni nada. Voy a ver como crear eso. Puedo usar nano como editor de texto, no?

          Según he visto, sería algo así:

          nano /var/squid/borrar.sh

          Entro al editor y coloco lo siguiente:

          #!/bin/sh

          cd /var/squid
          rm -rf ./cache
          squid -z
          chown -R proxy:proxy cache/

          Luego lo guardo y le agrego el comando para que se convierta en ejecutable:

          chmod +x batch.sh

          Después bajar el servicio de Squid por GUI y rápidamente ejecutar el batch

          ./borrar.sh

          Estaré comentando mis resultados después, nuevamente gracias por la explicación tan detallada.

          1 Reply Last reply Reply Quote 0
          • perikoP Offline
            periko
            last edited by

            Mucho x aprender, nano no existe en el mundo bsd al menos que lo instales.

            Aqui se llama 'ee' o 'vi', vete por ee es mas sencillo, juega un rato con el se aprende rapido.

            No te metas en problemas, ejecutalos a mano uno x uno.

            Saludos.

            Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
            www.bajaopensolutions.com
            https://www.facebook.com/BajaOpenSolutions
            Quieres aprender PfSense, visita mi canal de youtube:
            https://www.youtube.com/c/PedroMorenoBOS

            1 Reply Last reply Reply Quote 0
            • R Offline
              ricardo_1
              last edited by

              Lo ejecute tal como me lo explicaste Periko. Ahora vere que tal va.

              La unica diferencia en lo que me mandaste es que en el mio, al ejecutar cat logs/cache.log, me aparece esta linea de más.

              2014/09/26 21:25:57| Accepting  HTTP connections at 192.168.2.1:3128, FD 22.
              2014/09/26 21:25:57| Accepting  intercepted HTTP connections at 127.0.0.1:3128, FD 23.

              No se que será.

              1 Reply Last reply Reply Quote 0
              • R Offline
                ricardo_1
                last edited by

                Estimado, luego de unos días de pruebas, veo que todavía recibo muchos TCP_MISS/304 y unos cuantos TCP_REFRESH_UNMODIFIED, pero muy pocos.

                1412090589.934     38 192.168.2.43 TCP_MISS/304 371 GET http://acroipm.adobe.com/assets/201.zip - DIRECT/190.116.187.139 application/zip
                1412090589.934     38 192.168.2.43 TCP_MISS/304 371 GET http://acroipm.adobe.com/assets/198.zip - DIRECT/190.116.187.139 application/zip
                1412090589.947     10 192.168.2.43 TCP_MISS/304 370 GET http://acroipm.adobe.com/assets/205.zip - DIRECT/190.116.187.139 application/zip
                1412090590.110      9 192.168.2.43 TCP_MISS/304 371 GET http://acroipm.adobe.com/assets/203.zip - DIRECT/190.116.187.139 application/zip
                1412090590.589  56117 192.168.2.66 TCP_MISS/200 304 GET http://notify7.dropbox.com/subscribe? - DIRECT/108.160.162.98 text/plain
                1412090593.105  55657 192.168.2.54 TCP_MISS/200 304 GET http://notify6.dropbox.com/subscribe? - DIRECT/108.160.162.102 text/plain
                1412090597.332  55501 192.168.2.60 TCP_MISS/200 304 GET http://notify5.dropbox.com/subscribe? - DIRECT/108.160.167.159 text/plain
                1412090599.405  55421 192.168.2.68 TCP_MISS/200 304 GET http://notify3.dropbox.com/subscribe? - DIRECT/108.160.162.109 text/plain
                1412090600.063  55831 192.168.2.47 TCP_MISS/200 304 GET http://notify3.dropbox.com/subscribe? - DIRECT/108.160.162.110 text/plain
                1412090600.095  55211 192.168.2.50 TCP_MISS/200 304 GET http://notify8.dropbox.com/subscribe? - DIRECT/108.160.162.115 text/plain
                1412090601.006  55817 192.168.2.126 TCP_MISS/200 304 GET http://notify10.dropbox.com/subscribe? - DIRECT/108.160.163.109 text/plain
                1412090601.506  55527 192.168.2.25 TCP_MISS/200 304 GET http://notify2.dropbox.com/subscribe? - DIRECT/108.160.167.162 text/plain
                1412090602.775  56069 192.168.2.27 TCP_MISS/200 304 GET http://notify8.dropbox.com/subscribe? - DIRECT/108.160.163.97 text/plain
                1412090607.248   7146 192.168.2.47 TCP_MISS/200 326 GET http://notify3.dropbox.com/subscribe? - DIRECT/108.160.162.110 text/plain
                1412090607.255   4477 192.168.2.27 TCP_MISS/200 326 GET http://notify8.dropbox.com/subscribe? - DIRECT/108.160.163.97 text/plain
                1412090607.260   6245 192.168.2.126 TCP_MISS/200 326 GET http://notify10.dropbox.com/subscribe? - DIRECT/108.160.163.109 text/plain
                1412090609.221  55568 192.168.2.52 TCP_MISS/200 304 GET http://notify9.dropbox.com/subscribe? - DIRECT/108.160.167.166 text/plain
                1412090628.113    193 192.168.2.68 TCP_MISS/206 300595 GET http://download.cdn.mozilla.net/pub/firefox/releases/32.0.3/update/win32/es-ES/firefox-32.0.2-32.0.3.partial.mar - DIRECT/190.116.187.146 application/octet-stream
                1412090634.728  55949 192.168.2.43 TCP_MISS/200 304 GET http://notify10.dropbox.com/subscribe? - DIRECT/108.160.165.181 text/plain
                1412090635.639  55993 192.168.2.59 TCP_MISS/200 304 GET http://notify6.dropbox.com/subscribe? - DIRECT/108.160.167.179 text/plain
                1412090637.031    361 192.168.2.66 TCP_MISS/200 939 GET http://www.pinterest.com/resource/UpdatesResource/get/? - DIRECT/107.21.231.40 application/json
                1412090638.435  55647 192.168.2.58 TCP_MISS/200 304 GET http://notify5.dropbox.com/subscribe? - DIRECT/108.160.166.30 text/plain
                1412090646.090  55498 192.168.2.66 TCP_MISS/200 304 GET http://notify7.dropbox.com/subscribe? - DIRECT/108.160.162.98 text/plain
                1412090648.354  55244 192.168.2.54 TCP_MISS/200 304 GET http://notify6.dropbox.com/subscribe? - DIRECT/108.160.162.102 text/plain
                1412090649.930     41 192.168.2.47 TCP_MISS/304 327 GET http://crl.microsoft.com/pki/crl/products/MicRooCerAut2011_2011_03_22.crl - DIRECT/190.116.187.146 application/pkix-crl
                1412090649.953    428 192.168.2.126 TCP_MISS/200 761 POST http://statsfe2.update.microsoft.com/ReportingWebService/ReportingWebService.asmx - DIRECT/207.46.114.61 text/xml
                1412090649.992      8 192.168.2.47 TCP_REFRESH_UNMODIFIED/304 326 GET http://crl.microsoft.com/pki/crl/products/microsoftrootcert.crl - DIRECT/190.116.187.146 application/pkix-crl
                1412090650.054     10 192.168.2.47 TCP_REFRESH_UNMODIFIED/304 326 GET http://crl.microsoft.com/pki/crl/products/WinPCA.crl - DIRECT/190.116.187.146 application/pkix-crl
                1412090650.253     35 192.168.2.47 TCP_REFRESH_UNMODIFIED/304 293 GET http://pki.google.com/GIAG2.crl - DIRECT/179.6.255.44 -
                1412090650.335      9 192.168.2.47 TCP_MISS/304 327 GET http://crl.microsoft.com/pki/crl/products/CodeSignPCA.crl - DIRECT/190.116.187.146 application/pkix-crl
                1412090653.026  55690 192.168.2.60 TCP_MISS/200 304 GET http://notify5.dropbox.com/subscribe? - DIRECT/108.160.167.159 text/plain
                1412090654.677  55254 192.168.2.68 TCP_MISS/200 304 GET http://notify3.dropbox.com/subscribe? - DIRECT/108.160.162.109 text/plain
                1412090655.919  55819 192.168.2.50 TCP_MISS/200 304 GET http://notify8.dropbox.com/subscribe? - DIRECT/108.160.162.115 text/plain
                1412090656.827  55316 192.168.2.25 TCP_MISS/200 304 GET http://notify2.dropbox.com/subscribe? - DIRECT/108.160.167.162 text/plain
                
                1 Reply Last reply Reply Quote 0
                • perikoP Offline
                  periko
                  last edited by

                  Recuerda que muchos sitios no podran cachearse. prueba entrando por ejemplo:

                  www.freebsd.org
                  www.openbsd.org
                  www.osnews.com

                  Entra varias veces de distintos navegadores, saludos.

                  Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                  www.bajaopensolutions.com
                  https://www.facebook.com/BajaOpenSolutions
                  Quieres aprender PfSense, visita mi canal de youtube:
                  https://www.youtube.com/c/PedroMorenoBOS

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    ricardo_1
                    last edited by

                    Tienes toda la razón Periko.

                    1412097654.596      0 192.168.2.25 TCP_MEM_HIT/200 1666 GET http://cts.tradepub.com/cts/Data/html_validation_rss.js - NONE/- application/x-javascript
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 1437 GET http://www.osnews.com/images/email2.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 1946 GET http://www.osnews.com/images/icons/44.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 381 GET http://img.revresponse.com/spacer.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 644 GET http://img.revresponse.com//rsssub_nw_999999.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 1415 GET http://www.osnews.com/images/printer2.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 1369 GET http://img.revresponse.com//rsssub_emailicon.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 656 GET http://img.revresponse.com//rsssub_ne_999999.gif - NONE/- image/gif
                    1412097654.597      0 192.168.2.25 TCP_MEM_HIT/200 641 GET http://img.revresponse.com//rsssub_sw_999999.gif - NONE/- image/gif
                    1412097654.598      0 192.168.2.25 TCP_MEM_HIT/200 587 GET http://www.osnews.com/images/rec.gif - NONE/- image/gif
                    1412097654.599      0 192.168.2.25 TCP_MEM_HIT/200 1312 GET http://www.osnews.com/img2/shorturl.jpg - NONE/- image/jpeg
                    1412097654.600      0 192.168.2.25 TCP_MEM_HIT/200 1469 GET http://www.osnews.com/images/icons/28.gif - NONE/- image/gif
                    1412097654.600      0 192.168.2.25 TCP_MEM_HIT/200 1751 GET http://www.osnews.com/images/icons/14.gif - NONE/- image/gif
                    1412097654.600      0 192.168.2.25 TCP_MEM_HIT/200 647 GET http://img.revresponse.com//rsssub_se_999999.gif - NONE/- image/gif
                    1412097654.602      0 192.168.2.25 TCP_MEM_HIT/200 783 GET http://www.osnews.com/images/icons/33.gif - NONE/- image/gif
                    1412097654.603      0 192.168.2.25 TCP_MEM_HIT/200 866 GET http://www.osnews.com/images/icons/34.gif - NONE/- image/gif
                    1412097654.603      0 192.168.2.25 TCP_MEM_HIT/200 812 GET http://www.osnews.com/images/icons/52.gif - NONE/- image/gif
                    1412097654.604      0 192.168.2.25 TCP_MEM_HIT/200 2374 GET http://www.osnews.com/images/icons/31.gif - NONE/- image/gif
                    1412097654.604      0 192.168.2.25 TCP_MEM_HIT/200 1464 GET http://www.osnews.com/images/icons/7.gif - NONE/- image/gif
                    1412097654.629      0 192.168.2.25 TCP_MEM_HIT/200 1243 GET http://www.osnews.com/images/left.gif - NONE/- image/gif
                    1412097654.629      0 192.168.2.25 TCP_MEM_HIT/200 483 GET http://www.osnews.com/images/down.gif - NONE/- image/gif
                    

                    Muchas gracias. Sabes a que se debe esto? Es realmente imposible que el proxy haga caché de todo?

                    1 Reply Last reply Reply Quote 0
                    • belleraB Offline
                      bellera
                      last edited by

                      @ricardo_1:

                      Lo ejecute tal como me lo explicaste Periko. Ahora vere que tal va.

                      La unica diferencia en lo que me mandaste es que en el mio, al ejecutar cat logs/cache.log, me aparece esta linea de más.

                      2014/09/26 21:25:57| Accepting  HTTP connections at 192.168.2.1:3128, FD 22.
                      2014/09/26 21:25:57| Accepting  intercepted HTTP connections at 127.0.0.1:3128, FD 23.

                      No se que será.

                      intercepted HTTP connections quiere decir que tu proxy está en modo transparente.

                      1 Reply Last reply Reply Quote 0
                      • belleraB Offline
                        bellera
                        last edited by

                        @ricardo_1:

                        ¿Es realmente imposible que el proxy haga caché de todo?

                        Sí. Hoy en día muchos contenidos son dinámicos y, por tanto, es incluso contraproducente cachearlos.

                        Un proxy mal configurado en ese sentido puede llegar a visualizar páginas "privadas" de otros usuarios de la red.

                        Hay adaptaciones/configuraciones de squid que cachean vídeos. Son adaptaciones que tienen estudiado como funcionan los portales de video habituales…

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          ricardo_1
                          last edited by

                          Muchas gracias por las aclaraciones. Daré por solucionado el caso.

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