django-mysql-geventpool
Mysql Connection Pooling backend for Django 2.0+ using gevent, only supports Python 3.4 or newer. It works with gunicorn async worker via gevent.
This implimentation is based on django-db-geventpool(https://github.com/jneight/django-db-geventpool).
install
pip install django-mysql-geventpool
Settings
Add the 'django_mysql_geventpool' modules to the INSTALLED_APPS like this:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_mysql_geventpool',
# ...other installed applications...
)
Add MAX_CONNS to OPTIONS to set the maximun number of connections allowed to database (default=4)
DATABASES = {
'default': {
'ENGINE': 'django_mysql_geventpool.backends.mysql',
'NAME': 'dbname',
'USER': 'dbuser',
'PASSWORD': 'dbpassword',
'HOST': 'dbhost',
'PORT': 'dbport',
'OPTIONS': {
'MAX_CONNS': 20,
'MAX_LIFETIME': 5 * 60 # connection lifetime in seconds, and if set 0, unlimited persistent connections if usable. default is 0.
}
}
}
Metadata
Release files for django-mysql-geventpool 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-mysql-geventpool-0.2.5.tar.gz | 3.9 kB | Details |
Release files / django-mysql-geventpool-0.2.5.tar.gz
| Download URL | django-mysql-geventpool-0.2.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84b608ec2c677f6a66e914d23cf043381776274fd316289c3ce5eef00ae213b1
|
|
BLAKE2b-256 checksum How to use checksums |
0770d9fa86b307d3abb0fb68399c365e7105c27c722c8fbd549385f571329dc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.2
|