-
Notifications
You must be signed in to change notification settings - Fork 20
/
wheatserver.conf
296 lines (254 loc) · 9.29 KB
/
wheatserver.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# wheatserver configuration file example
########################################################################
############################## General #################################
########################################################################
# Specify your protocol module name
# Now support `Redis`, `Http`, `Memcache`
# default: Http
protocol Http
# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
# defaut 127.0.0.1
bind-addr 127.0.0.1
# Accept connections on the specified port, default is 10828.
#
# default 10828
port 10828
# Special usage: Wheatserver mainly used as a proxy, so it combine the
# actual application servers and construct a opaque pool. Wheatserver
# needs to provide muilti-tenant function and it uses bind port as the
# separator.
# defaut NULL
#
# Example:
# port-range-start 20000
# port-range-end 30000
# The worker process you want, the number is influenced by your core
# number.
# Max number: 1024
#
# default 4
worker-number 4
# The type of worker to use: SyncWorker/AsyncWorker
#
# SyncWorker: The most basic and the default worker type is a synchronous
# worker class that handles a single request at a time. This model is the
# simplest to reason about as any errors will affect at most a single request.
# Though as we describe below only processing a single request at a time
# requires some assumptions about how applic
#
# Async Workers: The asynchronous workers available are based on Event Drive
# Library.
#
# In general, an application should be able to make use of these worker
# classes with no changes.
# It is likely to use AsyncWorker to deployment and use SyncWorker to develop
# in ease.
#
# default SyncWorker
worker-type AsyncWorker
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
#
# default stdout
# logfile /tmp/wheatserver.log
# Set server verbosity to debug or watch
# it can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
#
# default notice
logfile-level debug
# Daemonize the process.
# Detaches the server from the controlling terminal and enters the background.
#
# default off
daemon off
# A filename to use for the PID file.
# If not set, no PID file will be written.
#
# default: Not Write Pid File
pidfile /tmp/wheatserver.pid
# The following option sets a timeout for worker handle request.
# If worker is no response in `timeout`, master will kill this worker.
#
# It is important to make sure that this value is greater than the value
# specified for stat-refresh-time otherwise a timeout will be detected
# every time there is low traffic between the master and the slave.
# Master detect timeout worker rely on statistic info response!
# Recommend value: 2*stat-refresh-time
#
# default: 30
timeout-seconds 30
# The max client connection limits the outcoming client, if exceed the limits,
# connection will failed to accept and build.
#
# default: 4096
max-client-limits 4096
# Advanced option
# Set size of mbuf chunk in bytes
#
# default: 16384(16384)
mbuf-size 16384
# Advanced option
# Set the internal buffer size for each client request content in order to
# avoid much data attack.
# If you plan to receive big requests with lots of headers or user may upload
# big file you can increase this value up to 16777216 (16M).
# set `0` means no limit.
#
# default: 4194304(4M)
max-buffer-size 4194304
########################################################################
############################### Statistic ##############################
########################################################################
# Enable the stats server on the specified address.
#
# defaut: 127.0.0.1
stat-bind-addr 127.0.0.1
# Enable the stats server on the specified port.
#
# default: 10829
stat-port 10829
# Statistic information refresh time, master process receive information
# from workers every `stat-refresh-time` seconds.
#
# default: 5
stat-refresh-time 5
# Statistic information output file, if NULL, statistic information will be
# output to `logfile`
#
# default: NULL
stat-file NULL
########################################################################
################################# Http #################################
########################################################################
# Specify document root path
#
# default: NULL
document-root example
# The Access log file to write to.
# “stdout” means log to stderr.
#
# default: Not Write Access Log
# access-log stdout
########################################################################
################################# WSGI #################################
########################################################################
# For example, if you have a Django project called example.
# see https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/
# The 'application` object is in path below:
# /home/my/django/example/wsgi.py
# If so, app-project-path /home/my/django/example/
# app-module-name wsgi
# app-name application
# Specify the Python package search absolute path(insert to sys.path)
# Example: /var/www/django/project/
#
# default NULL
app-project-path example
# Specify the WSGI application's script name.
# use '.' to divide directory like python(sample.settings)
#
# default NULL
app-module-name app.wsgi
# Specify the WSGI application's callable variable.
#
# default NULL
app-name application
########################################################################
############################# Static File ##############################
########################################################################
# Specify static file directory, now only support one directory(Test)
# Must start with '/'
#
# default: NULL
static-file-dir /static/
# Specify static file max size.
# set `0` means no limit.
#
# default: 16777216(16M)
file-maxsize 16777216
# Specify allowed extension, '*' means all extensions is allowed.
# Suggested type see http://en.wikipedia.org/wiki/MIME_type
# Attention: No Space between extensions and ',' is the separator.
# Format: (EXTENSIONS,)*EXTENSION
# Example: allowed-extension jpg,gif,bmp,png
#
# default: *
allowed-extension *
# Specify directory index. For example, if client request "/static/" and
# `directory-index` is "index.html,default.html", the "/static/index.html"
# file will be sent if it exists, otherwise the "/static/default.html"
# file will be sent if it exists.
# Attention: No Space between extensions and ',' is the separator.
# Format: (INDEX,)*INDEX
# Example: directory-index index.html,default.html,default.htm
#
# default: NULL
directory-index index.html
########################################################################
############################### WheatRedis #############################
########################################################################
# Specify redis servers below
#
# default: NULL
redis-servers
- 127.0.0.1:6379
- 127.0.0.1:6380
# Specify redis servers backup size
# Now, Redis cluster app send write command to all backup redis server and
# only send write command to one redis server. In other words, use all
# write and random read strategy.
#
# Attention: `backup-size` value must less than the amount of `redis-servers`
#
# default: 1
backup-size 2
# Specify timeout value between Wheatserver send request to backend servers
# and receive response from them.
#
# default: 1000(ms)
redis-timeout 1000
# Specify whether use config file or redis server as WheatRedis's config source
# There are three options can be specified:
# 1. USE_FILE
# 2. USE_REDIS
# 3. REDIS_THEN_FILE
#
# When `UseFile` is specified, WheatRedis will only check file and use it to
# initialize WheatRedis. And `USE_FILE` will not save config file to redis
# server whether `config-server` exists or not.
# When `UseRedis` is specified, WheatRedis will get config info from redis
# server from `config-server`. If the info from `config-server` is broken and
# not supported to run WheatRedis, WheatRedis will exit
# When `RedisThenFile` is specified, WheatRedis will get info from
# `config-server` firstly. If info is completely, WheatRedis will happy to
# start. Otherwise, WheatRedis will turn to parse config file to get info.
# WheatRedis exits when both are failed .
# `UseRedis` and `RedisThenFile` both save config file changes to redis server
#
# default: RedisThenFile
config-source RedisThenFile
# Specify config server which WheatRedis will get config from.
# config-server can be in `redis-servers` lists
#
# default: NULL
config-server 127.0.0.1:6379
########################################################################
############################### RamCloud ###############################
########################################################################
# Specify the cluster name of RamCloud want to connect.
# It's must be filled if you want to use RamCloud
#
# default: NULL
ramcloud-cluster-name main
# Specify the cluster name of RamCloud want to connect.
# It's must be filled if you want to use RamCloud
#
# default: NULL
ramcloud-server-locator zk:host-name:2181