<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I've used and swear by RabbitMQ, avoiding all the DB as a Q
    locking/transaction/commit issues.<br>
    <br>
    Handy thing with RabbitMQ is that it includes an acknowledge
    configuration which can be auto or manual.<br>
    <br>
    With manual, you need to call the acknowledge method before the
    message is removed from the queue.<br>
    <br>
    James.<br>
    <br>
    <div class="moz-cite-prefix">On 16/03/15 09:12, Najaf Ali wrote:<br>
    </div>
    <blockquote
      cite="mid:20150314171233.3668.8540@domU-12-31-39-0A-A0-4F"
      type="cite">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div>I'm trying to identify some general good practices (based
          on real-life problems) when it comes to working with async job
          queues (think DJ, Resque and Sidekiq).</div>
        <div><br>
        </div>
        <div>So far I've been doing this by collecting stories of how
          they've failed catastrophically (e.g. sending thousands of
          spurious SMS's to your customers) and seeing if I can identify
          any common themes based on those.</div>
        <div><br>
        </div>
        <div>Here are some examples of what I mean (anonymised to
          protect the innocent):</div>
        <div><br>
        </div>
        <div>* Having a (e.g. hourly) cron job that checks if a job has
          been done and then enqueues the job if it hasn't. It knows
          this because the successfully completed job would leave some
          sort of evidence of completion in e.g. the database. If your
          workers go down for a day, this means the same job would be
          enqueued over and over again superfluously.</div>
        <div><br>
        </div>
        <div>* Sending multiple emails (hundreds) in a single job lead
          to a problem where if just one of those emails (say the 24th)
          fails to be delivered, the entire job fails and emails 1-23
          get sent again when your worker retries it again and again and
          again.</div>
        <div><br>
        </div>
        <div>* With the workers/app running the same codebase but on
          different virtual servers, deploying only to the application
          server (and not the server running the workers) resulted in
          the app servers queueing jobs that the workers didn't know how
          to process.  </div>
        <div><br>
        </div>
        <div>It would be great to hear what sort of issues/incidents
          you've come across while using async job queues like the
          above. I don't think I have enough examples to make any
          generalisations about the "right way" to use them yet, so more
          interested in just things that went wrong and how you fixed
          them at the moment.</div>
        <div><br>
        </div>
        <div>Feel free to reply off-list if you'd rather not share with
          everyone, I intend to put the findings together in a blog post
          with a few guesses as to how to avoid these sorts of problems.</div>
        <div><br>
        </div>
        <div>All the best,</div>
        <div><br>
        </div>
        <div>-Ali</div>
        <span></span></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
Archives: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/pipermail/chat-lrug.org">http://lists.lrug.org/pipermail/chat-lrug.org</a>
Manage your subscription: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/options.cgi/chat-lrug.org">http://lists.lrug.org/options.cgi/chat-lrug.org</a>
List info: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
James McCarthy

Software Consultant

LetyCo

Mob:  07577006897

Email:  <a class="moz-txt-link-abbreviated" href="mailto:james@lety.co">james@lety.co</a>

lety.co</pre>
  </body>
</html>