<?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 Shawn Stephens on Medium]]></title>
        <description><![CDATA[Stories by Shawn Stephens on Medium]]></description>
        <link>https://medium.com/@shawn.stephens?source=rss-790bcd984129------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-szBkrFQvmdFx4NJmtE5Jw.png</url>
            <title>Stories by Shawn Stephens on Medium</title>
            <link>https://medium.com/@shawn.stephens?source=rss-790bcd984129------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:37:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shawn.stephens/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[How People Drive Success at Stitch Fix]]></title>
            <link>https://medium.com/shawn-stephens/how-people-drive-success-at-stitch-fix-ab7d9efe1ac?source=rss-790bcd984129------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab7d9efe1ac</guid>
            <category><![CDATA[success]]></category>
            <category><![CDATA[stitch-fix]]></category>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Shawn Stephens]]></dc:creator>
            <pubDate>Sun, 17 May 2020 21:23:10 GMT</pubDate>
            <atom:updated>2020-05-17T21:34:45.554Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I7hV-MhXrfR6VhnD" /><figcaption>Photo by <a href="https://unsplash.com/@guillealvarez?utm_source=medium&amp;utm_medium=referral">Guille Álvarez</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When looking back at the various teams I’ve been part of throughout my career, I often think about what made certain teams successful, and why others struggled more? What makes a certain group of people work better together than others? Did the organizations put any thought into who they might be putting on the team and what might drive them to achieve successful outcomes for the organization and its clients? Perhaps they simply assembled teams from whatever technical resources they could bring together and hoped for the best.</p><p>Like me, maybe you have never encountered a company culture described as an operating system, or an OS as we call it. At Stitch Fix, we have an OS devoted to ensuring the best outcomes for our people, projects, and clients. Having worked for small startups, consulting firms, and contract software projects, it wasn’t until I saw this OS that I realized just how little thought had been put into building some of the teams of my past.</p><p>It’s no secret that Stitch Fix builds winning teams of engineers, data scientists, UX product designers, business partners, managers, and more. I’ve had the privilege of working with many talented people at Stitch Fix for almost 2 years, and each day I’m positively impacted by three core traits that my team members at Stitch Fix exhibit from our OS.</p><h3>Bright</h3><p>The first attribute we look for in our people is that our people are bright! Google Dictionary defines bright as “intelligent and quick-witted”. However, our OS docs go a bit further to detail what bright people bring to Stitch Fix.</p><ul><li>Someone who is thoughtful and astute in their approach.</li><li>Someone who exercises strong intuition while also being resourceful.</li><li>Someone who is perceptive in their observation and synthesis of information and thinks critically.</li></ul><p>Working as an engineer supporting our warehouse operations, I see this characteristic manifesting daily. People from many roles in our division, including those on the warehouse floor, business partners, and engineers, help to brainstorm ways to arrive at an MVP for a product. You might have heard this defined as a “Minimum Viable Product”. We like to call them “Minimum Valuable Products” since we focus on providing maximum value with our engineering effort. We focus on the things that will impact our operations in the most positive and cost effective way. In turn, this helps ensure our clients receive quality products in a timely manner.</p><p>Every day, I see bright people coming up with intuitive solutions to maximize our MVP efforts. We work with our business partners, who spend time developing efficient solutions for our warehouse operations, to evaluate cost effectiveness when it comes to engineering efforts. We brainstorm solutions where business impact is maximized from engineering effort.</p><p>Brightness comes into play in many other areas with engineering. My exceptionally bright teammates provide thoughtful and astute pull request reviews. They advocate for the end users of our products in intuitive ways. Another example comes to mind as we handle support rotations. People are always eager to dive into a problem and help resolve it quickly.</p><h3>Kind</h3><p>Kindness is perhaps my favorite benefit of working at Stitch Fix. Our OS docs define kind as:</p><ul><li>Someone who is genuinely interested in others and takes an empathetic approach.</li><li>Someone who does what’s right, not what’s easy and gives the necessary feedback.</li><li>Someone who is willing to lend a helpful hand.</li></ul><p>We do a considerable amount of pair programming and problem solving in our daily engineering. This is something many other organizations struggle with in my opinion because they are missing kindness and trust. All too often, engineers have had bad experiences with pairing because their pairing partner grew impatient, frustrated, or even judged their effectiveness after the fact. At Stitch Fix, we focus on pairing, mentoring and teaching with kindness and patience.</p><p>I have the opportunity often to pair program during technical interviews. I ask candidates to relax and be themselves, as this pairing exercise is not only for me to observe, but also for them to gain a realistic view into what pairing would be like on this team. I’ve had some positive feedback in this regard and candidates have mentioned the pairing has been the most positive and effective pairing session they’ve had. I’m not patting myself on the back here, as I owe this compliment to those that have taught me to pair in this manner, and shown me the same patience and kindness.</p><p>My favorite example of kindness often comes out in what we call “Collect and Reflect” where we interview peers about our own performance, collect feedback and reflect. I was somewhat terrified to both give and receive feedback the first time. Our team was relatively new, and had been growing together, but I didn’t really know what my teammates thought of me. I can remember the first feedback I received actually bringing tears to my eyes because my teammates had realized how hard I had been working, appreciated what I was doing for the team, were also genuinely concerned that I didn’t overdo it, and wanted to help. Never in 20 years of software had I received this level of empathy and kindness, and it would be important to me that any future organization I work for have kindness at the forefront of their cultural OS. Being built up, while still receiving valuable feedback pertaining to my growth, has helped me develop considerable trust with my teammates.</p><p>Perhaps the greatest example of kindness at Stitch Fix has come to light during the COVID-19 pandemic. All levels of the organization have exhibited kindness. There has been an understanding that everyone’s situations are different as we tread this new ground. While we focus on meeting our goals as we are largely remote, it has been understood that some goals may slip. In other cases, parents have required more time to adjust to their children’s online learning, or the lack of daycare. Teammates have stepped in to pick up in-progress stories midway through completion. This focus on kindness will ensure our teams remain successful during this challenging time, and that people aren’t overpressed which would result in burnout.</p><h3>Motivated by Challenge</h3><p>The only quality that amazes me more than kindness is how team members are motivated by challenge. Once again, our OS documents define Motivated by Challenge as:</p><ul><li>Someone who embodies a growth mindset and the belief that there’s always a better way.</li><li>Someone who operates with hunger, #StitchFixGrit and perseverance.</li><li>Someone who thrives in ambiguity and is resilient.</li><li>Someone who is goal oriented, has drive, and who thinks challenge is exciting.</li></ul><p>I had the pleasure of leading a project to improve how we designate where our apparel is stored. My teammates and I were mostly experienced in Ruby/Rails, learning Golang, and one had Android experience. Suddenly we found ourselves evolving a system that included Rails, Golang, and Swift iOS development. We quickly identified gaps in testability at the iOS level of the stack, and engineered a way to provide easier testing without having to rely on a physical scanner and device. This allowed the team to focus on learning enough Swift to improve our scanning application. In the end, every team member contributed to all levels of this diverse software stack. We combined pairing, knowledge sharing, and PR reviews to quickly help each other ramp up and ensure the project was delivered in a timely manner.</p><p>This project had other challenges that motivated us. We collaborated with our business partners to arrive at an MVP that would take less time, yet still provide significant improvement to our overall warehouse operational efficiency. Operational efficiency is critical to ensuring that our warehouse associates are able to provide clients with quality inventory sooner as demand grows.</p><p>The project was implemented across the summer period of the year, during which I took a 10 day family vacation. Team members stepped up and led portions of the project during my absence. Working with highly motivated team members made it possible for me to take such a vacation while remaining confident that success would not be impacted by my absence.</p><p>The most significant example of being motivated by challenge again came in recent weeks during the COVID-19 pandemic. As our warehouse network adjusted to state and local stay-at-home orders, suddenly engineering was faced with new challenges due to warehouses having to temporarily close. We had purchase orders for fresh inventory arriving at warehouses that were unable to process the receipts. We had all teams pivoting and reacting efficiently, without complaint, to ensure we could help those warehouse associates as much as possible. We quickly configured a new Men’s warehouse at a location that was not closed, which allowed inventory to be redirected so it would be available for our clients.</p><p>This level of motivation extended from the earliest career engineers up through the top of the organization. Everyone was motivated to solve problems and pause current goals to ensure the safety of our warehouse associates, while still providing our customers with scheduled Fixes.</p><h3>Our Foundation</h3><p>Bright. Kind. Motivated by Challenge. This foundation of our OS continues to ensure we deliver an unparalleled personalized experience to our clients, while providing a winning and rewarding environment for our team members. Bright, Kind and Motivated by Challenge empower a culture of innovation and experimentation for people at all levels of Stitch Fix. This culture produces <a href="https://support.stitchfix.com/hc/en-us/articles/203484490-Shop">more exciting ways to shop</a> like Shop Your Looks and Shop New Colors. It drives a sense of autonomy that is used to break down ambiguity to solve challenges each and every work day. Building diverse teams located across the US that embody these traits allows us to provide a better experience for our diverse population of clients.</p><p>What qualities do you see in people at your employer that make your work life better? Do you see yourself exhibiting the above qualities? Perhaps you start modeling these principles in our organization, and influence others to join in. You should also check out our <a href="https://www.stitchfix.com/careers/jobs">careers</a> page if you are interested in being a part of an organization built on these traits.</p><p><em>This post </em><a href="https://multithreaded.stitchfix.com/blog/2020/05/12/how-people-drive-success-at-stitch-fix/"><em>originally appeared</em></a><em> on the Stitch Fix Multithreaded blog and has been reposted by the author with permission from Stitch Fix.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab7d9efe1ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shawn-stephens/how-people-drive-success-at-stitch-fix-ab7d9efe1ac">How People Drive Success at Stitch Fix</a> was originally published in <a href="https://medium.com/shawn-stephens">Shawn Stephens</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Reasons Your Microservices Architecture Isn’t Working Well]]></title>
            <link>https://medium.com/shawn-stephens/3-reasons-your-microservices-architecture-isnt-working-well-a0d8dd616532?source=rss-790bcd984129------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0d8dd616532</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Shawn Stephens]]></dc:creator>
            <pubDate>Wed, 04 Apr 2018 17:27:53 GMT</pubDate>
            <atom:updated>2018-04-04T18:14:02.356Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tf-B8YU5m6_pt_mg_y6gtw.jpeg" /></figure><p>Many have implemented microservices architectures (MSA) and things just don’t pan out the way they intend. Below are some of the issues I’ve encountered with microservices architectures and some tips on how to solve them.</p><h3>1. You Migrated to a Distributed Monolith</h3><p>Better deployment control and process isolation is often the motivation from moving away from a monolithic app server. For example, if one deployment in the app server suffers from a bug and encounters a race condition or infinite loop, often all other deployments in the app server will suffer degraded performance.</p><p>When the components are reworked and put into microservices hosted in their own processes, new problems are created because the components are now distributed. Previously, the services likely made local calls to each other (via EJB lookups for example), and now those services are making remote calls to each other. Remote calls incur performance penalties which is why care must be taken to rewrite code originally developed to take advantage of an application server’s shared resources and local proximity to other services.</p><p>You may be accustomed to scheduled downtime during restarts for the monolith. The application is brought down or restarted in order to deploy one or more components. I’m aware that hot deployment exists, but I’ve rarely seen it used successfully in all deployments. I know from experience in JBoss it was highly unreliable and there were always instances where certain resources were not released. With the container being brought down, you didn’t have the issue of services trying to communicate with each other during deployments. If the app server is down, the services are down.</p><p>Since the components are now distributed versions of a previously monolithic structure, the code was not written to handle scenarios where remote calls timeout, it expected its dependency to be local. Deploying a new microservice requires a restart of that service and now it causes errors to clients or you must bring down all the microservices. That sounds much worse than restarting the app server. This leads to a second reason your microservices architecture keeps you up at night.</p><h3>2. You Are Calling Services Directly</h3><p>The biggest mistake you can make with microservices is to have clients call them using HTTP based RESTful calls to urls listed in client config files. This creates tight coupling to the location and availability of the dependent services. If a web app makes a call to a microservice that is exposed as a link in its config file, and the microservice needs to be redeployed, then downtime will incur in the web app.</p><p>Many smart proxies and load balancers like <a href="https://www.envoyproxy.io/">Envoy Proxy</a> are being created to fill this need. In addition to load balancing, pointing service clients to a proxy gives you the ability to redirect request as needed, without bringing down your clients. You can then implement additive based deployments where new service versions are brought up alongside the current version. One can smoke test the new version of the service, redirect only a percentage of requests, and eventually all requests by making changes at the proxy level. The old version is then shut down. This results in zero downtime deployments.</p><h3>3. All Services Use the Same Relational Database</h3><p>Microservices Architecture (MSA) recommends that services isolate and encapsulate the data they may store. Having data spread throughout different types of data stores isn’t ideal for anyone writing an efficient report. Even with NoSQL databases becoming more popular, Relational databases still provide the best support for ACID transactions and data integrity in situations such as payment processing. They are also better geared towards reporting needs.</p><p>While relational databases can often scale with read replicas, there are limits. With every read replica you add, you increase network traffic and latency. Even AWS Aurora only support 15 read clones. This likely would not be enough if you consider some apps have tens of millions of users.</p><p>A problem arrises when we commingle requirements like reporting with the primary function of our microservices. Microservices are intended to be self-contained components, with an emphasis on keeping the scope small. However, some developers read that as separate schemas in the same database, or their organizational policies or budget only allows for the single relational database.</p><p>A better approach is to use the right type of data store for your service. If your service benefits from a fast document store like MongoDB, use it. Maybe it tracks payment data and needs ACID transactions provided by PostgreSQL and other relational databases (I realize Mongo 4.0 will support ACID). You can then propagate data to a combined relational store for reporting. This can be done via asynchronous messages being sent from your various microservices at the time data is captured, or it could be done via batch processes designed to gather the data into your relational reporting database.</p><p>By allowing microservices to break away from a single shared monolithic relational store, you allow much better scalability instead of being constrained to a particular number of read replicas for a relational database.</p><p>Many of the issues above I have encountered first hand in my career. I had hunches on how to solve them but I really wanted to learn how others had solved these issues. I highly recommend the book <a href="https://www.manning.com/books/the-tao-of-microservices">The Tao of Microservices</a> for further reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0d8dd616532" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shawn-stephens/3-reasons-your-microservices-architecture-isnt-working-well-a0d8dd616532">3 Reasons Your Microservices Architecture Isn’t Working Well</a> was originally published in <a href="https://medium.com/shawn-stephens">Shawn Stephens</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The DevOps Handbook: Followup Thoughts for Small Business]]></title>
            <link>https://medium.com/shawn-stephens/the-devops-handbook-followup-thoughts-for-small-business-508fb1e3154a?source=rss-790bcd984129------2</link>
            <guid isPermaLink="false">https://medium.com/p/508fb1e3154a</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[small-business]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Shawn Stephens]]></dc:creator>
            <pubDate>Sat, 28 Oct 2017 18:08:45 GMT</pubDate>
            <atom:updated>2017-10-30T13:46:03.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*NiRzrzec3jTdQ6hkvI9WNA.jpeg" /><figcaption><a href="https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_1?ie=UTF8&amp;qid=1509209646&amp;sr=8-1&amp;keywords=devops+handbook+gene+kim">The DevOps Handbook</a></figcaption></figure><p>I just finished reading all 23 chapters of <a href="https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_1?ie=UTF8&amp;qid=1509209646&amp;sr=8-1&amp;keywords=devops+handbook+gene+kim">The DevOps Handbook</a>. The book offers an intriguing view with many brief case studies showing how companies like Google, Facebook, Etsy, LinkedIn, Nationwide, Amazon and other large companies have utilized DevOps practices to become “world-class” companies.</p><p>I agree with most of the concepts presented in the book. However, all of the case studies presented discussed large companies with hundreds or thousands of developers. I would argue these companies are already in great shape as they have the resources and funding to devote the necessary time to improving their situation.</p><p>In my career I’ve worked in both small companies, with only a few developers, as well as large companies with many teams of developers. One might think the small companies have the upper hand to change directions, but often those companies have more lines of code than developers to maintain and improve them. It is forgotten how many thousands of developers it takes to make Google what it is.</p><p>This isn’t to say that a small startup company with greenfield development cannot adopt the principles from this book. These companies can often establish a cadence that includes the additional time to code telemetry and integrate operations in to the daily work of development.</p><p>Often though, small companies are thirsty for profit, and you must have complete organizational buy-in to the fact that it is going to take a bit more time to create a first-class product, which will in turn save you from hitting a wall with deployment frequency and future modifications.</p><p>It becomes even more challenging when the small company has been around for a while, and has considerable brownfield development to contend with. Can these companies afford to delay customer requested features while the small teams tackle the huge amounts of technical debt and inherited code from their colleagues that may have moved on? I think they have to address these technical debt items in order to survive, but often the push orginates from development which is an uphill battle.</p><p>It is important to take baselines and show improvements during efforts to pay down technical debt. We can’t just say we are going to take two days a week to fix the system, and then play with new frameworks. We need to show that we improved code coverage in our tests. Demonstrating improved pipeline flow from development to production would be another way to build trust and show stakeholders that we are trying to become higher performers and eventually improve lead time on feature requests. The book does a good job to lay out the needs to show these metrics.</p><p>Many times, the problem stems from the fact that in order to compete, the small organizations have had to cut corners to meet deadlines. They may have also had to drastically expand product scope, or add additional products to keep pace with competition. The deadline is met and the customer is happy until the next tradeshow which yields an entirely new set of demands. Often the team is not expanded, but the products that had corners cut in the first place have resources moved away from them and the cycle starts on the new project.</p><p>Over the long term, the organization gains hundreds of thousands of lines of code filled with technical debt that cannot be maintained. Third-party dependencies aren’t updated and security incidents may start to occur. I’ve listened to people say “we can’t afford to do this” and “we can’t afford to not do it” as well in the past in small organizations. It eventually turns into, “it’s going to take us forever to do this” because there is simply too much debt and risk to handle.</p><p>I believe implementing DevOps in this type of situation will take a culture shift from trying to cover a large number of product opportunities to instead focusing on paying down technical debt, and seeing the existing product through to its full potential given the limited resources the company has. Many factors determine if a small business can do this. Profitability of existing products and competitor positions in the marketplace come to mind, along with investor or stakeholder expectations.</p><p>The DevOps Handbook is a long read at over 400 pages for the paperback. I found the case studies a quick read as I like to see concrete examples. The core text in the book reads a bit slower, more like a textbook. I don’t believe small organizations should write off the DevOps movements. I believe it is more important to build these concepts into their products since they do have such small teams and limited resources. If not, they will eventually hit a breaking point where they cannot deploy frequently enough, or things break so often that there is no time to do anything except to fight fires.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=508fb1e3154a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shawn-stephens/the-devops-handbook-followup-thoughts-for-small-business-508fb1e3154a">The DevOps Handbook: Followup Thoughts for Small Business</a> was originally published in <a href="https://medium.com/shawn-stephens">Shawn Stephens</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phusion Passenger Enterprise’s Threaded Concurrency Model and the Temple of Process Doom]]></title>
            <link>https://medium.com/shawn-stephens/phusion-passenger-enterprises-threaded-concurrency-model-and-the-temple-of-process-doom-12daa0243bb5?source=rss-790bcd984129------2</link>
            <guid isPermaLink="false">https://medium.com/p/12daa0243bb5</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Shawn Stephens]]></dc:creator>
            <pubDate>Mon, 16 Oct 2017 15:51:55 GMT</pubDate>
            <atom:updated>2017-10-16T17:16:58.279Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*dc3UP5591z0x3UruHXF1Dw.jpeg" /></figure><p>I love Phusion Passenger Enterprise. I really do. It has powered various Rails applications that I have written with incredible stability. We all know Ruby isn’t the fastest or most efficient when it comes to resource utilization, yet Passenger and other threaded servers have greatly improved that area.</p><p>Recently, I started getting reports of missing transaction records for a payment related application that I wrote. As a developer, my first knee jerk reaction was to blame the single MySQL Database Server instance that is far over utilized. I initially wrote it off as simple DB timeouts.</p><p>I continued monitoring the issue, and started checking various telemetry data to try to get to the bottom of this. I learned that it had been occurring since a recent release and it was occurring at random times a day. As I traced our logs I saw that the process was just stopping midway through a payment. The third party payment service showed that payment as successful, yet we had no record of it in our local database.</p><p>I looked at the NGINX logs to find the following:</p><pre>[ 2017-08-10 12:13:17.8374 28309/7f3872a78700 age/Cor/Con/CheckoutSession.cpp:393 ]: [Client 3-85371] Maximum request time of 180 seconds reached, killing process 940</pre><p>…and I felt like the guy in the background below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ln-1JeWbnY8lB2NLtMhRg.jpeg" /></figure><p>Process? What do you mean killing the process? I’m in threaded mode with passenger_concurrency_model thread; and passenger ripped the heart right out of the process.</p><p>Upon examining more configuration, I find the following setting:</p><p>passenger_max_request_time 180;</p><p>I went on to determine that a new algorithm introduced into the code had entered an infinite loop due to bad input that should have been prevented by validation, so the problem was easily fixed.</p><p>However, I learned a lesson in all of this. The passenger_max_request_time setting does not isolate to a given thread. If a single thread in the process starts looping or racing, the entire process is shut down after the timeout. That means the 9 other threads in the process meet the sword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-clehKX5zw5nRGAyHCH8vA.jpeg" /></figure><p>There are a few solutions to this problem. First we could switch to the process concurrency model as defined by the Passenger docs:</p><ul><li>process – single-threaded, multi-processed I/O concurrency. Each application process only has a single thread and can only handle 1 request at a time. This is the concurrency model that Ruby applications traditionally used. It has excellent compatibility (can work with applications that are not designed to be thread-safe) but is unsuitable for workloads in which the application has to wait for a lot of external I/O (e.g. HTTP API calls), and uses more memory because each process has a large memory overhead.</li></ul><p>This isn’t ideal given our current web server and RAM limitations, and because we have a lot of external IO.</p><p>Another solution is to ensure our application never races or enters infinite loops, and that’s the main idea in most applications, but its going to happen sooner or later. This was the first time in 4 years that we’ve had this occur.</p><p>The most ideal solution would be for Phusion Passenger to implement max_request_thread_timeout that can be set when in threaded concurrency mode. I’m not sure what the limitations are around this. Perhaps this is a limitation due to smart spawning or the global interpreter lock (GIL)? <a href="https://www.jstorimer.com/blogs/workingwithcode/8085491-nobody-understands-the-gil">Jesse </a><a href="http://twitter.com/jstorimer">Storimer</a><a href="https://www.jstorimer.com/blogs/workingwithcode/8085491-nobody-understands-the-gil"> explains the GIL</a> as:</p><blockquote><em>MRI has something called a global interpreter lock (GIL). It’s a lock around the execution of Ruby code. This means that in a multi-threaded context, only one thread can execute Ruby code at any one time.</em></blockquote><blockquote><em>So if you have 8 threads busily working on a 8-core machine, only one thread and one core will be busy at any given time. The GIL exists to protect Ruby internals from race conditions that could corrupt data. There are caveats and optimizations, but this is the gist.</em></blockquote><p>One might think that just disabling the request timeout would be best, but that would eventually cause the entire server to die. Until this can be handled gracefully by Passenger, I highly recommend adding telemetry to look for killing process in the nginx logs and then quickly fixing whatever is causing the infinite loop. It would have been better if tests would have caught this, and we had 100% test coverage on the complex algorithm that caused the condition, yet we lacked the proper variance of inputs to catch this edge case that caused the infinite loop.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12daa0243bb5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shawn-stephens/phusion-passenger-enterprises-threaded-concurrency-model-and-the-temple-of-process-doom-12daa0243bb5">Phusion Passenger Enterprise’s Threaded Concurrency Model and the Temple of Process Doom</a> was originally published in <a href="https://medium.com/shawn-stephens">Shawn Stephens</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Command Line First Development]]></title>
            <link>https://medium.com/shawn-stephens/the-command-line-its-more-important-than-your-ide-a6f08f33c719?source=rss-790bcd984129------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6f08f33c719</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Shawn Stephens]]></dc:creator>
            <pubDate>Sat, 26 Aug 2017 21:50:21 GMT</pubDate>
            <atom:updated>2017-10-15T23:51:20.097Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QnPqsgEFZMaQAwEiro-Vuw.jpeg" /></figure><p>Some platforms provide IDEs so feature packed that there is little reason to consider using anything else. Open source technologies such as Ruby, Node.js, Go, and others have no killer IDE. In this post I present why the command line should be prioritized over any IDE.</p><h3>Platform Concerns</h3><p>The programming language and platform have a strong influence on IDE selection. Most development teams are going to use Visual Studio when developing .NET applications. Likewise, MacOS or iOS projects are very likely to use Xcode. Eclipse is a free standard in Java. Commercially produced platforms such as .NET or Apple SDKs usually come with IDEs that are provided to help assist with visual application development and to appeal to developers that may want to try the platform.</p><p>Teams using non-commercial languages such as Ruby will be drastically different. There isn’t a commercial entity directly driving the language and its tools. Developing an IDE takes a considerable amount of resources. Furthermore, Ruby, is dynamically typed, and there isn’t a large focus on refactoring tools as there is in Java or .NET. While IDEs like <a href="https://www.jetbrains.com/ruby">Rubymine</a> exist, they don’t have a <a href="https://stackshare.io/stackups/atom-vs-rubymine">huge following</a>.</p><h3>Open Source is Different</h3><p>In these largely open-source platforms, the command line reigns supreme. Everything you do in Rails, Rake, Bundler, minus editing files or rendering a page in a browser, is done via commands on the command line. The platform has an inherent standard that any development tool should be executable from the command line.</p><p>My statements might upset .NET or Xcode developers as they made considerable leaps over their earlier solutions. The difference exists because the respective IDEs are a developer’s first experience with C# or Swift, and it is easy to quickly become dependent upon the build tools built into the IDE.</p><p>I can remember moving Java projects from Eclipse based IDE packaging to solely ant based automated builds. Some developers at the time simply didn’t want to give up their quick IDE based incremental builds, so we often had to support both until ant and maven plugins became prevalent.</p><p>A developer’s first experience with Ruby will likely be through the Rails framework, along with Atom, Vim, Sublime Text and other free text editors and the command line. I remember it being hugely intimidating coming from the Java and .NET worlds where large memory hungry IDEs rule the world. I quickly adjusted to the simplicity. On one Rails development team, we had developers using every editor I just mentioned, as well as VS Code, and no one knew the difference. All tooling remained command line and encapsulated away from text editing.</p><h3>Keep up with the Community</h3><p>Open source communities such as Ruby and Node.js move rapidly. When Textmate development stagnated, developers moved to Sublime Text if they could afford it. Developers rapidly moved to editors such as Atom as they filled the void, and developers using Vim likely stayed put and laughed. The plugin development shifted just as quickly. Having the ability to move with the community is imperative to staying current in these rapidly evolving platforms.</p><h3>Managers and Tech Leads Take Note</h3><p>If you are considering trying to streamline and standardize on an IDE for your open source team, please take the platform into consideration. When we sit in front a screen all day, we need to be comfortable and happy with the tools we are using. Taking a Vim developer and trying to push him to Atom or vice versa likely wouldn’t work.</p><p>In addition, if all the plugin creators move to a given editor, we need to have the choice to move with them.</p><p>Instead standardize on concepts such as ensuring all projects can be built, tested, and deployed from the command line. If this goal is met, anyone can work on your code without having to learn a given IDE.</p><h3>But We Need Code Analysis</h3><p>If you introduce a static code analyzer, ensure it works from the command line, and make it work as part of your continuous integration cycle. If plugins exist for most major editors, such as with <a href="https://github.com/bbatsov/rubocop">RuboCop</a>, then there isn’t a lot of risk involved.</p><p>The same principle applies other code tools such as code formatters. Doing these tasks as pre-commit tasks can ensure they are always done instead of relying on a manual operation in an IDE.</p><h3>Command Line First for All Platforms</h3><p>Regardless of your platform, keep this command-line-first mentality for tools that involve code production. It will provide developers with more options to do the best job possible. It will also ensure someone can build the source without having an IDE on their machine, which is critical in continuous integration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6f08f33c719" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shawn-stephens/the-command-line-its-more-important-than-your-ide-a6f08f33c719">Command Line First Development</a> was originally published in <a href="https://medium.com/shawn-stephens">Shawn Stephens</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>