Comments (10)
Catch example uwsgi.ini
config that works great with latest django-cassandra-engine
:
[uwsgi]
# Setuid to the specified user/uid
uid = uwsgi
# Setgid to the specified group/gid
gid = uwsgi
vhost =
# Load uWSGI plugins (comma-separated)
plugins = python
pidfile = /tmp/app_uwsgi
socket = /run/uwsgi/app/socket
chmod-socket = 666
master = true
enable-threads = true
lazy-apps = true
processes = 40
cpu-affinity = 1
wsgi-file = /var/www/app/django.wsgi
# Every request that will take longer than the seconds specified in the
# harakiri timeout will be dropped and the corresponding worker is thereafter
# recycled.
harakiri = 40
# Log only errors
disable-logging = true
listen = 4096
threads = 2
Could you confirm that similar config does not work for you?
from django-cassandra-engine.
I will test this and see and reply back. Thanks
from django-cassandra-engine.
I need to dig deeper to find the root cause for this.
The connection connects, and i clearly see that the netstat shows that the connections are established.
But any queries on execute statements on the cassandra session blocks and waits forever causing timeout. Verified this on 0.6.2 and yields the same result :(
from django-cassandra-engine.
This doesn't seem like django-cassandra-engine
issue. Above uwsgi
config works for me since early versions of the wrapper and cassandra-driver
. Please take a look at example settings, maybe this would help.
from django-cassandra-engine.
Thanks, i will close this issue! At first i thought that django-cassandra-engine was not setting up the cassandra connections. But through netstat its clear that it does set it up. Minute i switch off uwsgi everything works fine. Must be some configuration related thing that i am missing. I will look at the settings file. Thanks again for the help
from django-cassandra-engine.
Finally figured it out. Was a uwsgi issue. Somehow the virtualenv in which i was running django had broken uwsgi dependency. uwsgi spawned 5 worker threads but there was just one instance of database connection and as a result the connection just kept timing out.
Thanks again for the help. The configurations helped me nail down the issue. Your help is very much appreciated.
from django-cassandra-engine.
I'm really glad to hear that. Good luck with your application!
from django-cassandra-engine.
Hi @r4fek,
Thanks for uwsgi.ini
example. We were fighting with similar timeout issue and the solution was to set lazy-apps
to true. We could not find reference to this option anywhere else in the django-cassandra-engine documentation. Seems like with lazy-apps
uwsgi works even without retry_connect
driver connection option you reference in the docs.
We found that you recently removed postfork
function suggested in the python driver FAQ. Does it mean that django-cassandra-engine will support uwsgi only via lazy-apps
? We are asking because uwsgi uses preforking by default and they say both approaches have their pros and cons.
from django-cassandra-engine.
Hi @rinatio,
You can still use @postfork approach if you like without lazy-apps
enabled. However we think enabling it by default is better for various of reasons like f.ex. possibility of using chain reload. Probably I should describe these 2 approaches in Docs so you don't need to struggle with working configs.
from django-cassandra-engine.
Thank you, @r4fek!
We would appreciate if you could describe the difference and give a @postfork usage example. Anyway we'll probably stick with lazy-apps
for now.
from django-cassandra-engine.
Related Issues (20)
- Can't delete from admin - You cannot .filter() on a DjangoCassandraQuerySet which has been ordered using python HOT 1
- Support for values_list 'named' keyword argument
- Django 3.0 support HOT 4
- admin ui HOT 1
- TypeError: sql_flush() got an unexpected keyword argument 'reset_sequences' HOT 2
- Date must be mapped to DateField in serializers
- Creating keyspace but models are not syncing HOT 2
- Multiple cassandra configurations HOT 5
- Stale Cached Response on GET HOT 2
- Can I use Scylla's scylla-driver with this? HOT 1
- built-in ORM HOT 3
- Error while connecting to AWS Keyspace HOT 2
- django cassnadra migration HOT 1
- Does this library support connecting through TLS (if possible, with client cert auth)?
- Discord server HOT 1
- Can't connect to K8ssandra in minikube, problem with settings HOT 1
- django 3.2 LTS support & Python 3.7+ only
- Looking for a way to dump any CQL statement to logging
- cassandra.cluster.NoHostAvailable
- sync_cassandra command fails after syncing 1 model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cassandra-engine.