<div dir="ltr">There shouldn't be an issue. Try running multiple celery workers. If you are not experiencing duplication of work there then it shouldn't make a difference when you scale it out. </div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><br>~Jonathan C.</div></div>
<br><div class="gmail_quote">On Tue, Aug 4, 2015 at 9:41 AM, Dorian Hoxha <span dir="ltr"><<a href="mailto:dorian.hoxha@gmail.com" target="_blank">dorian.hoxha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Scaling the app is the ~easiest way.<br><br></div>On celery, what is should do (haven't checked) is that it reserves a job so other processes don't get it while 1 is working on it (and if it succeeds, it deletes the job, and if it failes the job can be retrieved by another process)<br><br></div>So you should be fine.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 4, 2015 at 4:31 PM, Morgan Connolly <span dir="ltr"><<a href="mailto:connollymorg@gmail.com" target="_blank">connollymorg@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hello!</div><div><br></div><div>I have a Flask application that has an architecture like so:</div><div><br></div><div><a href="http://i.stack.imgur.com/wfVRI.png" target="_blank">http://i.stack.imgur.com/wfVRI.png</a><br></div><div><br></div><div>It currently all runs on a single server, but I need to be able to scale the application by adding in more servers. I know how I can scale the database(by creating a cluster), I do not really care about scaling the message queue at this point, but I can create a cluster for that too. </div><div><br></div><div>What I am not sure about scaling is the application itself.</div><div><br></div><div>My sessions are stored client side in cookies (Flask-Login), so that shouldn't be a problem. I am using Redis for storing temporary data that needs to be accessible from every node(application server). This data has a lifetime of 5 minutes, so no big deal.</div><div><br></div><div>I am using Celery as a task queue, with RabbitMQ as the broker. This is used for running background processes and executing tasks asynchronously. </div><div><br></div><div>All pages served are basically static HTML, with no AJAX or anything fancy like that.</div><div><br></div><div>I've thought of setting up two application servers, have each one connect to the same database, same RabbitMQ instance, and same Redis instance, and set up a load balancer in front of it to forward requests to either server. But I'm worried this might cause problems like tasks getting executed twice by Celery; would it? </div><div><br></div><div>Is there a better way to scale Flask applications?</div><div><br></div><div>Thanks.</div></div>
<br></div></div>_______________________________________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org" target="_blank">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
<br></blockquote></div><br></div>