<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Roadrunner on Murat Useinov</title>
    <link>https://useinov.com/tags/roadrunner/</link>
    <description>Recent content in Roadrunner on Murat Useinov</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 03 Apr 2023 15:45:00 +0300</lastBuildDate>
    <atom:link href="https://useinov.com/tags/roadrunner/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Persistent PHP workers need discipline</title>
      <link>https://useinov.com/posts/2023/persistent-worker-discipline/</link>
      <pubDate>Mon, 03 Apr 2023 15:45:00 +0300</pubDate>
      <guid>https://useinov.com/posts/2023/persistent-worker-discipline/</guid>
      <description>&lt;p&gt;A static array with the comment &amp;ldquo;cache, cleared per request&amp;rdquo;. It went to production on RoadRunner last month, and the memory graph turned into a staircase.&lt;/p&gt;
&lt;p&gt;PHP had one superpower nobody advertised: the request died. Every leak, every forgotten static, every open transaction was erased when the process shut down. Shared-nothing was not architecture. It was amnesia, and amnesia forgave us everything.&lt;/p&gt;
&lt;p&gt;RoadRunner and Swoole take it away. The worker lives for thousands of requests, and the class of bugs changes on the first day. That &amp;ldquo;per request&amp;rdquo; cache became a cache per worker lifetime, and the supervisor killed the process when it ran out of memory. A logger kept the request id in a property, so entries from user B carried the id of user A. And the best one: an exception in the middle of a Doctrine transaction left the connection with the transaction open, and the next request on that worker silently joined it.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
