Issue in DB pooling using cx_oracle and Flask (Python)
NickName:Onkar Kubal Ask DateTime:2020-02-12T16:31:18

Issue in DB pooling using cx_oracle and Flask (Python)

We have develoed an APP using Angular 8 and flask-restplus(0.13.0) (Python 3.7.4) and cx_oracle(7.2.3). The Angular app is deployed on NGINX on Ubuntu server. We have created 3 micro services and have deployed it on gunicorn using docker and kubernetes pods. Production environment is having 7 kubernetes PODs per service. In Yaml file of kubernetes we have configured it to run on 4 threads using below command.

["gunicorn"]
  args: ["run_app:app","-b","0.0.0.0:8080","--threads=4","--access-logfile","-","--error-logfile","-"] 

The session pool code is as follows:

dbsession_pool = cx_Oracle.SessionPool('xxxxx', 'xxxxx', 'xxxxx.xxxxx.com/xxxxxdb', min=5, max=50, increment=5, threaded = True) 

All the services run for a while and then start giving 504 gateway timeout error after some time. But if we use cx_Oracle.connect then it works fine. Our reason to use session pool was to save time for connecting and disconnecting to DB thus improving performance.

Copyright Notice:Content Author:「Onkar Kubal」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60184083/issue-in-db-pooling-using-cx-oracle-and-flask-python

More about “Issue in DB pooling using cx_oracle and Flask (Python)” related questions

Issue in DB pooling using cx_oracle and Flask (Python)

We have develoed an APP using Angular 8 and flask-restplus(0.13.0) (Python 3.7.4) and cx_oracle(7.2.3). The Angular app is deployed on NGINX on Ubuntu server. We have created 3 micro services and h...

Show Detail

Issue in DB pooling using cx_oracle and Flask (Python)

We have develoed an APP using Angular 8 and flask-restplus(0.13.0) (Python 3.7.4) and cx_oracle(7.2.3). The Angular app is deployed on NGINX on Ubuntu server. We have created 3 micro services and h...

Show Detail

cx_Oracle connection pooling

I am from a java background and when I see the java api for connection pooling in oracle, the oracle driver itself provides connection pooling. But in case of cx_Oracle, I see only an option to inc...

Show Detail

Django/cx_Oracle with Oracle DRCP connection pooling

I need to use Oracle12 DRCP connection pooling with Django (1.8), cx_Oracle 5.2 and python33 Here is my configuration TNS name configuration TNS_NAME_DRCP = (DESCRIPTION = (ADDRESS = (PROT...

Show Detail

Does cx_Oracle works with flask-python?

I'm wondering if cx_Oracle works with flask-python. if so, please share with me a good documentation. it will be great. Thank you All for your help.

Show Detail

How to do Flask-SQLAlchemy pooling?

This is how I basically create my app and db: from flask import Flask from flask_restful import Api from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) api = Api(app) app.config['

Show Detail

Python mysql.connector.pooling ImportError: No module named pooling

I am facing some difficulty when I try to run a Flask app. I get the following import error: File "/db/mysql_utils.py", line 2, in <module> import mysql.connector.pooling ImportError: No

Show Detail

Connection Pooling in flask using couchbase as database

I am a newbie to flask. I need to implement connection pooling in flask, the following is my software stack: 1. Flask - 0.12.2 2. Python version - 3.4.3 3. Python couchbase driver version - 2.2.1 4.

Show Detail

Connecting to remote Oracle DB using cx_Oracle

I am having problems connecting to a remote Oracle DB using cx_Oracle in my python application. I have tried a lot of different ways of configuring/formulating my connection string based on a lot of

Show Detail

cx_Oracle and ctypes issue

Cross post from https://forums.oracle.com/thread/2607551 But no reply received after 3 days I have some code that works fine (using ctypes to call a dll), unless I run cx_Oracle first then I get an

Show Detail