<?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[MySQL service still runs with the default 128M innodb_buffer_pool_size]]></title><description><![CDATA[<p dir="auto">On one of my servers I gave the MySQL service a 10 GB memory limit, but innodb_buffer_pool_size is still MySQL's own default of 128M. All InnoDB data of all apps on that server together is 366 MB, so nothing stays cached and every query reads from disk again.</p>
<p dir="auto">What I measured on FreeScout (38k rows in threads, 332 MB of message bodies): a search took 7.8 seconds. I raised the buffer pool to 1G at runtime and the same search took 1.4 seconds. I've left it at 1G for now, but it won't survive a restart of the service.</p>
<p dir="auto">Would it be possible to derive innodb_buffer_pool_size from the memory limit that is already configured for the service? That setting already says how much memory I want it to use. I can't make it stick myself, since /etc/mysql/my.cnf points into /run.</p>
]]></description><link>https://forum.cloudron.io/topic/15767/mysql-service-still-runs-with-the-default-128m-innodb_buffer_pool_size</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 06:10:28 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/15767.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Aug 2026 15:11:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Mon, 03 Aug 2026 23:35:53 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for reporting, I have fixed this now. I have also had to make the container rebuild when the memory limit is changed, so that mysql can adjust itself appropriately on start up.</p>
]]></description><link>https://forum.cloudron.io/post/127671</link><guid isPermaLink="true">https://forum.cloudron.io/post/127671</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 03 Aug 2026 23:35:53 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Mon, 03 Aug 2026 16:36:51 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that covers it. Writing it into the cnf when the container starts is exactly the piece that is missing today, because starting up is the moment the value falls back to 128M.</p>
<p dir="auto">It also fits how things already work: /etc/mysql/my.cnf is a symlink into /run, which gets rebuilt on every start anyway, so there is no new mechanism needed for it.</p>
<p dir="auto">One question while you are in there: does changing the memory limit of a service actually restart its container? In my eventlog a service.configure with a new memoryLimit isn't always followed by a rebuild or a restart. If it isn't, then someone who raises the limit because things feel slow would not see the buffer pool follow until the next restart, which could be months later. Since innodb_buffer_pool_size is a dynamic variable, setting it live at that moment as well would cover that case.</p>
]]></description><link>https://forum.cloudron.io/post/127660</link><guid isPermaLink="true">https://forum.cloudron.io/post/127660</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Mon, 03 Aug 2026 16:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Mon, 03 Aug 2026 12:36:02 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a><br />
The idea was to determin this value on the start up of the MySQL service container and write that into the <code>cnf</code> file.<br />
That should be just fine, right?</p>
]]></description><link>https://forum.cloudron.io/post/127651</link><guid isPermaLink="true">https://forum.cloudron.io/post/127651</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Mon, 03 Aug 2026 12:36:02 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Mon, 03 Aug 2026 11:22:21 GMT]]></title><description><![CDATA[<p dir="auto">That shape looks right to me. Two things from having done it by hand here.</p>
<p dir="auto">It needs to be applied on every start of the service, not just once at install. That is the actual problem I ran into: the value drops back to 128M whenever the mysql service restarts, so a one-off calculation would put people back at the default after the next update.</p>
<p dir="auto">innodb_buffer_pool_size is a dynamic variable, so you can apply it straight after someone changes the memory limit too, without restarting mysql. I resized three servers live yesterday and Innodb_buffer_pool_resize_status tells you when it has finished. One detail worth knowing: MySQL rounds the value up to a multiple of the chunk size, so the effective figure can differ slightly from what the formula produces.</p>
]]></description><link>https://forum.cloudron.io/post/127647</link><guid isPermaLink="true">https://forum.cloudron.io/post/127647</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Mon, 03 Aug 2026 11:22:21 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Mon, 03 Aug 2026 10:34:12 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a><br />
Thanks for the report.<br />
I am thinking about setting a dynamic capped max value for <code>innodb_buffer_pool_size</code>.<br />
Something like <code>clamp(0.5 * memory_limit, 512M, 4G)</code> in words, take half the memory limit, but never go below <code>512 MB</code> and never above <code>4 GB</code>.</p>
<p dir="auto">Do you have thoughts on that approach?</p>
]]></description><link>https://forum.cloudron.io/post/127644</link><guid isPermaLink="true">https://forum.cloudron.io/post/127644</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Mon, 03 Aug 2026 10:34:12 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Sun, 02 Aug 2026 07:55:44 GMT]]></title><description><![CDATA[<p dir="auto">The risk of forgetting and setting this by hand after every reboot is real, so I put a small systemd timer on all three servers. Sharing it in case it's useful to someone else, and to show how little is needed if the value were just set at startup.</p>
<p dir="auto">The script only issues a runtime SET GLOBAL, the same thing I was typing by hand. It doesn't touch any Cloudron file:</p>
<pre><code class="language-bash">#!/bin/bash
set -euo pipefail

WANT_GB=3
WANT=$(( WANT_GB * 1024 * 1024 * 1024 ))

CT=$(docker ps --format '{{.Names}}' | grep -ix mysql | head -1)
[ -z "$CT" ] &amp;&amp; exit 0

CUR=$(printf '%s\n' 'SELECT @@innodb_buffer_pool_size;' \
  | docker exec -i "$CT" bash -c 'mysql -uroot -p"$CLOUDRON_MYSQL_ROOT_PASSWORD" -N' 2&gt;/dev/null | tail -1) || exit 0
case "$CUR" in ''|*[!0-9]*) exit 0 ;; esac
[ "$CUR" -ge "$WANT" ] &amp;&amp; exit 0

printf '%s\n' "SET GLOBAL innodb_buffer_pool_size=$WANT;" \
  | docker exec -i "$CT" bash -c 'mysql -uroot -p"$CLOUDRON_MYSQL_ROOT_PASSWORD"'
logger -t mysql-bufferpool "buffer pool restored: $CUR -&gt; $WANT"
</code></pre>
<p dir="auto">With a timer on OnBootSec=3min and OnUnitActiveSec=15min. The quarter-hourly check is there because the service also restarts on platform updates, not just on reboot. It does nothing when the value is already fine, and the password stays inside the container.</p>
<p dir="auto">WANT_GB is a constant I fill in once per server, at install time, from how much data is actually in there:</p>
<pre><code class="language-bash">DATA_MB=$(printf '%s\n' 'SET SESSION information_schema_stats_expiry=0;
  SELECT ROUND(SUM(data_length+index_length)/1024/1024) FROM information_schema.tables
   WHERE table_schema NOT IN ("mysql","information_schema","performance_schema","sys");' \
  | docker exec -i mysql bash -c 'mysql -uroot -p"$CLOUDRON_MYSQL_ROOT_PASSWORD" -N' | tail -1)

# data x 1.25, rounded up to whole GB, min 1, capped at half the service limit and at 4
WANT_GB=$(( (DATA_MB * 125 / 100 + 1023) / 1024 ))
</code></pre>
<p dir="auto">That gives 3G, 3G and 2G on my three servers (1855, 2077 and 1215 MB of data). The script itself never runs this, it only reads the constant. A bug in a runtime calculation could set something absurd and OOM the container, and this value changes maybe once a year.</p>
<p dir="auto">For Cloudron it could be much simpler than this, because you don't need to know how much data is in there: a fraction of the service memory limit the admin has already configured would be fine. My formula only looks at the data because that's the part I can measure from outside.</p>
<p dir="auto">One correction to my first post: the "366 MB" I quoted for that server was wrong. That was the FreeScout database on its own, not the total. All apps together on that server are 2077 MB, so the default 128M was even further off than I said. If you check this yourself, note that information_schema.tables caches its statistics for 24 hours by default (information_schema_stats_expiry), which is easy to trip over when measuring before and after.</p>
<p dir="auto">Still hoping the value can be derived from the service memory limit, so this timer can go away.</p>
]]></description><link>https://forum.cloudron.io/post/127610</link><guid isPermaLink="true">https://forum.cloudron.io/post/127610</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Sun, 02 Aug 2026 07:55:44 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL service still runs with the default 128M innodb_buffer_pool_size on Sun, 02 Aug 2026 06:56:10 GMT]]></title><description><![CDATA[<p dir="auto">To show this isn't just the one server: on another Cloudron of mine the MySQL service holds 2.4 GB of InnoDB data across all apps, also on the default 128M buffer pool. The four biggest are a monitoring app(LAMP) (689 MB), MainWP (569 MB), Matomo (443 MB) and a geocoding cache (LAMP) (386 MB), so this isn't a "FreeScout only" thing. Memory limit there is 8 GB as well.</p>
<p dir="auto">I've now set 3G there and 2G on a third server, sized to how much data is actually in them. All of it goes back to 128M as soon as the service restarts, which is the main reason I'd rather see the value derived from the memory limit than set by hand.</p>
]]></description><link>https://forum.cloudron.io/post/127608</link><guid isPermaLink="true">https://forum.cloudron.io/post/127608</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Sun, 02 Aug 2026 06:56:10 GMT</pubDate></item></channel></rss>