Commit 32cd9956 authored by Ivan Tyagov's avatar Ivan Tyagov

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 2e2393e0
...@@ -144,6 +144,11 @@ ...@@ -144,6 +144,11 @@
"default": 1, "default": 1,
"type": "integer" "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": { "port-base": {
"allOf": [{ "allOf": [{
"$ref": "#/definitions/tcpv4port" "$ref": "#/definitions/tcpv4port"
......
...@@ -211,6 +211,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }} ...@@ -211,6 +211,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }}
config-timerserver-interval = {{ dumps(zope_parameter_dict.get('timerserver-interval', 5)) }} 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-interval = {{ dumps(zope_parameter_dict.get('longrequest-logger-interval', -1)) }}
config-longrequest-logger-timeout = {{ dumps(zope_parameter_dict.get('longrequest-logger-timeout', 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-port-base = {{ dumps(zope_parameter_dict.get('port-base', 2200)) }}
config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }} config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endfor -%} {% endfor -%}
......
...@@ -39,7 +39,7 @@ md5sum = 76f9e8c8cdc352081e34539d8fc17026 ...@@ -39,7 +39,7 @@ md5sum = 76f9e8c8cdc352081e34539d8fc17026
[template-zope-conf] [template-zope-conf]
filename = zope.conf.in filename = zope.conf.in
md5sum = 3524ef2e14cea4a5bd40fdc9e95cfc0c md5sum = adb25a1ab15c8aecf40a3952528f81c2
[site-zcml] [site-zcml]
filename = site.zcml filename = site.zcml
...@@ -79,7 +79,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -79,7 +79,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 1d6735a803c9d28930bf2ad00706c06b md5sum = 565215c6d86cf334db406efd8702d07b
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
...@@ -87,7 +87,7 @@ md5sum = d1f33d406d528ae27d973e2dd0efb1ba ...@@ -87,7 +87,7 @@ md5sum = d1f33d406d528ae27d973e2dd0efb1ba
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = e08c00d5973916d796bf08aa78dba34a md5sum = 490001726c0dd93cc94960d83a2f08e5
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
......
...@@ -210,6 +210,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }} ...@@ -210,6 +210,7 @@ config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 4)) }}
config-timerserver-interval = {{ dumps(zope_parameter_dict.get('timerserver-interval', 5)) }} 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-interval = {{ dumps(zope_parameter_dict.get('longrequest-logger-interval', -1)) }}
config-longrequest-logger-timeout = {{ dumps(zope_parameter_dict.get('longrequest-logger-timeout', 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-port-base = {{ dumps(zope_parameter_dict.get('port-base', 2200)) }}
config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }} config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endfor -%} {% endfor -%}
......
...@@ -269,6 +269,7 @@ tidstorage-ip = {{ dumps(slapparameter_dict['tidstorage-ip']) }} ...@@ -269,6 +269,7 @@ tidstorage-ip = {{ dumps(slapparameter_dict['tidstorage-ip']) }}
tidstorage-port = {{ dumps(slapparameter_dict['tidstorage-port']) }} tidstorage-port = {{ dumps(slapparameter_dict['tidstorage-port']) }}
{% endif -%} {% endif -%}
{% set thread_amount = slapparameter_dict['thread-amount'] -%} {% set thread_amount = slapparameter_dict['thread-amount'] -%}
{% set large_file_threshold = slapparameter_dict['large-file-threshold'] -%}
thread-amount = {{ thread_amount }} thread-amount = {{ thread_amount }}
{% set webdav = slapparameter_dict['webdav'] -%} {% set webdav = slapparameter_dict['webdav'] -%}
webdav = {{ dumps(webdav) }} webdav = {{ dumps(webdav) }}
...@@ -315,6 +316,7 @@ node-id = {{ dumps(node_id_base ~ (node_id_index_format % index)) }} ...@@ -315,6 +316,7 @@ node-id = {{ dumps(node_id_base ~ (node_id_index_format % index)) }}
{% endfor -%} {% endfor -%}
import-list = {{ dumps(list(import_set)) }} import-list = {{ dumps(list(import_set)) }}
zodb-dict = {{ dumps(zodb_dict) }} zodb-dict = {{ dumps(zodb_dict) }}
large-file-threshold = {{ large_file_threshold }}
{% if longrequest_logger_interval > 0 -%} {% if longrequest_logger_interval > 0 -%}
longrequest-logger-file = {{ longrequest_logger_base_path ~ name ~ ".log" }} longrequest-logger-file = {{ longrequest_logger_base_path ~ name ~ ".log" }}
longrequest-logger-timeout = {{ longrequest_logger_timeout }} longrequest-logger-timeout = {{ longrequest_logger_timeout }}
......
...@@ -49,6 +49,11 @@ products {{ parameter_dict['instance-products'] }} ...@@ -49,6 +49,11 @@ products {{ parameter_dict['instance-products'] }}
interval {{ parameter_dict['longrequest-logger-interval'] }} interval {{ parameter_dict['longrequest-logger-interval'] }}
</product-config> </product-config>
{% endif -%}
{% if 'large-file-threshold' in parameter_dict -%}
large-file-threshold {{ parameter_dict['large-file-threshold'] }}
{% endif -%} {% endif -%}
{% if 'tidstorage-ip' in parameter_dict -%} {% if 'tidstorage-ip' in parameter_dict -%}
<product-config TIDStorage> <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