Giter Club home page Giter Club logo

Comments (10)

r4fek avatar r4fek commented on July 20, 2024 1

Hi @laxmanprabhu

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.

laxmanprabhu avatar laxmanprabhu commented on July 20, 2024

I will test this and see and reply back. Thanks

from django-cassandra-engine.

laxmanprabhu avatar laxmanprabhu commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

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.

laxmanprabhu avatar laxmanprabhu commented on July 20, 2024

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.

laxmanprabhu avatar laxmanprabhu commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

I'm really glad to hear that. Good luck with your application!

from django-cassandra-engine.

rinatio avatar rinatio commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

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.

rinatio avatar rinatio commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.