File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
frameworks/Python/blacksheep Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 1212READ_ROW_SQL = 'SELECT "id", "randomnumber" FROM "world" WHERE id = %s'
1313WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"=%s WHERE id=%s'
1414ADDITIONAL_ROW = [0 , "Additional fortune added at request time." ]
15- MAX_CONNECTIONS = 200
15+ MAX_CONNECTIONS = 1000
1616CORE_COUNT = multiprocessing .cpu_count ()
17- PROCESSES = CORE_COUNT
1817
19- WORKER_PROCESSES = CORE_COUNT
20- MAX_POOL_SIZE = CORE_COUNT * 2
18+ MAX_POOL_SIZE = (MAX_CONNECTIONS // CORE_COUNT )
2119MIN_POOL_SIZE = max (1 , MAX_POOL_SIZE // 2 )
2220db_pool = None
2321
Original file line number Diff line number Diff line change 1919ADDITIONAL_ROW = [0 , "Additional fortune added at request time." ]
2020MAX_CONNECTIONS = 1900
2121CORE_COUNT = multiprocessing .cpu_count ()
22- PROCESSES = CORE_COUNT
23- MAX_POOL_SIZE = max (1 ,int (os .getenv ('MAX_POOL_SIZE' , MAX_CONNECTIONS // PROCESSES )))
22+ MAX_POOL_SIZE = max (1 ,int (os .getenv ('MAX_POOL_SIZE' , MAX_CONNECTIONS // CORE_COUNT )))
2423MIN_POOL_SIZE = max (1 ,int (os .getenv ('MIN_POOL_SIZE' , MAX_POOL_SIZE // 2 )))
2524
26- WORKER_PROCESSES = CORE_COUNT
27- MAX_POOL_SIZE = max (1 , MAX_CONNECTIONS // WORKER_PROCESSES )
28- MIN_POOL_SIZE = max (1 , MAX_POOL_SIZE // 2 )
2925db_pool = None
3026
3127async def setup_db (app ):
You can’t perform that action at this time.
0 commit comments