<p>You're asking a loaded question. When you mention memory, how exactly are you measuring that?</p>

<p>Site performance can depend on a few factors, including the hosting provider, the hardware, what Craft fields you're using, etc. Craft tends to hit the database a lot so if your connection to MySQL isn't good—say on a mediocre shared hosting provider—that's going to slow you down.  Using a lot of <a href="http://buildwithcraft.com/docs/matrix-fields">Matrix fields</a> can really slow you do or if you're trying to fetch a lot of entries at once.</p>

<p>The best answer I can give without specifics—and the biggest win—is to do some caching with Craft's  <a href="http://buildwithcraft.com/docs/templating/cache"><code>{% cache %}</code></a> tags.  Using the cache will cause Craft to look in its already generated output instead of multiple trips to the db.   Anything that has a  <code>{% for %}</code> loop block is likely going to generate a lot of db queries and is a good candidate for caching (like a navigation menu).</p>

<p>If you're already using caching, make sure you're doing it efficiently. Craft stores the <strong>output</strong> of the cache tag so you need to put the tags around things that actually output something—you can't cache variables. </p>

<p>For example:</p>

<pre><code>{% cache %} 
    {% set whateverEntries = craft.entries.section('whatever') %}
{% endcache %}

{% for theEntry in whateverEntries %}
...
</code></pre>

<p>... won't cache anything.  But this would:</p>

<pre><code>{% cache %} 
    {% set whateverEntries = craft.entries.section('whatever') %}
    {% for theEntry in whateverEntries %}
        &lt;h1&gt;{{theEntry}}&lt;/h1&gt;
           {{theEntry.postExcerpt}}
         ...
    {% endfor %}
{% endcache %}
</code></pre>

CC BY-SA 3.0
2015-11-04T17:21:49.930Z
2015-11-04T17:27:48.910Z
2015-11-04T17:27:48.910Z
RitterKnight
<p>We are experiencing incredibly slow site performance. Any tips on where to find out how much memory the site is using, or if increasing this will increase internal site loading and navigating speed? Thanks for your help!!!</p>

<siteurl>
Slow Site Speed and Increasing Memory
# Slow Site Speed and Increasing Memory

(Asked by: username_0 on 2015-11-03)

We are experiencing incredibly slow site performance. Any tips on where to find out how much memory the site is using, or if increasing this will increase internal site loading and navigating speed? Thanks for your help!!!

**Tags:** siteurl


---

## 1 answers

### Answer by username_1 on 2015-11-04. Score: 6

You're asking a loaded question. When you mention memory, how exactly are you measuring that?
Site performance can depend on a few factors, including the hosting provider, the hardware, what Craft fields you're using, etc. Craft tends to hit the database a lot so if your connection to MySQL isn't good—say on a mediocre shared hosting provider—that's going to slow you down.  Using a lot of Matrix fields can really slow you do or if you're trying to fetch a lot of entries at once.
The best answer I can give without specifics—and the biggest win—is to do some caching with Craft's  {% cache %} tags.  Using the cache will cause Craft to look in its already generated output instead of multiple trips to the db.   Anything that has a  {% for %} loop block is likely going to generate a lot of db queries and is a good candidate for caching (like a navigation menu).
If you're already using caching, make sure you're doing it efficiently. Craft stores the output of the cache tag so you need to put the tags around things that actually output something—you can't cache variables. 
For example:
{% cache %} 
    {% set whateverEntries = craft.entries.section('whatever') %}
{% endcache %}

{% for theEntry in whateverEntries %}
...

... won't cache anything.  But this would:
{% cache %} 
    {% set whateverEntries = craft.entries.section('whatever') %}
    {% for theEntry in whateverEntries %}
        {{theEntry}}
           {{theEntry.postExcerpt}}
         ...
    {% endfor %}
{% endcache %}


---

