Commit b6b08b51 authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Klaus Wölfel

Make it possible to specify the desired threshold before a requests gets saved...

Make it possible to specify the desired threshold before a requests gets saved to a temporary file instead of being read completely into memory.

@nexedi, tests do pass (I squashed commits) so unless objections today I merge it tomorrow.

https://nexedi.erp5.net/test_result_module/20180216-696E64EA

/reviewed-on nexedi/slapos!290
parent 2fc27436
......@@ -126,6 +126,11 @@
"default": 1,
"type": "integer"
},
"large-file-threshold": {
"description": "Requests bigger than this size get saved into a temporary file instead of being read completely into memory, in bytes",
"default": "512KB",
"type": "string"
},
"port-base": {
"allOf": [{
"$ref": "#/definitions/tcpv4port"
......
......@@ -190,6 +190,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }}
config-timerserver-interval = {{ dumps(zope_parameter_dict.get('timerserver-interval', 5)) }}
config-longrequest-logger-interval = {{ dumps(zope_parameter_dict.get('longrequest-logger-interval', -1)) }}
config-longrequest-logger-timeout = {{ dumps(zope_parameter_dict.get('longrequest-logger-timeout', 1)) }}
config-large-file-threshold = {{ dumps(zope_parameter_dict.get('large-file-threshold', '512KB')) }}
config-port-base = {{ dumps(zope_parameter_dict.get('port-base', 2200)) }}
config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endfor -%}
......
......@@ -31,7 +31,7 @@ md5sum = b9197d7fa0cd5ce0656032b55d3b185b
[template-zope-conf]
filename = zope.conf.in
md5sum = 77ab4f229a92e02603028a0bd3772edd
md5sum = 05424c6d5bd919d07141a43c2136afd4
[site-zcml]
filename = site.zcml
......@@ -79,7 +79,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum = 14ec590eaaebc90113f1c589ea8dd444
md5sum = 7486a4f33a6cc7eea027471c18a1116dOA
[template-zeo]
filename = instance-zeo.cfg.in
......@@ -87,7 +87,7 @@ md5sum = dba1a42bfcc8a9a2cc4e8ac503200e63
[template-zope]
filename = instance-zope.cfg.in
md5sum = b7e92234825f9d72ccb9b6c4745b6ce7
md5sum = ed9e0626630548bc3702fce463fe5157
[template-balancer]
filename = instance-balancer.cfg.in
......
......@@ -183,6 +183,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }}
config-timerserver-interval = {{ dumps(zope_parameter_dict.get('timerserver-interval', 5)) }}
config-longrequest-logger-interval = {{ dumps(zope_parameter_dict.get('longrequest-logger-interval', -1)) }}
config-longrequest-logger-timeout = {{ dumps(zope_parameter_dict.get('longrequest-logger-timeout', 1)) }}
config-large-file-threshold = {{ dumps(zope_parameter_dict.get('large-file-threshold', "512KB")) }}
config-port-base = {{ dumps(zope_parameter_dict.get('port-base', 2200)) }}
config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endfor -%}
......
......@@ -251,6 +251,7 @@ tidstorage-port = {{ dumps(slapparameter_dict['tidstorage-port']) }}
{% endif -%}
promise-path = ${erp5-promise:promise-path}
{% set thread_amount = slapparameter_dict['thread-amount'] -%}
{% set large_file_threshold = slapparameter_dict['large-file-threshold'] -%}
thread-amount = {{ thread_amount }}
{% set webdav = slapparameter_dict['webdav'] -%}
webdav = {{ dumps(webdav) }}
......@@ -297,6 +298,7 @@ node-id = {{ dumps(node_id_base ~ (node_id_index_format % index)) }}
{% endfor -%}
import-list = {{ dumps(list(import_set)) }}
zodb-dict = {{ dumps(zodb_dict) }}
large-file-threshold = {{ large_file_threshold }}
{% if longrequest_logger_interval > 0 -%}
longrequest-logger-file = {{ longrequest_logger_base_path ~ name ~ ".log" }}
longrequest-logger-timeout = {{ longrequest_logger_timeout }}
......
......@@ -49,6 +49,11 @@ products {{ parameter_dict['instance-products'] }}
interval {{ parameter_dict['longrequest-logger-interval'] }}
</product-config>
{% endif -%}
{% if 'large-file-threshold' in parameter_dict -%}
large-file-threshold {{ parameter_dict['large-file-threshold'] }}
{% endif -%}
{% if 'tidstorage-ip' in parameter_dict -%}
<product-config TIDStorage>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment