<?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"><channel><title><![CDATA[Seat reservation expired when many servers using the same redis]]></title><description><![CDATA[<p>Hello,</p>
<p>I'm using Colyseus for managing multiplayer logic in my <a href="https://sgmonda.com/one-week-games-challenge/" rel="nofollow">one-week game challenge</a>. It worked like a charm when I deployed my first project, but after adding another one I've observed errors sometimes when a user tries to create a new room.</p>
<pre><code>colyseus:errors Error: seat reservation expired.
</code></pre>
<p>The funny thing is that I've seen room creation log message in game server A when I was really creating the room in game server B. So I guess something is getting crazy when I use redis presence in both servers.</p>
<p>Am I right? Could redis presence be the source of the problem when two servers use the same redis server? Is there a way, like setting a namespace or similar, to share a redis among many servers?</p>
]]></description><link>http://discuss.colyseus.io/topic/349/seat-reservation-expired-when-many-servers-using-the-same-redis</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 11:02:57 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/349.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Apr 2020 16:46:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Hello,</p>
<p>I'm using Colyseus for managing multiplayer logic in my <a href="https://sgmonda.com/one-week-games-challenge/" rel="nofollow">one-week game challenge</a>. It worked like a charm when I deployed my first project, but after adding another one I've observed errors sometimes when a user tries to create a new room.</p>
<pre><code>colyseus:errors Error: seat reservation expired.
</code></pre>
<p>The funny thing is that I've seen room creation log message in game server A when I was really creating the room in game server B. So I guess something is getting crazy when I use redis presence in both servers.</p>
<p>Am I right? Could redis presence be the source of the problem when two servers use the same redis server? Is there a way, like setting a namespace or similar, to share a redis among many servers?</p>
]]></description><link>http://discuss.colyseus.io/post/1146</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1146</guid><dc:creator><![CDATA[sgmonda]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Fri, 10 Apr 2020 20:03:57 GMT]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/653">@sgmonda</a>, welcome! 👋</p>
<p>From my understanding you have two different games - each one deployed using a single process.</p>
<p>By using the same Redis database, they'll try to communicate with each other. There are two options you can take:</p>
<ol>
<li>Do not use RedisPresence at all. If you have both games on a single process, Redis is not going to help you there.</li>
<li>Use a different Redis database for each game (<code>redis://your-redis-host/0</code>, <code>redis://your-redis-host/1</code>, etc)</li>
</ol>
<p>Hope this helps! Cheers!</p>
]]></description><link>http://discuss.colyseus.io/post/1147</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1147</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Fri, 10 Apr 2020 20:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Wow. It's exactly my situation. I just fixed it by using <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> suggestion.<br />
Thank you</p>
]]></description><link>http://discuss.colyseus.io/post/1148</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1148</guid><dc:creator><![CDATA[boygiandi]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>For the moment I'm using a single process, but I may scale these games in the future. I'll stop using redis presence now but it looks like a temporal fix. Thanks <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> !<br />
Is there any plan to support different games with a single redis database? It would be very useful when using more than a process per game. I mean something like choosing a namespace in the redis presence configuration:</p>
<pre><code>const gameServer = new Server({
  server: http.createServer(app),
  ...
  presence: new RedisPresence({ namespace: 'my-game-one' }),  // &lt;--
});
</code></pre>
<p>That namespace could be used like a preffix in any redis-key used.</p>
]]></description><link>http://discuss.colyseus.io/post/1151</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1151</guid><dc:creator><![CDATA[sgmonda]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/653">@sgmonda</a>, not sure I get your question :)</p>
<p>The same Redis instance can have multiple &quot;databases&quot;. It doens't need to be a different Redis host. The last segment of the Redis URI is the database number. You can use different numbers for each game, in the same Redis instance.</p>
]]></description><link>http://discuss.colyseus.io/post/1152</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1152</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a></p>
<p>I got the same issue regarding &quot;seat reservation expired&quot;<br />
In my case, I use pm2 to create server instances and redbird proxy for load balancing.<br />
I failed to connect to 1 of the server instances, but it's doing okay with the other instance. (for testing, i create 2 server instances) My purpose is to make those servers connected on the same process.<br />
My question is, can redis be used for multiple servers of the same game? Is there any solution I can do to fix this issue?</p>
<p>Hope to hear your feedback about this.<br />
Thanks.</p>
]]></description><link>http://discuss.colyseus.io/post/1165</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1165</guid><dc:creator><![CDATA[volkfalcon]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/659">@volkfalcon</a>, are you using plain <code>redbird</code>, or <a href="https://github.com/colyseus/proxy/" rel="nofollow"><code>@colyseus/proxy</code></a>?</p>
<p>The custom proxy (<a href="https://github.com/colyseus/proxy/" rel="nofollow">https://github.com/colyseus/proxy/</a>) listens to Redis as well to be able to forward the connections to the right Node through the <code>processId</code> available in the URL.</p>
<p>Beware that <code>node-http-proxy</code> seem to have memory leaks (<a href="https://github.com/OptimalBits/redbird/issues/237" rel="nofollow">https://github.com/OptimalBits/redbird/issues/237</a>). Redbird uses it as a dependency, and now <a href="https://github.com/colyseus/proxy/" rel="nofollow"><code>@colyseus/proxy</code></a> is using <code>node-http-proxy</code> directly (it used to be redbird in the past)</p>
<p>Colyseus needs a better option for scalability besides using this proxy.</p>
]]></description><link>http://discuss.colyseus.io/post/1169</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1169</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p>Hi again <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a>,</p>
<p>I was using only plain <code>redbird</code>, and seems like each server can't handle the same process at all. I tried to change the code a bit, following some of your proxy logic but ended up getting the same result. In the end, the proxy should know which host and port to handle the proccess.</p>
<p>Before using <code>redbird</code>, I have also tried <a href="https://github.com/colyseus/proxy/" rel="nofollow"><code>@colyseus/proxy</code></a> but I thought it's not working since it always responded as timeout. After your suggestion, I tried your custom proxy again, and I just found out that the host caught by your proxy is hosted by ubuntu environment, while I tried the url from windows. Things work like a charm right after I change the host on your proxy code to 127.0.0.1 (of course for testing purpose only).</p>
<p>Thanks for the information about memory leaks, but seems like I got no other choice than your custom proxy for now. Yes, colyseus really needs a better option. It helps a lot in multiplayer game development. Hope to hear the good news soon.</p>
<p>Thank you for your kind response, <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a></p>
]]></description><link>http://discuss.colyseus.io/post/1170</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1170</guid><dc:creator><![CDATA[volkfalcon]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Seat reservation expired when many servers using the same redis on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> I didn't know about specifying multiple database using the URI. Thanks!</p>
]]></description><link>http://discuss.colyseus.io/post/1176</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1176</guid><dc:creator><![CDATA[sgmonda]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>