File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
frameworks/Python/aiohttp/app Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ def pg_dsn(dialect=None) -> str:
4949async def db_ctx (app : web .Application ):
5050 # number of gunicorn workers = multiprocessing.cpu_count() as per gunicorn_conf.py
5151 # max_connections = 2000 as per toolset/setup/linux/databases/postgresql/postgresql.conf:64
52- # give 10% leeway
53- max_size = min ( 1800 / multiprocessing . cpu_count (), 160 )
54- max_size = max ( int ( max_size ), 1 )
55- min_size = max ( int ( max_size / 2 ), 1 )
52+ # but we have only 10k rows in the world table, so we must use a small connection pool
53+ # also target machine has 56 cores
54+ max_size = 3
55+ min_size = 3
5656 print (f'connection pool: min size: { min_size } , max size: { max_size } , orm: { CONNECTION_ORM } ' )
5757 if CONNECTION_ORM :
5858 dsn = pg_dsn ('asyncpg' )
You can’t perform that action at this time.
0 commit comments