I'm having an issue with, what I consider high memory usage, on a ExpressionEngine v2.5.3 install. This is a recent EE1 - EE2 upgrade if that makes a difference.
An empty template on this project uses 10MB of memory. I tested on another v2.5.3 project and an empty page there is using 2MB of memory. I'm seeing 30+MB usage on normal templates and frequently the browser loses its connection to the server.
Is an addon causing this increased memory usage? What's the best way to track this backwards?
The install is definitely acting up after this upgrade.
TEMPLATE DEBUGGING
(0.000011 / 9.01MB) - Begin Template Processing -
(0.000172 / 9.01MB) URI: test
(0.000185 / 9.01MB) Path.php Template: /
(0.000199 / 9.01MB) Retrieving Template
(0.000210 / 9.01MB) Parsing Template URI
(0.002112 / 9.02MB) Template Group Found: test
(0.002166 / 9.02MB) Retrieving Template from Database: test/index
(0.003599 / 9.02MB) Template Found
(0.003690 / 9.02MB) Template Type: webpage
(0.003711 / 9.02MB) Parsing Site Variables
(0.003767 / 9.02MB) Snippets (Keys): structure:is:page|structure:is:listing|structure:is:listing:parent|structure:page:entry_id|structure:page:template_id|structure:page:title|structure:page:slug|structure:page:uri|structure:page:url|structure:page:channel|structure:page:channel_short_name|structure:parent:entry_id|structure:parent:title|structure:parent:slug|structure:parent:uri|structure:parent:url|structure:parent:child_ids|structure:parent:channel|structure:parent:channel_short_name|structure:top:entry_id|structure:top:title|structure:top:slug|structure:top:uri|structure:top:url|structure:child_listing:channel_id|structure:child_listing:short_name|structure:freebie:entry_id|structure:child_ids|structure:sibling_ids|structure_1|structure_2|structure_3|structure_4|structure_5|structure_6|structure_7|structure_8|structure_9|structure_10|structure_last_segment|site_id|site_label|site_short_name|last_segment
(0.003784 / 9.02MB) Snippets (Values): FALSE||||||||||||||||||||||test|/test/|/test/||||||test||||||||||test|1|Ranch|default_site|test
(0.003926 / 9.02MB) Parse Date Format String Constants
(0.003943 / 9.02MB) Parse Current Time Variables
(0.003968 / 9.02MB) Parsing Segment, Embed, and Global Vars Conditionals
(0.007698 / 9.11MB) - Beginning Tag Processing -
(0.007719 / 9.11MB) - End Tag Processing -
(0.008645 / 9.12MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.008789 / 9.11MB) - End Template Processing -
(0.008803 / 9.11MB) Parse Global Variables
(0.009574 / 9.11MB) Template Parsing Finished
Memory Usage: 10,163,144 bytes
Different versions of php, and different ways of implementing php ie: mod_php vs. fastcgi for instance, along with different functions enabled in php itself can lead to different levels of memory usage.
To test memory usage for just php being executed rather than in EE's template engine try the code below.
<?php
function echo_memory_usage() {
$mem_usage = memory_get_usage(true);
if ($mem_usage < 1024)
echo $mem_usage." bytes";
elseif ($mem_usage < 1048576)
echo round($mem_usage/1024,2)." kilobytes";
else
echo round($mem_usage/1048576,2)." megabytes";
echo "<br/>";
}
?>
you can pinpoint bottlenecks quite quickly with the Graphite add-on:
https://github.com/joelbradbury/Graphite.ee_addon
I find Graphite itself can really slow down your pages, but if you can get it to load ok it's awesome.
Starting with an empty template, with Template Debugging turned on, is a good start and eliminates any chance of tags causing the high memory use.
Is there anything different setting or add-on-wise between your 2Mb-usage installs and your current 10Mb-usage install? With template tags eliminated as a cause, you might want to look into add-ons that might be adding overhead, in particular extensions. Feel free to post the add-ons you have installed here.
Also disabling tracking and saving templates as files might save you some memory.
It seems the answer to my question is ~9MB is a normal starting level for a blank template on an EE install.
The template which starts at 2MB is on an EngineHosting VPS/VSC account with APC bytecode caching enabled, hence the difference in numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With