2013-09-28 09:00:07 +08:00
|
|
|
|
|
|
|
|
|
service server {
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程是否禁止运行
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_disable = no
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 服务地址及端口号
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_service = 127.0.0.1:5001
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 服务监听为域套接口
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_service = aio_echo.sock
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 服务类型
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_type = inet
|
|
|
|
|
# master_type = unix
|
|
|
|
|
# master_type = sock
|
|
|
|
|
master_type = udp
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 停止子进程时是否采用强行停止的方式(即给子进程发送 SIGTERM 信号)
|
2017-09-11 22:34:56 +08:00
|
|
|
|
master_stop_kill = false
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 当 master_stop_kill 为 true 时,该配置决定是否要等待子进程退出
|
2017-09-11 22:34:56 +08:00
|
|
|
|
master_stop_wait = false
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 当子进程异常退出时,如果该值非空,则将子进程异常退出的消息通知该服务
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_notify_addr = 127.0.0.1:5801
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 邮件通知接收者
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_notify_recipients = zhengshuxin@hotmail.com:13910404316
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 是否允许延迟接受客户端连接,如果为0则表示关闭该功能,如果大于0则表示打开此功能
|
|
|
|
|
# 并且此值代表延迟接受连接的超时值,超过此值时如果客户端依然没有发来数据,则操作
|
|
|
|
|
# 系统会在系统层直接关闭该连接
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_defer_accept = 0
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 是否只允许私有访问, 如果为 y, 则域套接口创建在 {install_path}/var/log/private/ 目录下,
|
|
|
|
|
# 如果为 n, 则域套接口创建在 {install_path}/var/log/public/ 目录下,
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_private = n
|
|
|
|
|
master_unpriv = n
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 是否需要 chroot: n -- no, y -- yes
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_chroot = n
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 每隔多长时间触发一次,单位为秒(仅对 trigger 模式有效)
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_wakeup = -
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 最大进程数
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_maxproc = 1
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 需要预先启动的进程数,该值不应大于 master_maxproc
|
2017-06-20 14:07:45 +08:00
|
|
|
|
master_prefork = 1
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程程序名
|
2013-09-28 09:00:07 +08:00
|
|
|
|
master_command = $<PROGRAM>
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程日志记录文件
|
2017-07-05 10:27:33 +08:00
|
|
|
|
master_log = {install_path}/var/log/$<PROGRAM>
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 调试日志方式,格式:tag:level; tag:level; tab:level, 如:all:1; 101:2
|
2013-11-05 22:23:23 +08:00
|
|
|
|
# master_debug =
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程启动参数,只能为: -u [是否允许以某普通用户的身份运行]
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_args =
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 传递给服务子进程的环境变量, 可以通过 getenv("SERVICE_ENV") 获得此值
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# master_env = mempool_limit:512000000
|
|
|
|
|
# master_env = logme:FALSE, priority:E_LOG_INFO, action:E_LOG_PER_DAY, flush:sync_flush, imit_size:512,\
|
|
|
|
|
# sync_action:E_LOG_SEM, sem_name:/tmp/udp_echo.sem
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 启动时创建的固定线程数
|
2017-07-05 14:31:18 +08:00
|
|
|
|
udp_threads = 1
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 创建的线程是否为分离模式
|
2017-07-10 12:22:09 +08:00
|
|
|
|
# udp_threads_detached = 1
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 是否允许产生 core 文件
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# udp_enable_core = 1
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 每个进程实例处理连接数的最大次数,超过此值后进程实例主动退出
|
2017-07-05 10:27:33 +08:00
|
|
|
|
udp_use_limit = 0
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 每个进程实例的空闲超时时间,超过此值后进程实例主动退出
|
2017-07-05 10:27:33 +08:00
|
|
|
|
udp_idle_limit = 0
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 记录进程PID的位置(对于多进程实例来说没有意义)
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_pid_dir = {install_path}/var/pid
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程运行时所在的路径
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_queue_dir = {install_path}/var
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 读写超时时间, 单位为秒
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_rw_timeout = 120
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 读缓冲区的缓冲区大小
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_buf_size = 8192
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 每次 accept 时的循环接收的最大次数
|
2013-10-19 23:13:19 +08:00
|
|
|
|
# udp_max_accept = 25
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 在并发访问量非常低的情况下,如访问量在 10 次/秒 以下时,可以找开此值(即赋为1),以加速事件循环过程,
|
|
|
|
|
# 从而防止服务进程阻塞在 select 上的时间过长而影响访问速度
|
2013-09-28 09:00:07 +08:00
|
|
|
|
# udp_enable_dog = 0
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 进程运行时的用户身份
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_owner = root
|
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 用 select 进行循环时的时间间隔
|
|
|
|
|
# 单位为秒
|
2013-10-19 23:13:19 +08:00
|
|
|
|
# udp_delay_sec = 0
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 单位为微秒
|
2013-10-19 23:13:19 +08:00
|
|
|
|
# udp_delay_usec = 500
|
2013-09-28 09:00:07 +08:00
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 采用事件循环的方式: select(default), poll, kernel(epoll/devpoll/kqueue)
|
2013-10-19 23:13:19 +08:00
|
|
|
|
# udp_event_mode = select
|
2013-09-28 09:00:07 +08:00
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 允许访问 udserver 的客户端IP地址范围
|
2013-10-19 23:13:19 +08:00
|
|
|
|
# udp_access_allow = 127.0.0.1:255.255.255.255, 127.0.0.1:127.0.0.1
|
2013-09-28 09:00:07 +08:00
|
|
|
|
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 当 acl_master 退出时,如果该值置1则该程序不等所有连接处理完毕便立即退出
|
2013-09-28 09:00:07 +08:00
|
|
|
|
udp_quick_abort = 1
|
|
|
|
|
|
|
|
|
|
############################################################################
|
2017-12-08 09:36:06 +08:00
|
|
|
|
# 应用自己的配置选项
|
2013-09-28 09:00:07 +08:00
|
|
|
|
}
|