{"id":397,"date":"2012-11-15T14:00:31","date_gmt":"2012-11-15T14:00:31","guid":{"rendered":"http:\/\/www.muratyaman.co.uk\/wp\/?p=397"},"modified":"2020-04-04T12:27:10","modified_gmt":"2020-04-04T11:27:10","slug":"analysis-of-a-queueing-setup","status":"publish","type":"post","link":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/2012\/11\/analysis-of-a-queueing-setup\/","title":{"rendered":"Analysis of a queueing setup"},"content":{"rendered":"<p><strong>Setup:<\/strong><br \/>\n1. once a day prepare a queue to send 10,000 emails (the number may depend on notifications required)<br \/>\n2. every hour get 1,000 emails and send them<\/p>\n<p><strong>Flaw:<\/strong><br \/>\n1. Delaying a certain CPU-intensive task and scheduling it is not helping the server. You cannot guarantee the CPU will be idle an hour later.<br \/>\n2. If first step prepares more than 24,000 emails, the worker cannot cleanup the queue.<\/p>\n<p><strong>Solution:<\/strong><br \/>\nProper solution may not always include a queuing service either, because email servers have their own queuing mechanism. So, in this case, it&#8217;s better to send emails in the first step.<\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Queueing_theory\">http:\/\/en.wikipedia.org\/wiki\/Queueing_theory<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setup: 1. once a day prepare a queue to send 10,000 emails &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[177],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-technology","tag-queue"],"_links":{"self":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":7,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":930,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/397\/revisions\/930"}],"wp:attachment":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}