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

    Optimalisasi Setting pfSense 1.2.x Traffic Shaping dgn Squid Transparent Proxy

    Scheduled Pinned Locked Moved Indonesian
    42 Posts 18 Posters 46.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.
    • A
      anto_DIGIT
      last edited by

      @xaviero:

      ]]Tapi terus terang trimakasih juga  Smiley , karena selama ini pakai delay pools ternyata extension file-nya masih banyak yg harus ditambah.

      hhhmm, berdasarkan keterangan diatas, berarti ente memanfaatkan ekstensi sebagai kondisi delay pool, nah lebih bagus kalo ente tambahin satu rule lagi, di traffis shaping, bagian untuk p2p, kasi ajah jatah download/upload sekian Kbps

      1 user yg download beberapa file sekaligus dng extension berbeda, speednya tdk berkurang, tetapi dng 2 download yg speednya sama sehingga menghasiskan BW 2x dari yg telah diatur dlm delay pools.
      Bagaimana jika 2 atau lebih client download file dng extension yg sama?

      so far, yang telah ane implementasikan untuk kelas sedoter, jika menggunakan port 80 maka dikunci di delay pool, begitu juga dengan p2p.
      nah ke dua rule tersebut ane kunci di queue traffic shaper di 256kbps, dengan burst 10mbps selama 5 detik… (untuk tujuan ngambil di proxy)
      delay pool ane kunci di angka 10KBps untuk per host throttle

      intinya, ane make delay pool dan shaper untuk optimalisasi b/w cache proxy dan b/w WAN, biar adil sesuai penggunaan. btw berikut prio ane

      1. Game online
      2. Browsing
      3. Chatter/email
      4. Sedoter

      Bung, utk pengaturan BW melalui delay pools, sudah diaplikasikan dan memang terlimit dng baik tapi masalahnya kalau di lilihat melalui RRD graph di bagian traffic WAN dan LAN, sepertinya justru traffic WAN lebih tinggi.
      Apa ini mungkin pengaruh dari :

      • Sebenarnya squid tetap mendownload dng kecepatan penuh file yg diminta oleh client, tetapi squid membatasi kecepatan ke client dengan menunda pengiriman segment2 file tsb ke client. Apa betul seperti ini ?
      1 Reply Last reply Reply Quote 0
      • X
        xaviero
        last edited by

        traffic WAN ente, upload pa download yang lebih tinggi ???
        kalo upload, emang begitu adanya… (normal)
        kalo download, cek dulu, apa ada jalanin service auto-update pfsense nya.... (entah system, entah module)

        1 Reply Last reply Reply Quote 0
        • A
          anto_DIGIT
          last edited by

          @xaviero:

          traffic WAN ente, upload pa download yang lebih tinggi ???
          kalo upload, emang begitu adanya… (normal)
          kalo download, cek dulu, apa ada jalanin service auto-update pfsense nya.... (entah system, entah module)

          ini kutipan dari bung Faisal di forum KIOSS http://opensource.telkomspeedy.com/forum/viewtopic.php?pid=51922:

          squid delaypoll membatasi bandwidth di application layer, prinsipnya proxy server squid mendownload file dengan kecepatan penuh, kemudian mengirimkannya ke client dengan termin-termin waktu yang di delay
          berbeda dengan queing discipline yang dilakukan oleh kernel, (htb, cbq, pfifo, bfifo, sfq, esfq, red dan lainnya).
          klasifikasi, antrian dan keluar masuknya paket, di handle oleh network interface card (hardware) yang tentunya diatur oleh kernel, mengtatur jumlah bits in/out, mengatur ingress/engress secara langsung, sehingga lebih presisi.
          untuk performansi pengaturan bandwith yang lebih baik, disarankan untuk menerapkan metode limiter dengan pengaturan qdisc

          sistem PFS 2.0 beta (11 Juni 2010)
          Paket Game 1Mbps

          paket yg terinstall :

          • squid / lusca head
          • Lightsquid
          • phpSysInfo
            Sepertinya tdk ada update apa2.

          Work Period: Jun 2010
          Date Group Users Oversize Bytes Average Hit %
          15 Jun 2010 grp 10 7 294.5 M 29.5 M 58.27%
          14 Jun 2010 grp 21 14 1.6 G 75.9 M 47.23%
          13 Jun 2010 grp 30 21 1.9 G 64.0 M 32.64%
          12 Jun 2010 grp 20 15 2.9 G 146.6 M 27.02%
          11 Jun 2010 grp 18 15 2.6 G 150.7 M 23.01%
          10 Jun 2010 grp 18 12 2.4 G 137.4 M 32.00%
          09 Jun 2010 grp 21 14 2.0 G 97.8 M 25.57%
          08 Jun 2010 grp 20 11 943.5 M 47.2 M 17.82%
          07 Jun 2010 grp 22 16 1.8 G 83.4 M 19.80%
          06 Jun 2010 grp 23 19 2.5 G 109.4 M 19.72%
          05 Jun 2010 grp 23 15 3.6 G 161.0 M 5.49%
          04 Jun 2010 grp 15 6 219.2 M 14.6 M 6.26%
          Total/Average:   20 13 22.7 G 93.1 M 26.24%

          ini
          quick_abort_min 0 KB
          quick_abort_max 0 KB
          request_body_max_size 72000 KB
          reply_body_max_size 737280000 allow all
          delay_pools 1
          delay_class 1 2
          delay_parameters 1 61440/61440 25600/25600
          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 all

          BW control cativeportal UP : 90Kbit/s Down : 256Kbit/s

          1 Reply Last reply Reply Quote 0
          • A
            anto_DIGIT
            last edited by

            setelah delay pool dimatikan, ternyata grafik LAN dan WAN jadi normal
            Sebelumnya bahkan jumlah traffic WAN > LAN, padahal tdk ada update / auto update.
            Kemungkinan besar :

            • Dengan delay pool Squid mendownload semua permintaan client dengan kecepatan penuh dan mengirimkan ke client dng dibatasi alirannya .. padahal banyak kemungkinan client membatalkan permintaan tadi sebelum semua data sampai ke client (padahal mungkin squid sudah selesai atau hampir selesai download).
            • Ini ternyata membuat aliran tidak efisien karena banyak yg sia-sia ..

            Atau rekan-rekan punya pendapat lain ?

            1 Reply Last reply Reply Quote 0
            • X
              xaviero
              last edited by

              reply_body_max_size 737280000 allow all

              gede amir….

              kalo limitnya 737GB  yah semuanya kedonlod lah brow...

              ganti ama 5x1024KB=5120 ajah aliad 5MB

              coba bayangin, reply_body_max nya di setel 737GB yang berarti kalo ada file lebih besar dari 737GB baru dilimit ? ? ?  ::) ::) ::)

              Tag Name  reply_body_max_size
              Usage reply_body_max_size (KB)

              Description
              This option specifies the maximum size of a reply body. It can be used to prevent users from downloading very large files, such as MP3's and movies. The reply size is checked twice. First when we get the reply headers, we check the content-length value. If the content length value exists and is larger than this parameter, the request is denied and the user receives an error message that says "the request or reply is too large." If there is no content-length, and the reply size exceeds this limit, the client's connection is just closed and they will receive a partial reply.

              begitu juga dengan request_body nya, kecilin di 1MB

              1 Reply Last reply Reply Quote 0
              • A
                anto_DIGIT
                last edited by

                @xaviero:

                reply_body_max_size 737280000 allow all

                gede amir….

                kalo limitnya 737GB  yah semuanya kedonlod lah brow...

                ganti ama 5x1024KB=5120 ajah aliad 5MB

                coba bayangin, reply_body_max nya di setel 737GB yang berarti kalo ada file lebih besar dari 737GB baru dilimit ? ? ?  ::) ::) ::)

                Tag Name  reply_body_max_size
                Usage reply_body_max_size (KB)

                Description
                This option specifies the maximum size of a reply body. It can be used to prevent users from downloading very large files, such as MP3's and movies. The reply size is checked twice. First when we get the reply headers, we check the content-length value. If the content length value exists and is larger than this parameter, the request is denied and the user receives an error message that says "the request or reply is too large." If there is no content-length, and the reply size exceeds this limit, the client's connection is just closed and they will receive a partial reply.

                begitu juga dengan request_body nya, kecilin di 1MB

                wah itu generated otomatis dari GUI-nya … tapi skrg udah ga dipakai lagi ... udah bisa pakai squid ZPH ..  ;D
                Kalau mau salahin .. salahin developer paket squid-nya ...
                tapi terus terang itu sudah terlimit, walaupun download hanya 1MB, 10MB, atau 200MB .. tdk usah nunggu 737GB ...

                Sesuai dng kata master Faisal :
                squid delaypoll membatasi bandwidth di application layer, prinsipnya proxy server squid mendownload file dengan kecepatan penuh, kemudian mengirimkannya ke client dengan termin-termin waktu yang di delay.

                Setelah menggunakan ZPH, benar2 terasa performance dan efisiensi BW-nya ..

                WAN
                In/out packets  6622666/6576202 (5.56 GB/724.75 MB)
                In/out packets (pass) 6574163/6885722 (5.56 GB/724.66 MB)
                In/out packets (block) 48503/2039 (4.87 MB/93 KB)

                LAN
                In/out packets  7544126/7465165 (895.24 MB/9.16 GB)
                In/out packets (pass) 7463028/10597412 (887.36 MB/9.16 GB)
                In/out packets (block) 81098/2137 (7.88 MB/246 KB)

                Ini baru bener  ...  paket keluar di LAN hampir 2x WAN ..

                1 Reply Last reply Reply Quote 0
                • P
                  poscom
                  last edited by

                  @kambeeng:

                  Buka kan port dari LAN di firewall Rule nya

                  waduh pak dah 8x lebih sy instal ulang pfsensenya gara2 yg diatas, tolong pak permintaan 1 kali saja, tolong jelaskan/perlihatkan (gambar/video) buat di firewall rules contohnya ip saya 192.168.101.x, tolong pak agar kami bisa mengerti

                  ini yah ?:

                  ![firewall rules.JPG](/public/imported_attachments/1/firewall rules.JPG)
                  ![firewall rules.JPG_thumb](/public/imported_attachments/1/firewall rules.JPG_thumb)

                  1 Reply Last reply Reply Quote 0
                  • C
                    cheenix
                    last edited by

                    @dedieko:

                    Hanya ingin memberitahu jika saya sudah mengapplied "MOD" seperti ini sejak jaman pfsense 1.2REL dengan SQUID 2.6, dan dari dulu sehat sehat saja :)

                    Bagi yang masih belum paham mana yang diganti, berikut line2-nya yang harus diMOD

                    }
                    if (($settings['transparent_proxy'] == 'on')) {
                    $conf .= "http_port 127.0.0.1:80 transparent\n";
                    }

                    acl localhost src 127.0.0.1/255.255.255.255

                    }     
                    foreach ($ifaces as $iface) {
                    $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> 127.0.0.1 port 80\n";
                    }

                    Ganti semua 127.0.0.1 dengan IP LAN pfsense Anda. Tapi mohon diingat kalo mod ini membuat SQUIDnya listen di IP LAN tadi, jadi kalau ganti IP LAN, jangan lupa, line2 di atas disesuaikan ya….
                    Jangan lupa merestart SQUIDnya

                    semua seperti perintah si atasdah saya jalankan… dan berhasil.. cuman saya gak bisa lagi akses ke cache manager... gimana mas pemecahannya.. mohon pencerahannya...

                    1 Reply Last reply Reply Quote 0
                    • C
                      cingkes
                      last edited by

                      Maaf kalau masalah saya sudah pernah dibahas tolong diarahkan linknya.

                      sy br buka warnet aktifitas sehari2x game  ;D baru x ini jd serius ??? jd bc diinternet ada pfsense trus coba diinstall untuk server proxy/cache.

                      mesin sy p4 2,6 Ghz, 512 RAM DDR1 PC3200, 40 G HDD IDE 5300 rpm
                      dengan pfsense 123-release dgn squid 2.7.x

                      settingan msh standart.
                      tolong dikoreksi konfigurasi yg sy punya
                      soalnya TCP_HIT jarang sekali ketemu. rata-rata cuma ke statis sj yg HIT.
                      Tolong para suhu bantu saya mana yang kurang dari config squid ini.
                      soalnya saya mau juga bisa buatin Internet jadi wuz.wuz..wuz

                      vi squid.conf

                      –-----------------

                      Do not edit manually !

                      http_port 192.168.3.2:3128
                      http_port 127.0.0.1:80 transparent
                      icp_port 0

                      pid_filename /var/run/squid.pid
                      cache_effective_user proxy
                      cache_effective_group proxy
                      error_directory /usr/local/etc/squid/errors/English
                      icon_directory /usr/local/etc/squid/icons
                      visible_hostname localhost
                      cache_mgr admin@localhost
                      access_log /var/squid/logs/access.log
                      cache_log /var/squid/logs/cache.log
                      cache_store_log none
                      shutdown_lifetime 5 seconds

                      Allow local network(s) on interface(s)

                      acl localnet src  192.168.3.0/255.255.255.0
                      forwarded_for off
                      via off
                      httpd_suppress_version_string on
                      uri_whitespace strip

                      cache_mem 6 MB
                      maximum_object_size_in_memory 32 KB
                      memory_replacement_policy heap GDSF
                      cache_replacement_policy heap LFUDA
                      cache_dir aufs /var/squid/cache 5000 16 256
                      minimum_object_size 5 KB
                      maximum_object_size 1500 KB
                      offline_mode off
                      cache_swap_low 90
                      cache_swap_high 95

                      No redirector configured

                      Setup some default acls

                      acl all src 0.0.0.0/0.0.0.0
                      acl localhost src 127.0.0.1/255.255.255.255
                      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 dynamic urlpath_regex cgi-bin ?
                      cache deny dynamic
                      http_access allow manager localhost

                      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

                      request_body_max_size 0 KB
                      reply_body_max_size 0 allow all
                      delay_pools 1
                      delay_class 1 2
                      delay_parameters 1 -1/-1 -1/-1
                      delay_initial_bucket_level 100
                      delay_access 1 allow all

                      Allow local network(s) on interface(s)

                      http_access allow localnet

                      Default block all to be sure

                      http_access deny all


                      squidclient -p 80 cache_object://192.168.3.2/info


                      HTTP/1.0 200 OK
                      Server: squid
                      Date: Mon, 13 Sep 2010 11:16:55 GMT
                      Content-Type: text/plain
                      Expires: Mon, 13 Sep 2010 11:16:55 GMT
                      X-Cache: MISS from localhost
                      X-Cache-Lookup: MISS from localhost:3128
                      Connection: close

                      Squid Object Cache: Version 2.7.STABLE9
                      Start Time:    Mon, 13 Sep 2010 02:06:39 GMT
                      Current Time:  Mon, 13 Sep 2010 11:16:55 GMT
                      Connection information for squid:
                              Number of clients accessing cache:      10
                              Number of HTTP requests received:      105342
                              Number of ICP messages received:        0
                              Number of ICP messages sent:    0
                              Number of queued ICP replies:  0
                              Number of HTCP messages received:      0
                              Number of HTCP messages sent:  0
                              Request failure ratio:  0.00
                              Average HTTP requests per minute since start:  191.4
                              Average ICP messages per minute since start:    0.0
                              Select loop called: 2602614 times, 12.686 ms avg
                      Cache information for squid:
                              Request Hit Ratios:    5min: 1.1%, 60min: 3.5%
                              Byte Hit Ratios:        5min: 1.7%, 60min: 23.9%
                              Request Memory Hit Ratios:      5min: 0.0%, 60min: 7.0%
                              Request Disk Hit Ratios:        5min: 60.0%, 60min: 70.6%
                              Storage Swap size:      265686 KB
                              Storage Mem size:      6124 KB
                              Mean Object Size:      26.98 KB
                              Requests given to unlinkd:      0
                      Median Service Times (seconds)  5 min    60 min:
                              HTTP Requests (All):  0.27332  0.42149
                              Cache Misses:          0.25890  0.44492
                              Cache Hits:            0.00000  0.00379
                              Near Hits:            0.00000  0.17711
                              Not-Modified Replies:  0.00000  0.00000
                              DNS Lookups:          0.06083  0.06657
                              ICP Queries:          0.00000  0.00000
                      Resource usage for squid:
                              UP Time:        33016.692 seconds
                              CPU Time:      201.896 seconds
                              CPU Usage:      0.61%
                              CPU Usage, 5 minute avg:        0.26%
                              CPU Usage, 60 minute avg:      0.36%
                              Process Data Segment Size via sbrk(): 0 KB
                              Maximum Resident Size: 27808 KB
                              Page faults with physical i/o: 0
                      Memory accounted for:
                              Total accounted:        12560 KB
                              memPoolAlloc calls: 15075351
                              memPoolFree calls: 15039747
                      File descriptor usage for squid:
                              Maximum number of file descriptors:  7207
                              Largest file desc currently in use:    69
                              Number of file desc currently in use:  60
                              Files queued for open:                  0
                              Available number of file descriptors: 7147
                              Reserved number of file descriptors:  100
                              Store Disk files open:                  0
                              IO loop method:                    kqueue
                      Internal Data Structures:
                              10000 StoreEntries
                                599 StoreEntries with MemObjects
                                597 Hot Object Cache Items
                                9848 on-disk objects

                      sebelumnya terima kasih

                      1 Reply Last reply Reply Quote 0
                      • G
                        gladizxx
                        last edited by

                        Kalo untuk Bittorrent.. yg port nya random.. apa bisa …squid nya mengatasi ..ya....  ;D

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