Sfoglia il codice sorgente

[Python] Bump Granian to 0.4 (#8206)

Giovanni Barillari 2 anni fa
parent
commit
094a95ed4a

+ 1 - 1
frameworks/Python/emmett/run.py

@@ -11,7 +11,7 @@ if __name__ == "__main__":
         ("app", "app"),
         host="0.0.0.0",
         port=8080,
-        workers=cpus // 2,
+        workers=cpus,
         backlog=2048,
         enable_websockets=False,
         log_level="warn"

+ 1 - 1
frameworks/Python/granian/benchmark_config.json

@@ -77,7 +77,7 @@
       "webserver": "granian",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "granian [rsgi][wrk]",
+      "display_name": "granian [rsgi wrk]",
       "notes": "",
       "versus": "uvicorn"
     }

+ 1 - 1
frameworks/Python/granian/requirements.txt

@@ -1,4 +1,4 @@
 asyncpg==0.27.0
-granian>=0.3.0,<0.4.0
+granian>=0.4.0,<0.5.0
 jinja2==3.1.2
 orjson==3.8.1

+ 2 - 6
frameworks/Python/granian/run.py

@@ -7,12 +7,8 @@ from granian import Granian
 if __name__ == '__main__':
     interface = sys.argv[1]
     threading_mode = sys.argv[2]
-    if threading_mode == "runtime":
-        workers = multiprocessing.cpu_count()
-        threads = 2
-    else:
-        workers = multiprocessing.cpu_count() // 2
-        threads = 1
+    workers = multiprocessing.cpu_count()
+    threads = 2 if threading_mode == "runtime" else 1
 
     Granian(
         f"app_{interface}:main",