<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sindhujeendru on Medium]]></title>
        <description><![CDATA[Stories by Sindhujeendru on Medium]]></description>
        <link>https://medium.com/@sindhupriyajeendru?source=rss-15bef7a2883------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1CfZBiz0Nk1naTFT.jpg</url>
            <title>Stories by Sindhujeendru on Medium</title>
            <link>https://medium.com/@sindhupriyajeendru?source=rss-15bef7a2883------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:08:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sindhupriyajeendru/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Mastering JupyterHub Idle Culling: A Practical Guide to Shutting Down What’s Not Needed]]></title>
            <link>https://sindhupriyajeendru.medium.com/mastering-jupyterhub-idle-culling-a-practical-guide-to-shutting-down-whats-not-needed-785315544ded?source=rss-15bef7a2883------2</link>
            <guid isPermaLink="false">https://medium.com/p/785315544ded</guid>
            <category><![CDATA[kernel]]></category>
            <category><![CDATA[culling]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[jupyterhub]]></category>
            <category><![CDATA[ecs-fargate]]></category>
            <dc:creator><![CDATA[Sindhujeendru]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 10:20:32 GMT</pubDate>
            <atom:updated>2025-04-15T10:20:32.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing compute costs in shared JupyterHub environments requires intelligent idle culling — shutting down unused resources, either at the kernel level or server level. Whether you’re running JupyterHub on Kubernetes, ECS, or bare metal, culling is essential.</p><p>This post dives deep into the two layers of culling, introduces advanced flags like shutdown_on_logout, and explains how to cull notebooks even when persistence (like saving to S3) is involved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*0zWYuGlsQA52qB_hJFa3lA.png" /></figure><h3>⚙️ 1. Kernel-Level Culling with MappingKernelManager</h3><p>Inside your notebook container, add this to jupyter_server_config.py</p><pre>c.MappingKernelManager.cull_idle_timeout = 1200  # 20 mins<br>c.MappingKernelManager.cull_interval = 60<br>c.MappingKernelManager.cull_connected = True     # Cull even if browser is open<br>c.MappingKernelManager.cull_busy = False         # Don&#39;t cull active kernels</pre><p>✅ This reclaims memory without stopping the entire notebook server — ideal for multi-kernel environments.</p><h3>⚙️ 2. Server-Level Culling with jupyterhub-idle-culler</h3><p>Run this as a background service in JupyterHub. It monitors user inactivity and shuts down idle notebook servers.</p><pre>c.JupyterHub.services = [<br>    {<br>        &quot;name&quot;: &quot;cull-idle&quot;,<br>        &quot;api_token&quot;: &quot;*************&quot; #can be generated using secrets package<br>        &quot;admin&quot;: True,<br>        &quot;command&quot;: [<br>            &quot;python&quot;,<br>            &quot;-m&quot;, <br>            &quot;jupyterhub_idle_culler&quot;,<br>            &quot;--timeout=300&quot;,                   # 5 min timeout<br>            &quot;--cull-users&quot;,                     # Optional: cull users in addition to servers. This is for use in temporary-user cases such as tmpnb. default False<br>            &quot;url=http//127.0.0.1:8081/hub/api&quot;,<br>            &quot;--logging=debug&quot;                   #to view debug logs<br>        ]<br>    }<br>]</pre><h3>🔥 Bonus: Clean Shutdown on Logout (Don’t Miss This!)</h3><p><strong>This is one of the most misunderstood features.</strong><br> To shut down a user’s server as soon as they log out (without waiting for the idle timeout), you need this <strong>explicit config</strong>:</p><pre>c.JupyterHub.shutdown_on_logout = True</pre><p>How frequently to refresh user activity (default: 300s)</p><pre>c.JupyterHub.last_activity_interval = 600  # Poll activity every 10 minutes</pre><p>📌 <strong>Important:</strong> These settings are valid <strong>only in JupyterHub ≥ 1.0.0</strong>.</p><h3>📦 Example: S3-Persisted Notebooks + ECS Fargate</h3><p>Many cloud-native deployments (e.g., using AWS ECS Fargate) persist notebooks to S3 on every save. When a user becomes idle:</p><ul><li>You want to safely shut down the container</li><li>But <strong>only after</strong> ensuring data is saved</li><li>And you must avoid premature culling while the tab is just sitting open</li></ul><h3>✅ The Config That Works:</h3><pre># jupyter_server_config.py inside user image<br>c.MappingKernelManager.cull_idle_timeout = 1200<br>c.MappingKernelManager.cull_interval = 60<br>c.MappingKernelManager.cull_connected = True<br>c.MappingKernelManager.cull_busy = False</pre><pre># jupyterhub_config.py<br>c.JupyterHub.last_activity_interval = 600  # Poll activity every 10 minutes<br>c.JupyterHub.shutdown_on_logout = True<br>c.JupyterHub.services = [<br>    {<br>        &quot;name&quot;: &quot;cull-idle&quot;,<br>        &quot;api_token&quot;: &quot;*************&quot; #can be generated using secrets package<br>        &quot;admin&quot;: True,<br>        &quot;command&quot;: [<br>            &quot;python&quot;, &quot;-m&quot;, &quot;jupyterhub_idle_culler&quot;,<br>            &quot;--timeout=360&quot;,<br>            &quot;--cull-users&quot;,<br>            &quot;url=http//127.0.0.1:8081/hub/api&quot;<br>        ]<br>    }<br>]</pre><p>This combination gives you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*mSdPbYvqyL6YI3BPZQGKLw.png" /></figure><h3>💡 Production Tips</h3><ul><li>Use autosaveInterval: 120000 in frontend for S3 persistence every 2 minutes</li><li>Monitor logs for both jupyterhub_idle_culler and notebook container</li><li>If users often keep tabs open, avoid setting cull_connected=True unless necessary</li></ul><h3>🔗 References</h3><ul><li><a href="https://jupyterhub.readthedocs.io/en/stable/api/services/cull-idle.html">JupyterHub Idle Culler</a></li><li><a href="https://jupyter-server.readthedocs.io/en/latest/configuration.html">MappingKernelManager Config</a></li><li><a href="https://github.com/jupyterhub/jupyterhub">JupyterHub GitHub Source</a></li></ul><h3>🚀 Final Thoughts</h3><p>Understanding how to manage idle JupyterHub resources at both the kernel and server levels is a <strong>superpower</strong> — not just for cost savings, but for scalability and user experience.</p><p>If you’re building cloud-native data platforms or multi-tenant notebook environments (like with <strong>Okta + ECS + EMR on EKS</strong>), idle culling is your best friend.</p><p>Let me know what kind of deployments you’re using — Kubernetes, ECS, EC2 — I’d love to hear how others are optimizing this setup!</p><p><em>Follow me for more deep dives into JupyterHub, cloud notebooks, and platform engineering.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=785315544ded" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to change the working directory in Jupyter in windows 10]]></title>
            <link>https://sindhupriyajeendru.medium.com/how-to-change-the-working-directory-in-jupyter-in-windows-10-e7097fd501d5?source=rss-15bef7a2883------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7097fd501d5</guid>
            <category><![CDATA[jupyter-kernel]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[jupyterlab]]></category>
            <category><![CDATA[home-directory]]></category>
            <dc:creator><![CDATA[Sindhujeendru]]></dc:creator>
            <pubDate>Mon, 08 Mar 2021 13:31:44 GMT</pubDate>
            <atom:updated>2021-03-08T13:31:44.662Z</atom:updated>
            <content:encoded><![CDATA[<p>I got a new laptop recently and this time I wanted my home directory for Jupyter notebook to be D drive, instead of C Drive. This is how I came up with this story</p><ol><li>Open Anaconda Prompt and run jupyter notebook --generate-config.</li><li>This writes a file to C:\Users\username\.jupyter\jupyter_notebook_config.py.</li><li>Copy the link displayed in Anaconda prompt and browse to the file location and open it in an Editor</li><li>Search for #c.NotebookApp.notebook_dir = ‘’ in the file. And update the required directory where you need your Jupyter to open in quotes.</li><li>Use front slashes for the path. If you want to use back slashes, use double quotes. Remove the # at the beginning of the line to allow the line to execute. Save the file</li><li>This will just update the home directory.</li><li>Then, go to the shortcut of Jupyter Notebook located in C:\Users\User_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)</li><li>Do the right click and go to the Properties. In the Target field, remove %USERPROFILE%</li><li>Then, In the field of Start in, type the same directory updated in jupyter_notebook_config.py</li><li>Done. You will be able to see the home directory as your desired directory.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7097fd501d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>