当前位置: 代码迷 >> 综合 >> django + sqlalchemy pool 测试
  详细解决方案

django + sqlalchemy pool 测试

热度:21   发布时间:2023-12-21 17:14:53.0

1.修改gevent

/duitang/dist/sys/python/lib/python2.7/site-packages/gunicorn/workers/ggevent.py
monkey.patch_all(socket=True, dns=True, time=True, select=True, thread=False, os=True, ssl=True, httplib=False, aggressive=True)

2. 修改mysql backend

import sqlalchemy.pool as pool
Database = pool.manage(Database,recycle=604800,pool_size=2, max_overflow=0,use_threadlocal=True)

 

3.测试结果,非常不稳定。