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

[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.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,984评论 0 0
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,800评论 0 10
  • =========================================================...
    lavor阅读 3,636评论 0 5
  • 1.介绍 运维日常: 2.Web Page Cache: varnish2.0,3.0处理过程 varnish4....
    尛尛大尹阅读 3,469评论 0 0
  • 还有5天。一颗焦躁不安的心,甚至不知道自己为什么会这样。1分8秒。该用怎么样的心情来体会这还没开始就停止的视频。是...
    葉書阅读 179评论 0 0

友情链接更多精彩内容