Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying telegraphy #14

Open
Brandl opened this issue Feb 21, 2014 · 3 comments
Open

Deploying telegraphy #14

Brandl opened this issue Feb 21, 2014 · 3 comments

Comments

@Brandl
Copy link

Brandl commented Feb 21, 2014

I'm not a Twisted expert and unfortunately I haven't found any explanation in the docs on which is the best setup to use telegraphy in production?

Your recommendation would really help me out.

Kind regards

@D3f0
Copy link
Contributor

D3f0 commented Mar 10, 2014

Sorry for the late answer.
Telegraphy, in its current state, must run in a different process than gunicorn/uWSGI, or whatever wsgi server your're using. The process is started as a django management process.
You must keep this process alive with some sort of process monitor (ie: superivosrd). Although is written on top of twisted, it does not use twisted's twistd.

Fornt end configuration could be done with something like http://nginx.org/en/docs/http/websocket.html.

@Brandl
Copy link
Author

Brandl commented Mar 10, 2014

Thanks. We decided to run the telegraphy management command with supervisord, so this was a lucky guess. :)

But I've got another question: It's best practice to run websockets on port 80 to avoid getting blocked by a firewall. Which makes this kinda tricky, because (I hope I don't get this wrong) the telegraphy websocket locations have no particular prefix (for the nginx location)?
Another possibility to a prefixe would be a ws.example.com subdomain.

Which would be the simplest setup to run telegraphy behind nginx on port 80?


If anyone comes across the same question, this is our supervisord config file:

$ cat /etc/supervisor/conf.d/telegraphy.conf 

[program:run_telegraphy] 
command=/webapps/[app]/bin/python /webapps/[app]/Django/manage.py run_telegraph 
directory=/webapps/[app]/Django
environment=PYTHONPATH='/webapps/[app]/Django' 
user=[restricted_user]
numprocs=1 
stdout_logfile=/webapps/[app]/logs/telegraphy.log 
stderr_logfile=/webapps/[app]/logs/telegraphy.log 
autostart=true 
autorestart=true 
startsecs=10 
stopwaitsecs=30

@D3f0
Copy link
Contributor

D3f0 commented Mar 10, 2014

@Brandl indeed, one of the this I have to change is to add a Prefix for telegraphy's WS entry point URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants