##// END OF EJS Templates
configs: added small fixes into gunicorn configs
super-admin -
r5136:7b3b90fa default
parent child Browse files
Show More
@@ -126,7 +126,7 b' dev-srv:'
126 .PHONY: dev-srv-g
126 .PHONY: dev-srv-g
127 ## run gunicorn multi process workers
127 ## run gunicorn multi process workers
128 dev-srv-g:
128 dev-srv-g:
129 gunicorn --workers=4 --paste .dev/dev_g.ini --bind=0.0.0.0:10020 --worker-class=gevent --threads=1 --config=configs/gunicorn_config.py --timeout=120
129 gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py
130
130
131
131
132 # Default command on calling make
132 # Default command on calling make
@@ -116,13 +116,14 b' keepalive = 2'
116 # graceful restart signal 0 = memory monitoring is disabled
116 # graceful restart signal 0 = memory monitoring is disabled
117 # Examples: 268435456 (256MB), 536870912 (512MB)
117 # Examples: 268435456 (256MB), 536870912 (512MB)
118 # 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB)
118 # 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB)
119 # Dynamic formula 1024 * 1024 * 256 == 256MBs
119 memory_max_usage = 0
120 memory_max_usage = 0
120
121
121 # How often in seconds to check for memory usage for each gunicorn worker
122 # How often in seconds to check for memory usage for each gunicorn worker
122 memory_usage_check_interval = 60
123 memory_usage_check_interval = 60
123
124
124 # Threshold value for which we don't recycle worker if GarbageCollection
125 # Threshold value for which we don't recycle worker if GarbageCollection
125 # frees up enough resources. Before each restart we try to run GC on worker
126 # frees up enough resources. Before each restart, we try to run GC on worker
126 # in case we get enough free memory after that, restart will not happen.
127 # in case we get enough free memory after that, restart will not happen.
127 memory_usage_recovery_threshold = 0.8
128 memory_usage_recovery_threshold = 0.8
128
129
@@ -229,6 +230,9 b' def pre_exec(server):'
229 def on_starting(server):
230 def on_starting(server):
230 server_lbl = '{} {}'.format(server.proc_name, server.address)
231 server_lbl = '{} {}'.format(server.proc_name, server.address)
231 server.log.info("Server %s is starting.", server_lbl)
232 server.log.info("Server %s is starting.", server_lbl)
233 server.log.info('Config:')
234 server.log.info(f"\n{server.cfg}")
235 server.log.info(get_memory_usage_params())
232
236
233
237
234 def when_ready(server):
238 def when_ready(server):
@@ -324,7 +328,7 b' def worker_int(worker):'
324 return id2name.get(t_id, "unknown_thread_id")
328 return id2name.get(t_id, "unknown_thread_id")
325
329
326 code = []
330 code = []
327 for thread_id, stack in sys._current_frames().items():
331 for thread_id, stack in sys._current_frames().items(): # noqa
328 code.append(
332 code.append(
329 "\n# Thread: %s(%d)" % (get_thread_id(thread_id), thread_id))
333 "\n# Thread: %s(%d)" % (get_thread_id(thread_id), thread_id))
330 for fname, lineno, name, line in traceback.extract_stack(stack):
334 for fname, lineno, name, line in traceback.extract_stack(stack):
@@ -1,4 +1,3 b''
1
2
1
3 ; #########################################
2 ; #########################################
4 ; RHODECODE COMMUNITY EDITION CONFIGURATION
3 ; RHODECODE COMMUNITY EDITION CONFIGURATION
@@ -263,10 +262,10 b' file_store.storage_path = %(here)s/data/'
263 archive_cache.store_dir = %(here)s/data/archive_cache
262 archive_cache.store_dir = %(here)s/data/archive_cache
264
263
265 ; The limit in GB sets how much data we cache before recycling last used, defaults to 10 gb
264 ; The limit in GB sets how much data we cache before recycling last used, defaults to 10 gb
266 archive_cache.cache_size_gb = 10
265 archive_cache.cache_size_gb = 40
267
266
268 ; By default cache uses sharding technique, this specifies how many shards are there
267 ; By default cache uses sharding technique, this specifies how many shards are there
269 archive_cache.cache_shards = 10
268 archive_cache.cache_shards = 4
270
269
271 ; #############
270 ; #############
272 ; CELERY CONFIG
271 ; CELERY CONFIG
General Comments 0
You need to be logged in to leave comments. Login now