Our system is an application which runs on Ubuntu 14.04.2 LTS/ Apache /
Django / Oracle / cx_Oracle.
The application gets killed very often, as many requests are sent to the
application. We have tried our level best to overcome this issue, but we
couldn't. After debugging, we found that it is happening due to DB
Connection Issues.
The same issue can be seen in the development server also - as given below
{{{
[29/Mar/2015 11:47:17] "POST /*/ HTTP/1.1" 200 24632
[29/Mar/2015 11:47:17] "POST /*/ HTTP/1.1" 200 24632
Killed
(env)rajmohan@o:~/src$ ==
}}}
We could reproduce this problem by running the following code in
python manage.py shell
{{{
import threading
class MyThread(threading.Thread):
def run(self):
name = User.objects.all().first().username
for i in range(90):
th = MyThread()
th.start()
}}}
This will kill the application as -
In [4]: Killed
This issue is there in Apache Server also.
Please note that this happens only in Oracle version - In sqlite there are
absolutely no issues.
The same issue does not happen on Windows. Only in our linux boxes.
We tried connection pooling etc, but that didn't solve the problem. Please
let me know whether we are doing something very wrong?
--
Ticket URL: <https://code.djangoproject.com/ticket/24549>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Perhaps you're exceeding the amount of RAM available and triggering the
kernel's OOM killer?
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:1>
Comment (by jarshwah):
Can you also ensure that the `threaded` option is configured for your
Oracle DB backend settings?
https://docs.djangoproject.com/en/1.7/ref/databases/#threaded-option
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
See TicketClosingReasons/UseSupportChannels and please reopen if the
conclusions lead to a bug or improvement in Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:3>
Comment (by rajmohanh):
Sorry for the delay in replying. I was trying with oraclepool and other
pools to fix the issue.
None of them solved it - in between I missed this post.
The threaded option is configured in Oracle. Please find below -
{{{
ORACLE_DATABASES = {
'default': {
# Default Oracle Settings
'CONN_MAX_AGE': 60,
},
'OPTIONS': {
'threaded': True,
},
}
}}}
Still the issue persists. With oraclepool, there were many other issues
coming up.
I am completely stuck on this. I have been trying to fix this for a long
time, but no solutions :-(
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:4>
* cc: rajmohanh (added)
* status: closed => new
* resolution: invalid =>
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:5>
Comment (by rajmohanh):
I really don't know why this is not happening in Windows Machine also?
We ran 10-20 times the load in Windows machine, without issues.
So, I am absolutely flummoxed
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:6>
* status: new => closed
* resolution: => invalid
Comment:
As mentioned before, please see TicketClosingReasons/UseSupportChannels
for better channels to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/24549#comment:7>