1 Minimal Requirements
The system should provide at least 4GB of memory.
Overview over memory distribution for the basic Gentics Content.Node package.
Programm | Memory Usage |
---|---|
MySQL | 500 MB |
Apache + APC | 600 MB |
JVM + JCS-Cache | 1024 MB |
Total | 2124 MB |
2 CMS Tomcat Memory
Additionally the JVM memory settings can be set in the /Node/etc/env.sh file.
export JAVA_OPTS="-Dcom.gentics.contentnode.config.url=http://localhost/.Node/?do=24 -Xmx2560m -Xms2560m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true"
Additional configuration files for the tomcat can be found at the following locations:
- /Node/etc/tomcat/*.xml
- /Node/etc/tomcat/*.properties
Please note that 32-bit systems cannot allocate more than 1500MB. On 64-bit systems this limit does not apply.
2.1 Native File Utils
By default the Gentics Content.Node NativeFileUtils are enabled.
The NativeFileUtils do not support Symlinks and require more memory than the JavaFileUtils.
Possible error messages that are caused by insufficient memory are:
finalizing filewrite: could not delete pub_old! Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
JCONFIG['fileutils.class'] = 'com.gentics.contentnode.publish.NativeFileUtils'; // or JCONFIG['fileutils.class'] = 'com.gentics.contentnode.publish.JavaFileUtils';
2.2 JCS Cache Size
The node object cache is a Java cache inside of the CMS Tomcat. This cache is used to cache node objects like pages, templates and files. Increasing this memory can help speed up the loading times of pages in preview mode and the publishing process.
jcs.region.gentics-nodeobjects.cacheattributes.MaxObjects=100000
By default the largest cache region is configured to hold 100k objects. An object size of 1kB is assumed for this cache setting. The memory requirements depend upon the existing content. The profiler webapp can be used to create a differential measurement (Full GC, Check Used Memory, Cache Clear). An OutOfMemoryException or stalling garbage collection can occur when the cache region is too large for the heap memory.
2.2.1 Rule of thumb
Assume 50 kB to 300 kB per object and apply the following formula:
Cache memory usage = 50 kB * object count (Page, Folder, Image, File…) to 300 kB * object count (Page, Folder, Image, File…).
2.3 Import Export
The memory usage for the Import/Export feature during transports involving large amounts of data can vary greatly and depends upon the complexity of the implementation of the existing content.
3 MySQL Memory
The main MySQL settings are innodb_buffer_pool_size and innodb_log_file_size.
innodb_flush_log_at_trx_commit=2 // Should be 50-80% of main mysql memory innodb_buffer_pool_size=2048M // Should be 25% of innodb_buffer_pool_size innodb_log_file_size=512M
Please note that changes to innodb_log_file_size require the deletion of the MySQL logfile and a restart of the MySQL server.
cd /Node/var/mysql rm ib_logfile* /Node/bin/nodectl restart mysql
4 Apache
The memory usage is defined by the amount of started child processes. On average a child process uses about 5MB of memory.
The settings used are MinSpareServers and MaxClients.
The Apache configuration settins are located in /Node/etc/httpd.custom.conf
- /Node/apache/conf/httpd.common.conf
The common configuration file for the Apache server.
- /Node/apache/conf/httpd.conf
This file contains the main configration for the Apache server.
- /Node/apache/conf/httpd.custom.conf
This file should be used to store local user defined settings. This file will not be changed during the update process.
4.1 APC PHP Cache
You can also tune the APC PHP Cache settings. Normally these settings can be left unchanged.
[APC] extension=apc.so apc.enabled=1 apc.shm_size=128M apc.ttl=7200 apc.user_ttl=7200 apc.max_file_size=16M
5 Memory Formula
Memory Value | Formula/Value |
---|---|
Avarage Object Size (Pages, Files, Folders, Images..) | 10 kB |
MySQL Memory | Total Memory * 0.4 |
Java Heap Memory | Total Memory * 0.45 |
JCS Node Object Cache Count | (JavaMemory * 0.75) / Avarage Object Size |
Apache + APC Memory | 0.5 GB |
System Memory | 0.5 GB |