<?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[CodinGame - Medium]]></title>
        <description><![CDATA[Programming is Fun! Try it - Medium]]></description>
        <link>https://medium.com/codingame?source=rss----cf6755c9a930---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CodinGame - Medium</title>
            <link>https://medium.com/codingame?source=rss----cf6755c9a930---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:49:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/codingame" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Story of a Reddit Hug of Death and Lessons Learned]]></title>
            <link>https://medium.com/codingame/story-of-a-reddit-hug-of-death-and-lessons-learned-3565bb8a6793?source=rss----cf6755c9a930---4</link>
            <guid isPermaLink="false">https://medium.com/p/3565bb8a6793</guid>
            <category><![CDATA[hug-of-death]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[postmortem]]></category>
            <category><![CDATA[reddit]]></category>
            <dc:creator><![CDATA[Thibaud Jobert]]></dc:creator>
            <pubDate>Fri, 10 Nov 2017 14:12:12 GMT</pubDate>
            <atom:updated>2017-11-16T10:40:36.454Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*APd16gnUJrZylogNg2hv6w.jpeg" /></figure><p><strong><em>Last Monday afternoon, a link to CodinGame was posted on reddit. It gained a lot of success and resulted in what is called a hug of death: our platform went down for 2 hours because of the overwhelming amount of new visitors.</em></strong></p><h3>Internet is Beautiful</h3><p>This was so far a normal day. We were working on the last preparations for the next multiplayer coding contest <a href="https://www.codingame.com/contests/hypersonic?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=hypersonic">Hypersonic</a> to be held this Saturday. Around 2pm, Nico, our CTO, shouted that we were suddenly receiving a lot of traffic.<br>A link to our starting page had been posted on the subreddit /r/InternetIsBeautiful under the title “<a href="https://www.reddit.com/r/InternetIsBeautiful/comments/53h2sl/learn_to_code_writing_a_game/">Learn to code writing a game</a>”. The traffic was already 10 times higher than usual and we were rejoicing.<br>After a few minutes watching the incoming traffic grow more and more, we began to notice some lags…</p><p><em>When will it stop? Can we support the load?</em></p><h3>From Excitement to Panic</h3><p>After some quick monitoring, we realized the CPU of the database server was already capped. We decided to multiply the capacity of our RDS (Amazon Relational Database Service) by 4 on AWS. It took 30 minutes at the end of which it interrupted the service completely. We had no choice.<br>After that change, the server was able to take in a lot more load, lags came back again pretty soon, when some other point of the architecture started to fail too. Now the front-end servers were failing.<br>The CodinGame platform normally uses two application servers hosted on EC2, behind a load balancer. So we tried scaling up by doubling that number (we eventually reached 6 servers in the end), but some of them started to crash. We tried relaunching them, to see them fail again after a short time.<br>The platform was becoming barely usable. What a waste, all this traffic to a dead/lagging site…</p><p><em>Reddit had put CodinGame to its knees.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*yRIkx8Qw5e_mn6bBnUah4Q.jpeg" /></figure><h3>Crisis Management</h3><p>While activity on our social media channels started to increase, the CodinGame chat was buzzing with questions. The community regulars were doing their best welcoming newcomers.<br>The chat server was also under heavy load and wouldn’t accept new users (more on this later). Forum didn’t last long either. We took the opportunity to offer an AMA (ask me anything) in the comments of the reddit thread.<br>At the same time, a <a href="https://www.twitch.tv/hardlydifficult">Twitch streamer</a> was desperately waiting to do a Clash of Code session. Things were looking bad and everyone was preoccupied. Reddit finally tagged the post with “Hug of Death” so visitors didn’t end on a dead site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*SB_CNd3xQGd6sZlJ4Ml17A.gif" /></figure><h3>The End of the Tunnel</h3><p>After two long hours, we managed to get the servers back and running, and we asked the reddit moderators to bring back the thread. Traffic came back as a wave as the thread was reposted on Hacker News and other tech news sites. And lags again. Something was taking down our servers and we couldn’t find what. Finally we put in place a script that would reboot a server each time it failed so we maintain the service over the night.</p><h3>Maxime Chéramy on Twitter</h3><p>Reddit&#39;s hug of death on CodinGame, it reminded me this moment from Silicon Valley: https://t.co/Xwp4Q8FVfV Still on Reddit frontpage!</p><p>On Tuesday afternoon, when things had calmed down, we took the time to come back on what had happened. Traffic had been crazy: we got as many new users in one day as during the last two months. There had been technical failures. Understandable failures but to be taken care of.</p><h3>Post-Mortem — What went Wrong</h3><p>1) The main bottleneck of the CodinGame platform is the RDS database. Every information on CodinGame is centralized there, all tangled. We cannot distribute the database without setting up separate servers splitting users, for instance by region (America, Europe, Asia). This is the major scaling issue.</p><p>Solution: the short term action we’ll take is to investigate caching solutions, distributed caches between our application servers.</p><p>2) The second issue we’re currently following up is a memory leak on the application servers. This bug occurs when a server is under heavy load and eventually leads to a crash.</p><p>Solution: track the bug, kill the bug.</p><p>3) <a href="https://www.codingame.com/forum/">The CodinGame forum</a> is hosted on a really small machine, and is poorly integrated on the platform through an iframe so that every user on any page of the site sends an SSO authentication request to the forum. The number of queries that were sent to this instance capped the CPU, and just like that, the forum was no more.</p><p>Solution: Better integrate SSO between the website and the forum to avoid unnecessary requests. Migrate the forum on a tougher machine.</p><p>4) This very blog crashed, simply because it was… hosted on the same machine as the forum, that maxed out the CPU.</p><p>Solution: Separate applications in different containers/machines.</p><p>5) The CodinGame chat server did exactly what it was expected to do: fail under heavy load. It uses XMPP over WebSocket, with a custom client built on top of <a href="https://github.com/legastero/stanza.io">stanza.io</a>, and a back-end built with <a href="https://prosody.im/">Prosody</a>. Prosody is a really cool back-end built with lua, but it has the slightest problem: it is single-threaded and non-distributable. So, as expected, the server process quickly reached 100% of a single CPU core and started to lag badly and act erratically. It didn’t crash, but wouldn’t take in new users.</p><p>Solution: Switch our back-end solution to a scalable one, such as eJabberd or MongooseIM.</p><p>6) Last point of failure in this real world scalability test: the push server. We use a websocket connection to push data to the client, triggering diverse events (notifications, mostly). This server had a limitation of open file descriptors, arbitrarily set to 10K. We set it to 100K and it started working again, accepting up to 60K simultaneous connections (this is the best estimation we have of the number of open tabs at that moment) before it went night-night.</p><p>Solution: This is an <a href="https://en.wikipedia.org/wiki/Embarrassingly_parallel">Embarrassingly Parallel Problem</a>, and it should have been a scalable pool of servers behind a load balancer from the beginning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKf5QxPvP0sO8wkUkqgT9w.jpeg" /><figcaption>The reddit effect: traffic on CodinGame</figcaption></figure><p>We took a blow, but we’re back on our feet, stronger than ever. We’ll be happy to answer any question you might have about this special event. Don’t hesitate!<br>Welcome to all the new users!</p><p><em>This post has originally been shared on </em><a href="https://www.codingame.com/blog/how-did-codingame-survive-reddit-hug-of/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=blog"><em>CodinGame blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3565bb8a6793" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codingame/story-of-a-reddit-hug-of-death-and-lessons-learned-3565bb8a6793">Story of a Reddit Hug of Death and Lessons Learned</a> was originally published in <a href="https://medium.com/codingame">CodinGame</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of Programming is Ours to Make]]></title>
            <link>https://medium.com/codingame/the-future-of-programming-is-ours-to-make-d6ff690bc656?source=rss----cf6755c9a930---4</link>
            <guid isPermaLink="false">https://medium.com/p/d6ff690bc656</guid>
            <category><![CDATA[tech-industry]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Thibaud Jobert]]></dc:creator>
            <pubDate>Fri, 10 Nov 2017 13:14:21 GMT</pubDate>
            <atom:updated>2017-11-16T10:41:49.229Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LgNVJ7jXL9dRENSUE1vzg.jpeg" /><figcaption>Let’s not forget the history of programming</figcaption></figure><p>Last week, <a href="https://twitter.com/billsourour">Bill Sourour</a>, software programmer and teacher, had the courage to share his story of <a href="https://medium.freecodecamp.com/the-code-im-still-ashamed-of-e4c021dff55e#.6z2lr9ety">the code he’s still ashamed of</a>. Great read. If you haven’t read it yet, take a moment, go ahead (4 minutes), I’ll wait.</p><p>Bill wrote that one thing which inspired him to share the story was the video T<a href="https://www.youtube.com/watch?v=ecIWPzGEbFc">he Future of Programming</a> from <a href="https://twitter.com/unclebobmartin">Robert Cecil Martin</a>, aka “Uncle Bob”. Then I took time to watch it. The talk is truly inspiring but quite long (1 hour and 20 minutes). Here below are its key parts.</p><h3>A Need for Discipline</h3><p>Most of Uncle Bob’s talk is focused on the history of programming. For him to know where the industry of programming should go, we must first look at its past.</p><p>Uncle Bob goes back to a report written in 1945 by the father of theoretical computer science, Alan Turing. Turing felt that the programming industry would need “a great number of mathematicians of ability” to thrive in the future. He also wrote about the necessity to maintain an “appropriate discipline, so that we do not lose track of what we’re doing”. “Discipline”, to be understood here as a mean to optimize working methods, is at the center of the talk. Uncle Bob explains that programmers tend to get super excited about everything and therefore lose their focus.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=1340&amp;end=1463">Mathematicians of ability, a great number, appropriate discipline</a> (2mn video excerpt)</p><h3>A Change in the Industry</h3><p>Bob chronologically explains the evolution of the programming industry throughout the years until 1970. At the beginning of programming, there were obviously no Computer Science degrees in universities. Back then those who worked as programmers were recruited because they were the brightest people in their field and also had a technical bent. They were mature people who had already worked somewhere else, they understood business and management, they knew how to manage their time and work together…</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=2258&amp;end=2351">Not mathematicians but…</a> (2mn video excerpt)</p><p>In 1970 however, the industry started to be dominated by young men, who freshly got their degrees. Like Bob himself. Computer science was seen as a new career eldorado.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=2591&amp;end=2681">This was the career</a> (2mn video excerpt)</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=2853&amp;end=2908">Up to 1970</a> (1mn video excerpt)</p><p>At this time, the “<a href="https://en.wikipedia.org/wiki/Waterfall_model">waterfall model</a>” was invented to help handle the process of software development. This sequential design process quickly became the reference. Uncle Bob explains it by the fact that all these young programmers needed discipline, a process they could follow. They needed close management and fixed processes.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=3011&amp;end=3031">The era of waterfall</a> (1mn video excerpt)</p><h3>From Waterfall to Agile</h3><p>Uncle Bob then points out the one thing that didn’t change: software. You could go back in time, and be able to write code. Code could be reduced to assignments statements, “if” statements and “while” loops. The advancements in software had been more in “what not to do” than “what to do”. For example, functional programming (invented in 1958 with Lisp) told programmers not to use assignments. Structured programming (1968) told programmers not to use unrestrained “goto”.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=3340&amp;end=3518">What didn’t change</a> (3mn video excerpt)</p><p>Programmer was still a young profession, and its level of professionalism needed to change. Around 1995, the very first disciplined programmers retired. Some people from the first wave of career programmers, including uncle Bob, realized that the way of doing programming had to change so they wrote the <a href="https://en.wikipedia.org/wiki/Agile_software_development">Agile manifesto</a> in 2001. Programmers were not just operators anymore. They needed to be part of the whole process of creation. They also needed to take the responsibility of what they were building. This was in line with what Turing had written. Agile is about discipline. Agile is about all the promises you make, and not a list of tasks you follow. A programmer must know how to work in within short timeframes, how to estimate the needed work in relative units, how to communicate with customers…</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=3576&amp;end=3828">Agile discipline</a> (4mn video excerpt)</p><p>A problem happened when business got in the way. Business was totally in line with what the Agile movement offered. The whole set of principles made sense. However business started to take control over some of the activities of software development. The issue is that business doesn’t always understand what programmers are doing. It’s not part of their expertise and shouldn’t be.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=3863&amp;end=3901">Business doesn’t understand tech discipline</a> (1mn video excerpt)</p><h3>The future of programming</h3><p>Agile has become less and less technical. Software craftsmanship is slowly getting swallowed up by business and project managers. The irony is that one goal of Agile was to “heal the divide between business and programming” (Kent Beck). Uncle Bob believes that it has failed and that things have to change, again. Programmers have to grow up and define their profession, their practices, and the discipline they use, because they are the ones who have the expertise to do so.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=4193&amp;end=4231">What has to be done</a> (1mn video excerpt)</p><p>Programmers will have to lead. Software is everywhere and nothing can happen without software. Programmers hence have a huge responsibility. A lot of things can go wrong because of the work of programmers. Uncle Bob takes the example of car crashes due to software issues. As the work of programmers is critical in so many fields, they must take the responsibility of what they’re building. If they don’t, governments and politicians will write the rules themselves: what processes, what languages or what platforms programmers should use. Uncle Bob finally explains the need for programmers to regulate themselves, define the ethics and principles they should follow and set a level of moral discipline to respect. It could lead to programmers taking an oath as doctors take the <a href="https://en.wikipedia.org/wiki/Hippocratic_Oath">Hippocratic oath</a>.</p><p><a href="https://www.youtube.com/embed/ecIWPzGEbFc?start=4550&amp;end=4652">If programmers don’t regulate themselves, others will do it for them</a> (2mn video excerpt)</p><p>This is what uncle Bob thinks the future of programming will be. We may agree or disagree with it. Looking back at the story Bill shared, we can wonder what would have happened had the programmers regulated themselves like Bob suggests.</p><p>It’s really interesting to see how uncle Bob looks back at the history of programming to help us understand today’s industry and imagine a future for it. This talk brings up a lot of interesting questions around the world of professional programming.</p><p>From a few talented scientists to millions, the numbers of developers has grown almost exponentially in the last decades. It may be time for developers to shape their profession. How can we manage to communicate properly inside our community and show a united face to the world? With so many new programming languages created every year, how can we keep introducing new people to programming? How can we provide them with the most efficient working methods and help them master their craft in the best possible way? Coding is a form of art and a passion that allows developers to create anything. This “anything” tends to scare more and more. The question of ethics is more present than ever with the rise of artificial intelligence.</p><p>Let’s envision the future of programming under the light of professional structuring and computer ethics. Developers would take responsibility for what they produce, keeping into account the end product they work on, and the type of contribution they make to the fast-growing innovative industry they belong to.</p><p><em>This post has originally been shared on </em><a href="https://www.codingame.com/blog/agile-failed-peek-future-programming/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=blog"><em>CodinGame blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6ff690bc656" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codingame/the-future-of-programming-is-ours-to-make-d6ff690bc656">The Future of Programming is Ours to Make</a> was originally published in <a href="https://medium.com/codingame">CodinGame</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>