<?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 David Elkind on Medium]]></title>
        <description><![CDATA[Stories by David Elkind on Medium]]></description>
        <link>https://medium.com/@david.elkind?source=rss-beffaa8ea40a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qWNdK3oONupe5HCdhaOfTw.jpeg</url>
            <title>Stories by David Elkind on Medium</title>
            <link>https://medium.com/@david.elkind?source=rss-beffaa8ea40a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:48:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@david.elkind/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[Kubernetes Service Stickiness Challenge]]></title>
            <link>https://medium.com/@david.elkind/kubernetes-service-stickiness-challenge-8474b9b2a6af?source=rss-beffaa8ea40a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8474b9b2a6af</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[load-balancing]]></category>
            <dc:creator><![CDATA[David Elkind]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 16:01:27 GMT</pubDate>
            <atom:updated>2023-07-09T16:01:27.746Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently encountered an intriguing problem in my microservice-based data ingest pipeline running in Kubernetes cluster. Within the setup, I had multiple replicas of a microservice running in Kubernetes, responsible for serving data to another service through a pull mechanism. To ensure equitable distribution of requests, I configured kube-proxy to enable round-robin pulling from all the replicas. However, to my astonishment, the load balancing appeared heavily skewed, with nearly all requests gravitating towards a single replica. It seemed as if kube-proxy had an overwhelming preference for that particular replica, rather than evenly distributing the workload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*s6yQAj3wOm79b_WmqTXGZA.png" /></figure><p>Naturally, my first instinct was to comb through the configuration files, searching for any misconfigurations related to stickiness. However, I couldn’t find any apparent issues, leaving me puzzled. Suddenly, a “Eureka!” moment struck me, and a crucial realization dawned upon me.. The kube-proxy was properly configured for round-robin load balancing and was functioning as intended. However, due to the frequent nature of the requests, the HTTP client would establish a connection to a replica and hold onto it, so the kubeproxy was treating it as a single session thereby preventing other replicas from receiving their fair share of requests. The culprit was not a misconfiguration, but rather the unintended consequence of HTTP persistent connections.</p><p>To overcome the stickiness and achieve fair distribution of requests, I implemented a solution within the microservice. I modified the microservice’s response headers to to include “Connection: Close” header. This ensured that after each request, the connection was closed promptly, preventing clients from sticking to a specific replica. As a result, subsequent requests were distributed evenly across all replicas.</p><p>In summary, I achieved fair request distribution among my microservice replicas in Kubernetes by avoiding persistent connections. However, they can provide substantial performance benefits by saving round trips. I’m interested in finding a solution that combines the advantages of keep-alive with fair distribution. I invite your insights on how to optimize performance while ensuring equal workload distribution among replicas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8474b9b2a6af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey with Streamlit and ChatGPT]]></title>
            <link>https://medium.com/@david.elkind/expedited-research-application-development-my-journey-with-streamlit-and-chatgpt-44fba57b4fd2?source=rss-beffaa8ea40a------2</link>
            <guid isPermaLink="false">https://medium.com/p/44fba57b4fd2</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[David Elkind]]></dc:creator>
            <pubDate>Tue, 27 Jun 2023 19:40:04 GMT</pubDate>
            <atom:updated>2023-06-28T06:03:01.573Z</atom:updated>
            <content:encoded><![CDATA[<p>Not too long ago, I hit a considerable academic milestone: an <a href="https://elifesciences.org/articles/82376">article based on my Master’s thesis</a> got its spot in the eLife journal. In a nutshell, the article focuses on the intricacies of the mouse brain, which is the most studied among mammals, but still holds many secrets. To unravel some of these mysteries, we employed a deep neural network that aided us in detecting and counting cells within the brain section images. This approach empowered us to systematically map out cell counts and unravel insights into the sex, strain, and hemisphere variability in cell density and volume across different regions of the brain. One of the major parts of this project? Building an <a href="https://delkind-mouse-brain-cell-counting-brain-explorer-3ek3v5.streamlit.app/">interactive app</a> so that researchers worldwide could tap into the huge amount of data we’d gathered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*b7u3WOMpkKF5GP4K1tftYw.png" /><figcaption>A section of a mouse brain with cells detected using the AI model</figcaption></figure><p>I began my data exploration journey with Jupyter Notebook, which is fantastic when it’s just you, but it doesn’t support multiple users. I considered Binder, which could potentially turn my Jupyter Notebooks into something that’s shareable and interactive on the web. However, the snail-paced processing speed was a major setback — waiting up to 20 minutes just to open a notebook wasn’t exactly my idea of efficiency.</p><p>That’s when I discovered Streamlit, a Python-based framework that seemed to tick all the boxes for building an interactive, user-friendly data app that can handle more than one user at a time. But here’s where it gets interesting. Instead of sitting and manually developing the application, I used ChatGPT to speed things up. I provided the AI with my data schema and specifications for visualization and filtering, and a few iterations later, I had my application. Granted, there were some minor manual adjustments and bug fixes to be done, but it was pretty much ready to go.</p><p>Next, I deployed the app on Streamlit Cloud, which meant the extensive data I had collected was now available for interactive use. But the users needed guidance, right? So I went back to ChatGPT, fed it the app’s code, and it churned out a comprehensive user manual on its first try. A handful of tweaks later, I had a complete manual, all in about 10 minutes.</p><p>Here’s the kicker: the entire process, from thinking up the Streamlit application, to deployment and creating the user manual, took just about 3 hours. That’s the magic of Streamlit and ChatGPT working together.</p><p>To wrap it up, creating this application really showed me the power of tools like Streamlit and ChatGPT. Sure, there were a few manual adjustments to be made, but having ChatGPT in the mix was a game changer. It streamlined what would have been a time-consuming process, saving me valuable time, and demonstrating the potential of integrating AI into everyday tasks. And yes, ChatGPT helped me with this post, too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44fba57b4fd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>