{"id":9,"date":"2016-01-29T19:19:39","date_gmt":"2016-01-29T15:19:39","guid":{"rendered":"http:\/\/www.dobryakov.net\/blog\/?p=9"},"modified":"2016-01-29T19:19:39","modified_gmt":"2016-01-29T15:19:39","slug":"where-are-the-queues-coming-from-in-web","status":"publish","type":"post","link":"https:\/\/www.dobryakov.net\/blog\/9\/","title":{"rendered":"Where are the queues coming from in web?"},"content":{"rendered":"<p>Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process &#8211; the more visitors you can serve.<\/p>\n<p>When internet grows, some people began to counteract with \u201chigh load\u201d with typical methods: they setuped nginx as front-server, several backend-servers (upstreams) with copies of their web application, and spreaded the load to them. Randomly (by round-robin) or with a little trick: for example, the first upstream had 1s timeout, second upstream &#8211; 2s timeout, and so on. Of course there were more clever schemes.<\/p>\n<p>It was a typical way more than 6 years ago.<!--more--><\/p>\n<p>Then a SPA revolution occurs. There are no term \u201cserver-side rendering\u201d at all. Most of business logic came to browser (into javascript), and the visitor began to receive all HTML\/CSS\/JS of application on the start point, as one complete packet. Also, full application could be placed on a public CDN like CloudFlare.<\/p>\n<p>Now there are no sence how \u201cfast\u201d is your backend server, how many RPS can you process. It ceased to be a characteristic of website. Because nobody can DDoS the CloudFlare, and if someone can &#8211; you couldn\u2019t overcome it anyway.<\/p>\n<p>And the second revolutionary thing was an asynchronous delay between user action and system reaction &#8211; due to async nature of javascript and websockets. Even if a request was flying to the backend server via normal HTTP, but the answer (response) flew back later, by asynchronous way (through websocket or SSE transport).<\/p>\n<p>This are the reasons why long-term position \u201ccatch as much requests as you can or die\u201d was rolled over to opposite strategy \u201cdon\u2019t loose any single request\u201d. When user interface became asynchronous, it doesn\u2019t really matter that your like under the facebook post come to your friends browsers after 1 second or 1 minute. You will see instantaneous effect in both cases, because facebook imitates it for you, when real background request (and response) travels through the network and business logic. And this is suitable behavior for anybody.<\/p>\n<p>It doesn\u2019t matter if the request was processed for 0.1s or 15s or more, because there is only one pattern for all cases: \u201cthanks, your request was accepted, you will see the response in your interface as soon as possible\u201d.<\/p>\n<p>Therefore, if you have (for example) e-commerce website, and your customer press the button \u201cSubmit the order\u201d, you can\u2019t tell him \u201cSorry, my server is busy, please wait while nginx will find suitable upstream\u201d. You can\u2019t tell him 503, because he will left your website &#8211; and will be right. You should only tell him \u201cThanks, request accepted\u201d, save it to safe place, process as soon as possible and delivery the results to customer\u2019s web interface.<\/p>\n<p>This is the romantic story where the queues come from in web. If you still not sure, please take look at Trello &#8211; very good web application, I think. Look at tickets or flats search on a market leader&#8217;s websites. Look at Ruby on Rails &#8211; with it\u2019s ActiveCable (websockets out of the box). Look at Facebook. Be aware about modern technologies.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process &#8211; the more visitors &hellip; <a href=\"https:\/\/www.dobryakov.net\/blog\/9\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Where are the queues coming from in web?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4,16,21],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-amqp","tag-queues","tag-spa"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"dobryakov\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.dobryakov.net\/blog\/9\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Grigoriy Dobryakov - IT+AI Blog - Grigoriy Dobryakov&#039;s blog: management, development and testing\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.dobryakov.net\/blog\/9\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-01-29T15:19:39+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-01-29T15:19:39+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#blogposting\",\"name\":\"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog\",\"headline\":\"Where are the queues coming from in web?\",\"author\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/author\\\/dobryakov\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/#organization\"},\"datePublished\":\"2016-01-29T19:19:39+00:00\",\"dateModified\":\"2016-01-29T19:19:39+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#webpage\"},\"articleSection\":\"Uncategorized, amqp, queues, spa\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/category\\\/uncategorized\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#listItem\",\"name\":\"Where are the queues coming from in web?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#listItem\",\"position\":3,\"name\":\"Where are the queues coming from in web?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/#organization\",\"name\":\"Grigoriy Dobryakov - IT+AI Blog\",\"description\":\"Grigoriy Dobryakov's blog: management, development and testing\",\"url\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/author\\\/dobryakov\\\/#author\",\"url\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/author\\\/dobryakov\\\/\",\"name\":\"dobryakov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40e48c39391f07d18b3013504096fdb82384a9aecb150c9df6497886ed2803fb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"dobryakov\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#webpage\",\"url\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/\",\"name\":\"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog\",\"description\":\"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/9\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/author\\\/dobryakov\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/author\\\/dobryakov\\\/#author\"},\"datePublished\":\"2016-01-29T19:19:39+00:00\",\"dateModified\":\"2016-01-29T19:19:39+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/\",\"name\":\"Grigoriy Dobryakov - IT+AI Blog\",\"description\":\"Grigoriy Dobryakov's blog: management, development and testing\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dobryakov.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog","description":"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors","canonical_url":"https:\/\/www.dobryakov.net\/blog\/9\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#blogposting","name":"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog","headline":"Where are the queues coming from in web?","author":{"@id":"https:\/\/www.dobryakov.net\/blog\/author\/dobryakov\/#author"},"publisher":{"@id":"https:\/\/www.dobryakov.net\/blog\/#organization"},"datePublished":"2016-01-29T19:19:39+00:00","dateModified":"2016-01-29T19:19:39+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.dobryakov.net\/blog\/9\/#webpage"},"isPartOf":{"@id":"https:\/\/www.dobryakov.net\/blog\/9\/#webpage"},"articleSection":"Uncategorized, amqp, queues, spa"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.dobryakov.net\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/#listItem","name":"Uncategorized"}},{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/#listItem","position":2,"name":"Uncategorized","item":"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#listItem","name":"Where are the queues coming from in web?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#listItem","position":3,"name":"Where are the queues coming from in web?","previousItem":{"@type":"ListItem","@id":"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/#listItem","name":"Uncategorized"}}]},{"@type":"Organization","@id":"https:\/\/www.dobryakov.net\/blog\/#organization","name":"Grigoriy Dobryakov - IT+AI Blog","description":"Grigoriy Dobryakov's blog: management, development and testing","url":"https:\/\/www.dobryakov.net\/blog\/"},{"@type":"Person","@id":"https:\/\/www.dobryakov.net\/blog\/author\/dobryakov\/#author","url":"https:\/\/www.dobryakov.net\/blog\/author\/dobryakov\/","name":"dobryakov","image":{"@type":"ImageObject","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/40e48c39391f07d18b3013504096fdb82384a9aecb150c9df6497886ed2803fb?s=96&d=mm&r=g","width":96,"height":96,"caption":"dobryakov"}},{"@type":"WebPage","@id":"https:\/\/www.dobryakov.net\/blog\/9\/#webpage","url":"https:\/\/www.dobryakov.net\/blog\/9\/","name":"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog","description":"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.dobryakov.net\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.dobryakov.net\/blog\/9\/#breadcrumblist"},"author":{"@id":"https:\/\/www.dobryakov.net\/blog\/author\/dobryakov\/#author"},"creator":{"@id":"https:\/\/www.dobryakov.net\/blog\/author\/dobryakov\/#author"},"datePublished":"2016-01-29T19:19:39+00:00","dateModified":"2016-01-29T19:19:39+00:00"},{"@type":"WebSite","@id":"https:\/\/www.dobryakov.net\/blog\/#website","url":"https:\/\/www.dobryakov.net\/blog\/","name":"Grigoriy Dobryakov - IT+AI Blog","description":"Grigoriy Dobryakov's blog: management, development and testing","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.dobryakov.net\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Grigoriy Dobryakov - IT+AI Blog - Grigoriy Dobryakov's blog: management, development and testing","og:type":"article","og:title":"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog","og:description":"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors","og:url":"https:\/\/www.dobryakov.net\/blog\/9\/","article:published_time":"2016-01-29T15:19:39+00:00","article:modified_time":"2016-01-29T15:19:39+00:00","twitter:card":"summary_large_image","twitter:title":"Where are the queues coming from in web? - Grigoriy Dobryakov - IT+AI Blog","twitter:description":"Let me remind you how websites was created in past: there was server application that receives the request from the user, processes it, draws the HTML page (or performs the requested operation and draws the similar page) and gives it back to user. Simple rule: the more RPS you can process - the more visitors"},"aioseo_meta_data":{"post_id":"9","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-07-26 15:21:42","updated":"2026-07-26 15:21:42"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.dobryakov.net\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWhere are the queues coming from in web?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.dobryakov.net\/blog"},{"label":"Uncategorized","link":"https:\/\/www.dobryakov.net\/blog\/category\/uncategorized\/"},{"label":"Where are the queues coming from in web?","link":"https:\/\/www.dobryakov.net\/blog\/9\/"}],"_links":{"self":[{"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":0,"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dobryakov.net\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}