From b1a6c8e6334ccc5bf91bb79e966c16b6b8df4a3c Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Wed, 22 Apr 2015 12:14:35 +0200
Subject: [PATCH] erp5: Use the same default value for thread amount as Zope's.

One thread is just too limited to produce a usable instance (for example,
a single-zope setup with default thread count fails to run live tests). It
is also not an advised setting for activity nodes, because of timerserver
still queuing process_timer calls while CMFActivity is busy processing; the
result being a (limited) waste of memory, and hammering mysql after long
processing periods.
Zope's default value must be duplicated because thread-amount is also used
to generate haproxy configuration file (so just not providing the value in
Zope's configuration file is wrong).
---
 stack/erp5/buildout.cfg         | 2 +-
 stack/erp5/instance-erp5.cfg.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg
index d6cb191a9..f28a50605 100644
--- a/stack/erp5/buildout.cfg
+++ b/stack/erp5/buildout.cfg
@@ -296,7 +296,7 @@ extra-context =
 [template-erp5]
 < = download-base
 filename = instance-erp5.cfg.in
-md5sum = 1c27513d03c5dbb7c12f71386bc97ef7
+md5sum = 535e8089acf808efe1d4e55328404ce3
 
 [template-zeo]
 < = download-base
diff --git a/stack/erp5/instance-erp5.cfg.in b/stack/erp5/instance-erp5.cfg.in
index a15b9978c..3074726df 100644
--- a/stack/erp5/instance-erp5.cfg.in
+++ b/stack/erp5/instance-erp5.cfg.in
@@ -126,7 +126,7 @@ name = {{ partition_name }}
 {{ sla(partition_name) }}
 config-name = {{ dumps(custom_name) }}
 config-instance-count = {{ dumps(zope_parameter_dict.get('instance-count', 1)) }}
-config-thread-amount = {{ dumps(zope_parameter_dict.get('thread-amount', 1)) }}
+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)) }}
-- 
2.30.9