美文网首页
Varnish系列之二:服务脚本解析

Varnish系列之二:服务脚本解析

作者: 平平淡淡的猪 | 来源:发表于2018-04-03 15:10 被阅读0次

    [Unit]

    Description=Varnish Cache, a high-performance HTTP accelerator

    After=network.target

    [Service]

    # If you want to make changes to this file, please copy it to

    # /etc/systemd/system/varnish.service and make your changes there.

    # This will override the file kept at /lib/systemd/system/varnish.service

    #

    # Enviroment variables may be found in /etc/varnish/varnish.params

    #

    # Maximum number of open files (for ulimit -n)

    LimitNOFILE=131072

    # Locked shared memory (for ulimit -l)

    # Default log size is 82MB + header

    LimitMEMLOCK=82000

    # On systemd >= 228 enable this to avoid "fork failed" on reload.

    #TasksMax=infinity

    # Maximum size of the corefile.

    LimitCORE=infinity

    EnvironmentFile=/etc/varnish/varnish.params

    Type=forking

    PIDFile=/var/run/varnish.pid

    PrivateTmp=true

    ExecStart=/usr/sbin/varnishd \

    -P /var/run/varnish.pid \

    -f $VARNISH_VCL_CONF \

    -a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \

    -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \

    -S $VARNISH_SECRET_FILE \

    -u $VARNISH_USER -g $VARNISH_GROUP \

    -s $VARNISH_STORAGE \

    $DAEMON_OPTS

    ExecReload=/usr/sbin/varnish_reload_vcl


    参数配置文件:/etc/varnish/varnish.params

    OPTIONS

          -a address[:port][,address[:port][...]

                  Listen  for client requests on the specified address and port.

          -P file

                  Write the process's PID to the specified file.

          -f config

                  Use  the specified VCL configuration file instead of the builtin default.

          -g group

                  Specifies the name of an unprivileged group to which the child process should switch before it starts accepting connections.

          -u user

                  Specifies the name of an unprivileged user to which the child process should switch before it starts accepting connections.

          -S file

                  Path to a file containing a secret used for authorizing access to the management port.

          -T address[:port]

                  Offer a management interface on the specified address and port.

          -s [name=]type[,options]

                  Use the specified storage backend. The storage backends can be one of the following:

                        · malloc[,size]

                        · file[,path[,size[,granularity]]]

                        · persistent,path,size

          -p param=value

                  Set  the  parameter specified by param to the specified value.

    Run-Time Parameters

      Runtime parameters are marked with shorthand flags to avoid repeating the same text over and over in the table below.

      thread_pool_max

          The maximum number of worker threads in each pool.

      thread_pool_min

          The minimum number of worker threads in each pool.

      thread_pool_timeout

          Thread idle threshold.

          Threads in excess of thread_pool_min, which have been idle for at least this long, will be destroyed.

      thread_pools

          Number of worker thread pools.

    相关文章

      网友评论

          本文标题:Varnish系列之二:服务脚本解析

          本文链接:https://www.haomeiwen.com/subject/kvtchftx.html