From 3362ec8dbb494eedcc81e1eac783fa93eb8d17a7 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Sat, 24 Jul 2021 15:45:25 +0200 Subject: [PATCH] Use threads in gunicorn rather than processes This ensures that we share the auth-cache... will enable memory savings and may improve performances when a higher number of cores is available "smarter default" (cherry picked from commit 8d9f3214cc5663dc29f7dcf3a03bc373a51d010b) # Conflicts: # core/admin/start.py --- core/admin/start.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/admin/start.py b/core/admin/start.py index 24f31e07..61554a8d 100755 --- a/core/admin/start.py +++ b/core/admin/start.py @@ -25,6 +25,7 @@ if account is not None and domain is not None and password is not None: log.info("Creating initial admin account %s@%s with mode %s", account, domain, mode) os.system("flask mailu admin %s %s '%s' --mode %s" % (account, domain, password, mode)) +<<<<<<< HEAD def test_unsupported(): import codecs if os.path.isfile(codecs.decode('/.qbpxrerai', 'rot13')) or os.environ.get(codecs.decode('V_XABJ_ZL_FRGHC_QBRFAG_SVG_ERDHVERZRAGF_NAQ_JBAG_SVYR_VFFHRF_JVGUBHG_CNGPURF', 'rot13'), None) or os.environ.get(codecs.decode('ZNVYH_URYZ_PUNEG', 'rot13'), None): @@ -32,6 +33,15 @@ def test_unsupported(): log.critical('Your system is not supported. Please start by reading the documentation and then http://www.catb.org/~esr/faqs/smart-questions.html') while True: time.sleep(5) +======= +start_command="".join([ + "gunicorn --threads ", str(os.cpu_count()), + " -b :80 ", + "--access-logfile - " if (log.root.level<=log.INFO) else "", + "--error-logfile - ", + "--preload ", + "'mailu:create_app()'"]) +>>>>>>> 8d9f3214 (Use threads in gunicorn rather than processes) def test_DNS(): import dns.resolver