<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Django on Moonstreet</title>
    <link>https://www.moonstreet.nl/tags/django/</link>
    <description>Recent content in Django on Moonstreet</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved.</copyright>
    <lastBuildDate>Sat, 28 Nov 2026 00:00:00 +0100</lastBuildDate><atom:link href="https://www.moonstreet.nl/tags/django/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Django &#43; Daphne &#43; Celery: handling slow tasks without blocking</title>
      <link>https://www.moonstreet.nl/post/django-celery-daphne/</link>
      <pubDate>Sat, 28 Nov 2026 00:00:00 +0100</pubDate>
      
      <guid>https://www.moonstreet.nl/post/django-celery-daphne/</guid>
      <description>
        
          
            &lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;
&lt;p&gt;You have a Django app served by Daphne. A user triggers a slow task -
fetching thousands of records from an external API and uploading them to
object storage. The task takes minutes.&lt;/p&gt;
&lt;p&gt;During those minutes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Health checks get no response.&lt;/li&gt;
&lt;li&gt;Other users get no response.&lt;/li&gt;
&lt;li&gt;Kubernetes decides the pod is dead and kills it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fix is not more CPU or RAM. The fix is Celery.&lt;/p&gt;
&lt;p&gt;See also: &lt;a href=&#34;https://www.moonstreet.nl/post/concurrency-refresher/&#34;&gt;Concurrency refresher&lt;/a&gt; for the
theory behind this.&lt;/p&gt;
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
