• 26-08-2017, 01:12:54
    #1
    Arkadaşlar selamlar,

    varnish kurulu bir server'da apache benchmark testi yapıyorum
    ab -c 10 -n 1000 http://www.site.com.tr/
    Bu tarz bir yükte bile site kasıyor yavaşlıyor.

    Donanım 8 core işlemci 32gb ram ssd disk'i mevcut
    Test sırasında donanımda hiç bir kıpırdama kasma yok. Site yavaşlıyor
    Limitlerle alakalı olduğunu düşünüyorum fakat bulamadım

    varnish.x86_64 4.1.8-1.el7 @varnish-4.1 kullanıyorum, şimdiden teşekkürler

    /etc/varnish/varnish.param
    # Varnish environment configuration description. This was derived from
    # the old style sysconfig/defaults settings

    # Set this to 1 to make systemd reload try to switch VCL without restart.
    RELOAD_VCL=1
    #NFILES=3310712
    DAEMON_COREFILE_LIMIT="unlimited"
    #MEMLOCK=8200000
    #VARNISH_MAX_THREADS=100000
    #VARNISH_THREAD_TIMEOUT=120
    VARNISHNCSA_ENABLED=1
    NFILES=-n
    MEMLOCK=-l

    # Set WARMUP_TIME to force a delay in reload-vcl between vcl.load and vcl.use
    # This is useful when backend probe definitions need some time before declaring
    # configured backends healthy, to avoid routing traffic to a non-healthy backend.
    #WARMUP_TIME=0
    VARNISH_TTL=120

    # Main configuration file. You probably want to change it.
    VARNISH_VCL_CONF=/etc/varnish/default.vcl

    # Default address and port to bind to. Blank address means all IPv4
    # and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
    # quad, or an IPv6 address in brackets.
    VARNISH_LISTEN_ADDRESS=87.98.220.184
    VARNISH_LISTEN_PORT=80

    # Admin interface listen address and port
    VARNISH_ADMIN_LISTEN_ADDRESS=87.98.220.184
    #VARNISH_ADMIN_LISTEN_PORT=6085

    # Shared secret file for admin interface
    VARNISH_SECRET_FILE=/etc/varnish/secret

    # Backend storage specification, see Storage Types in the varnishd(5)
    # man page for details.
    VARNISH_STORAGE="malloc,10G"

    # User and group for the varnishd worker processes
    VARNISH_USER=varnish
    DAEMON_OPTS=" -p workspace_client=512k -p thread_queue_limit=30000 -p thread_pools=2 -p lru_interval=60 -p listen_depth=65535 -p ping_interval=2 -p thread_pool_min==500 -p thread_pool_max=30000 -p thread_pool_timeout=300 -p thread_pool_add_delay=1"



    /etc/varnish/default.vcl
    .max_connections = 90000; # That's it
    .interval = 5s; # check the health of each backend every 5 seconds
    .timeout = 1s; # timing out after 1 second.
    .window = 61; # If 3 out of the last 5 polls succeeded the backend is considered healthy, otherwise it will be marked as sick
    .threshold = 2;
    }
    .first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend?
    .connect_timeout = 600s; # How long to wait for a backend connection?
    .between_bytes_timeout = 600s; # How long to wait between bytes received from our backend?


    /etc/sysctl.conf
    fs.file-max = 900000
    net.ipv4.tcp_timestamps=1
    net.ipv4.tcp_tw_recycle=0
    net.ipv4.tcp_tw_reuse=1
    net.ipv4.tcp_max_tw_buckets=1440000
    net.ipv4.ip_local_port_range = 512 65535
    net.core.somaxconn = 61440
    net.core.rmem_max = 12582912
    net.core.wmem_default = 31457280
    net.core.wmem_max = 12582912
    net.ipv4.tcp_keepalive_time = 300
    net.ipv4.tcp_keepalive_probes = 5
    net.ipv4.tcp_keepalive_intvl = 15
    net.ipv4.tcp_fin_timeout = 15
    net.ipv4.tcp_rfc1337 = 1
    net.core.optmem_max = 25165824
    net.ipv4.tcp_mem = 65536 131072 262144
    net.ipv4.udp_mem = 65536 131072 262144
    net.ipv4.tcp_rmem = 8192 87380 16777216
    net.ipv4.udp_rmem_min = 66384
    net.ipv4.tcp_wmem = 8192 65536 16777216
    net.ipv4.udp_wmem_min = 86384
    net.ipv4.xfrm4_gc_thresh = 82768



    /etc/security/limits.conf
    root soft nofile 100000
    root hard nofile 200000
    root soft memlock 100000
    root hard memlock 200000
  • 30-08-2017, 14:05:29
    #2
    huseyincengiz adlı üyeden alıntı: mesajı görüntüle
    Arkadaşlar selamlar,

    varnish kurulu bir server'da apache benchmark testi yapıyorum
    ab -c 10 -n 1000 http://www.site.com.tr/
    Bu tarz bir yükte bile site kasıyor yavaşlıyor.

    Donanım 8 core işlemci 32gb ram ssd disk'i mevcut
    Test sırasında donanımda hiç bir kıpırdama kasma yok. Site yavaşlıyor
    Limitlerle alakalı olduğunu düşünüyorum fakat bulamadım

    varnish.x86_64 4.1.8-1.el7 @varnish-4.1 kullanıyorum, şimdiden teşekkürler

    /etc/varnish/varnish.param
    # Varnish environment configuration description. This was derived from
    # the old style sysconfig/defaults settings

    # Set this to 1 to make systemd reload try to switch VCL without restart.
    RELOAD_VCL=1
    #NFILES=3310712
    DAEMON_COREFILE_LIMIT="unlimited"
    #MEMLOCK=8200000
    #VARNISH_MAX_THREADS=100000
    #VARNISH_THREAD_TIMEOUT=120
    VARNISHNCSA_ENABLED=1
    NFILES=-n
    MEMLOCK=-l

    # Set WARMUP_TIME to force a delay in reload-vcl between vcl.load and vcl.use
    # This is useful when backend probe definitions need some time before declaring
    # configured backends healthy, to avoid routing traffic to a non-healthy backend.
    #WARMUP_TIME=0
    VARNISH_TTL=120

    # Main configuration file. You probably want to change it.
    VARNISH_VCL_CONF=/etc/varnish/default.vcl

    # Default address and port to bind to. Blank address means all IPv4
    # and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
    # quad, or an IPv6 address in brackets.
    VARNISH_LISTEN_ADDRESS=87.98.220.184
    VARNISH_LISTEN_PORT=80

    # Admin interface listen address and port
    VARNISH_ADMIN_LISTEN_ADDRESS=87.98.220.184
    #VARNISH_ADMIN_LISTEN_PORT=6085

    # Shared secret file for admin interface
    VARNISH_SECRET_FILE=/etc/varnish/secret

    # Backend storage specification, see Storage Types in the varnishd(5)
    # man page for details.
    VARNISH_STORAGE="malloc,10G"

    # User and group for the varnishd worker processes
    VARNISH_USER=varnish
    DAEMON_OPTS=" -p workspace_client=512k -p thread_queue_limit=30000 -p thread_pools=2 -p lru_interval=60 -p listen_depth=65535 -p ping_interval=2 -p thread_pool_min==500 -p thread_pool_max=30000 -p thread_pool_timeout=300 -p thread_pool_add_delay=1"



    /etc/varnish/default.vcl
    .max_connections = 90000; # That's it
    .interval = 5s; # check the health of each backend every 5 seconds
    .timeout = 1s; # timing out after 1 second.
    .window = 61; # If 3 out of the last 5 polls succeeded the backend is considered healthy, otherwise it will be marked as sick
    .threshold = 2;
    }
    .first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend?
    .connect_timeout = 600s; # How long to wait for a backend connection?
    .between_bytes_timeout = 600s; # How long to wait between bytes received from our backend?


    /etc/sysctl.conf
    fs.file-max = 900000
    net.ipv4.tcp_timestamps=1
    net.ipv4.tcp_tw_recycle=0
    net.ipv4.tcp_tw_reuse=1
    net.ipv4.tcp_max_tw_buckets=1440000
    net.ipv4.ip_local_port_range = 512 65535
    net.core.somaxconn = 61440
    net.core.rmem_max = 12582912
    net.core.wmem_default = 31457280
    net.core.wmem_max = 12582912
    net.ipv4.tcp_keepalive_time = 300
    net.ipv4.tcp_keepalive_probes = 5
    net.ipv4.tcp_keepalive_intvl = 15
    net.ipv4.tcp_fin_timeout = 15
    net.ipv4.tcp_rfc1337 = 1
    net.core.optmem_max = 25165824
    net.ipv4.tcp_mem = 65536 131072 262144
    net.ipv4.udp_mem = 65536 131072 262144
    net.ipv4.tcp_rmem = 8192 87380 16777216
    net.ipv4.udp_rmem_min = 66384
    net.ipv4.tcp_wmem = 8192 65536 16777216
    net.ipv4.udp_wmem_min = 86384
    net.ipv4.xfrm4_gc_thresh = 82768



    /etc/security/limits.conf
    root soft nofile 100000
    root hard nofile 200000
    root soft memlock 100000
    root hard memlock 200000
    vcl nin düzeltilmesi gerekiyor bu şekilde zaten bir işinize yaramaz.