File tree 4 files changed +15
-9
lines changed
4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
- emmett [orjson ]>= 2.5.3 ,< 2.6.0
1
+ emmett [orjson ]>= 2.5.12 ,< 2.6.0
2
2
psycopg2-binary == 2.9.5
Original file line number Diff line number Diff line change 4
4
5
5
6
6
if __name__ == "__main__" :
7
- cpus = multiprocessing .cpu_count ()
7
+ workers = round ( multiprocessing .cpu_count () / 2 )
8
8
9
9
run (
10
10
"rsgi" ,
11
11
("app" , "app" ),
12
12
host = "0.0.0.0" ,
13
13
port = 8080 ,
14
- workers = cpus ,
14
+ workers = workers ,
15
15
backlog = 16384 ,
16
- threading_mode = 'runtime' ,
16
+ threading_mode = "runtime" ,
17
+ http = "1" ,
17
18
enable_websockets = False ,
18
19
log_level = "warn"
19
20
)
Original file line number Diff line number Diff line change 1
1
asyncpg == 0.29.0
2
- granian >= 1.4.2 ,< 1.5 .0
2
+ granian >= 1.5.1 ,< 1.6 .0
3
3
jinja2 == 3.1.4
4
4
orjson == 3.10.2
Original file line number Diff line number Diff line change 7
7
if __name__ == '__main__' :
8
8
interface = sys .argv [1 ]
9
9
threading_mode = sys .argv [2 ]
10
- workers = multiprocessing .cpu_count ()
11
- if threading_mode == "workers" :
12
- workers = round (workers / 2 )
10
+
11
+ #: split cores between the two loops
12
+ workers = round (multiprocessing .cpu_count () / 2 )
13
+
14
+ blocking_threads = None
15
+ if interface == "wsgi" :
16
+ #: we don't run any I/O in WSGI benches
17
+ blocking_threads = 1
13
18
14
19
Granian (
15
20
f"app_{ interface } :main" ,
16
21
address = "0.0.0.0" ,
17
22
port = 8080 ,
18
23
workers = workers ,
19
24
threading_mode = threading_mode ,
20
- blocking_threads = 1 ,
25
+ blocking_threads = blocking_threads ,
21
26
backlog = 16384 ,
22
27
interface = interface ,
23
28
http = "1" ,
You can’t perform that action at this time.
0 commit comments