Gateway server

Hiện tại gateway server chính thức trở thành server KHÔNG THỂ THIẾU trong Network của mình

Thật ra mà nói em nó đóng nhiều vai trò hơn là Gateway thuần túy.

IP em nó là 192.168.1.4

gatekeeper                  
    description: Mini Tower Computer
    product: HP ProDesk 400 G4 DM (4BC39UT#ABA)
    vendor: HP    
    width: 64 bits

     *-cpu
          description: CPU
          product: Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz
          vendor: Intel Corp.
          physical id: 17
          bus info: cpu@0
          version: Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz
          serial: To Be Filled By O.E.M.
          slot: U3E1
          size: 2642MHz
          capacity: 3500MHz
          width: 64 bits
          clock: 100MHz
           *-storage
                description: Non-Volatile memory controller
                product: NVMe SSD Controller SM981/PM981/PM983
                vendor: Samsung Electronics Co Ltd
                physical id: 0
                bus info: pci@0000:01:00.0
                version: 00
                width: 64 bits
                clock: 33MHz
                capabilities: storage pm msi pciexpress msix nvm_express bus_master cap_list
                configuration: driver=nvme latency=0
                resources: irq:16 memory:f1100000-f1103fff
              *-nvme0
                   description: NVMe device
                   product: SAMSUNG MZVLB256HBHQ-000L7
                   physical id: 0
                   logical name: /dev/nvme0
                   version: 4M2QEXH7
                   serial: S4ELNF6N551448
                   configuration: nqn=nqn.2014.08.org.nvmexpress:144d144dS4ELNF6N551448      SAMSUNG MZVLB256HBHQ-000L7 state=live
           *-network
                description: Ethernet interface
                product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:02:00.0
                logical name: enp2s0
                version: 15
                serial: 84:a9:3e:04:83:1d
                size: 1Gbit/s
                capacity: 1Gbit/s
                width: 64 bits
                clock: 33MHz

Các services mà em nó đang gánh vác

HAProxy

Service cơ bản nhất của Gateway. Nhận toàn bộ requests từ bên ngoài Internet vào và sau đó phân tán ra các máy bên dưới.

frontend http
        bind :80
        mode http

    # ACL
    # Grafana
        acl acl_grafana hdr(host) -i grafana.xcrawler.net
        use_backend be_grafana if acl_grafana

    # Prometheus
        acl acl_prometheus hdr(host) -i prometheus.xcrawler.net
        use_backend be_prometheus if acl_prometheus

    # Alertmanager
        acl acl_alertmanager hdr(host) -i alertmanager.xcrawler.net
        use_backend be_alertmanager if acl_alertmanager

    # HAProxy
        acl acl_haproxy hdr(host) -i haproxy.xcrawler.net
        use_backend be_haproxy if acl_haproxy

    ### SMB
    # Plex
        acl acl_plex hdr(host) -i plex.xcrawler.net
        use_backend be_plex if acl_plex

    # Torrent
        acl acl_torrent hdr(host) -i torrent.xcrawler.net
        use_backend be_torrent if acl_torrent

    # Stable Diffusion
#        acl acl_sd hdr(host) -i sd.xcrawler.net
 #       use_backend be_sd if acl_sd

    # Coffeeschool
        acl acl_coffeeschool hdr(host) -i moodle.coffeeschool.vn api.coffeeschool.vn coffeeschool.vn
        use_backend be_coffeeschool if acl_coffeeschool

        default_backend be_hosting

Mình có các services khác như

  • Grafana
  • Prometheus
  • AlertManager
  • Plex
  • Torrent
  • Stable Diffusion
  • Và 1 số domains

Tất cả domains đều managed bởi Cloudflare. Do đó mình không cần cung cấp SSL ( nên nhưng chưa quá nhất thiết ).

Vì vậy tùy theo từng domain HAProxy sẽ forward requests về server tương ứng

Tuy nhiên setup hiện tại còn nhiều bất cập

Server Software:        Apache
Server Hostname:        192.168.1.4
Server Port:            80

Document Path:          /
Document Length:        17587 bytes

Concurrency Level:      2500
Time taken for tests:   33.020 seconds
Complete requests:      5000
Failed requests:        586
   (Connect: 0, Receive: 0, Length: 586, Exceptions: 0)
Non-2xx responses:      586
Total transferred:      82792318 bytes
HTML transferred:       77692306 bytes
Requests per second:    151.42 [#/sec] (mean)
Time per request:       16510.022 [ms] (mean)
Time per request:       6.604 [ms] (mean, across all concurrent requests)
Transfer rate:          2448.57 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   18  19.4      1      58
Processing:     0 9034 9205.1   3459   32888
Waiting:        0 9033 9205.1   3459   32888
Total:          0 9052 9213.6   3460   32915

Percentage of the requests served within a certain time (ms)
  50%   3460
  66%  14799
  75%  17459
  80%  18885
  90%  21536
  95%  23057
  98%  32279
  99%  32586
 100%  32915 (longest request)

Hiện tại chỉ có thể xử lý 151 requets/ sec. Quá ít !!!

Tất nhiên còn 1 bất cập vật lý : Port 1Gbps. Đó cũng là lý do mình tìm cách switch sang server mới với port 10Gbps hoặc ít nhất cũng 2.5Gbps.

Leave a Reply

Your email address will not be published. Required fields are marked *