This section describes how to configure the Alfresco repository.
The hardware requirements for the Alfresco repository, Explorer and Share are variable and depend on the number of concurrent users that access the system. You can tune the memory and garbage collection parameters for the JVM to be appropriate for your situation. This section suggests metrics and estimates, but your system may vary.
The size of your Alfresco repository defines how much disk space you will need; it is a very simple calculation. Content in Alfresco is, by default, stored directly on the disk. Therefore, to hold 1000 documents of 1 MB will require 1000 MB of disk space. You should also make sure there is sufficient space overhead for temporary files and versions. Each version of a file (whether in DM or WCM) is stored on disk as a separate copy of that file, so make sure you allow for that in your disk size calculations (for DM, use versioning judiciously).
Use a server class machine with SCSI Raid disk array. The performance of reading/writing content is almost solely dependent on the speed of your network and the speed of your disk array. The overhead of the Alfresco server itself for reading content is very low as content is streamed directly from the disks to the output stream. The overhead of writing content is also low but depending on the indexing options (for example, atomic or background indexing), there may be some additional overhead as the content is indexed or metadata is extracted from the content in each file.
The repository L2 Cache with initial VM overhead and basic Alfresco system memory is set up with a default installation to require approximately 512 MB (maximum).
This means you can run the Alfresco repository and Explorer with many users accessing the system with a basic single CPU server and only 512 MB of memory assigned to the Alfresco JVM. However, you must add additional memory as your user base grows, and add CPUs depending on the complexity of the tasks you expect your users to perform, and how many concurrent users are accessing the client.
Number of users |
Recommended memory / CPU settings per server |
---|---|
For 50 concurrent or up to 500 casual users | 1 GB JVM RAM 2x server CPU (or 1 x Dual-core) |
For 100 concurrent users or up to 1000 casual users | 1 GB JVM RAM 4x server CPU (or 2 x Dual-core) |
For 200 concurrent users or up to 2000 casual users | 2 GB JVM RAM 8x server CPU (or 4 x Dual-core) |
The default PermGen size in Sun JVMs is 64M, which is very close to the total size of permanent objects (Spring beans, caches, and so on) that Alfresco creates. For this reason it is easy to overflow the PermGen as the result of configuration changes or with the addition of custom extensions. It is recommended that you increase the PermGen to avoid OutOfMemory errors, for example, -XX:MaxPermSize=128M is a good starting point.
(Managed Heap + native heap + (thread stack size * number of threads)) cannot exceed 2GB on 32bit x86 Windows or Linux systems
This is a limitation of the Sun Java VM. It means that even if you install 4GB of RAM into your server, a single instance of the JVM cannot grow beyond 2GB on a 32bit server machine.
You can also set up your machine to cluster if you prefer to solve multi-user access performance issues with additional machines rather than a single powerful server.
Alfresco generates a high proportion of temporary objects, both in client threads as well as in the background processes. To reduce the number of temporary objects that spill into the OldGen portion of the heap, you need to set the NewSize option as large as possible.
The following settings reduce the garbage collections and reveal (with GC printing and JMX tracing) that the OldGen was not growing noticeably over and above the permanent space allocated for caches. Cache sizes are still estimated top out around 520M. So, for a typical 32 bit installation with at least 2GB available for the VM, you can use the following settings:
JAVA_OPTS= -Xss1024K -Xms1G -Xmx2G -XX:MaxPermSize=128M
This section applies if you have less than 2GB available.
The stack size of 1024K (-Xss1024K) is generous. Some installations may require a little over 512K on occasion. Many may only use 256K. If the per-thread memory consumption is too high for your installation, reduce the stack size to 512K and then to 256K and note any memory-related errors in the logs.
The NewSize should be kept as large as possible. It can be reduced, but the memory consumption should be watched on a monitoring tool, for example, JConsole, to ensure that the rate of spillover of temporary objects is kept down. If the machine is supporting 500 simultaneous operations, for instance, then the spillover of temporary objects (from NewSize being too small) will cause hold-ups on memory assignment as the garbage collector does sweeps.
This section describes the settings for OldGen.
Given that the OldGen is composed primarily of cache data of up to about 520M, at least 1GB should be reserved for OldGen. Once -Xmx increases, the OldGen can be increased to 2G. 512M should be left as a buffer to account for miscellaneous (PermGen, and so on). So the following variations might be applied:
-Xmx2G -Xms1G -XX:NewSIze=512M (OldGen at least 1G) -Xmx3G -Xms1G -XX:NewSize=512M (OldGen at least 2G) -Xmx4G -Xms2G -XX:NewSize=1G (OldGen at least 2.5G) -Xmx6G -Xms3G -XX:NewSize=2G (OldGen at least 3.5G) -Xmx8G -Xms4G -XX:NewSize=3G (OldGen at least 4.5G)
If you need these levels, you will need to run JConsole (and Java 6) to observe the rate of spillover from Eden space to Survivor to OldGen. If, after the system has been running for a while, the OldGen size stabilizes, then the NewSize can be increased appropriately. The following diagram (using VisualGC) shows how varying the NewSize value affects overall garbage collection activity:
The beans that load the alfresco-global.properties will give preferential treatment to any JVM-set properties.
This section describes how to set the JVM properties.
Set JAVA_OPTS=-Ddir.root=e:/alfresco/data
export JAVA_OPTS==Ddir.root=/srv/alfresco/data
You can use a combination of global properties and system properties for certain customizations. For example, if you wish to distribute a system that has a core set of properties overridden but need to customize the last few for each installation.
-Ddb.username=alfresco -Ddb.password=alfresco -Dindex.tracking.cronExpression='0/5 * * * * ?' -Dindex.recovery.mode=AUTO -Dalfresco.cluster.name=ALFRESCO_DEV
tomcat/scripts/ctl.shIn a standard Windows installation, system properties can be listed in -Dname=value format (separated by semicolons) before ;-Dalfresco.home in:
tomcat/bin/service.batOnce edited, the commands:
tomcat/scripts/serviceinstall.bat REMOVE tomcat/scripts/serviceinstall.bat INSTALLmust be run to re-register the Alfresco service with the new options.
When you install Alfresco, port 8443 is automatically configured for SSL communication between Solr and the Alfresco repository. This means that Alfresco, by default, is set to use client certificates for any authentication (the connector on port 8443 is configured with clientAuth="want").
This causes complications when there is communication between a browser protocol and the repository, because Tomcat requests a client certificate for that communication too.
You can still connect to the repository without a client certificate, however if a certificate is present (for example, if you have installed certificates in your Windows certificate store), then the certificate must be signed by the same Certificate Authority that is used for authentication between the repository and Solr. If you select one of the Windows installed certificates, you will not be able to progress, because the certificate is not one that is expected for the Solr to repository communication. In this situation, you need to cancel the certificate window and then you can proceed. If you have no client certificates, you can use port 8443 without issues.
If you are interested in setting up SSL and security for Solr, this is discussed in detail in Solr security [22].
Cache settings depend on the amount of memory available to your Alfresco server. The default ehcache-default.xml file is enough for most systems and is currently set for 512MB of cache heap memory. This is the recommended default for a Java heap size of 1GB.
All cache settings are in the <configRoot>\alfresco\ehcache-default.xml file.
Some comments may show the approximate amount of Java heap memory required by the cache. Some object references are shared by the caches, so the amount of memory used is not as high as the approximate value may suggest. Cache tracing can show which caches fill quickly for your specific server usage pattern.
Each cache is configured in an XML block with the following parameters:
A typical trace is as follows:
The criteria are:
(MissCount - CurrentCount) must be as low as possible.
(HitCount/MissCount) must be as high as possible.
Estimated maximum size affects the permanent memory taken up by the cache. If the caches grow too large, they may crowd out transient session memory and slow down the system. It is useful to have this running, on occasion, to identify the caches with a low HitCount/MissCount ratio.
org.alfresco.repo.cache.EhCacheTracerJob
org.alfresco.repo.cache.EhCacheTracerJob.org.alfresco
ehCacheTracerJob
Override this bean to change the trigger schedule.
When ehCacheTracerJob is triggered, the job will collect detailed cache usage statistics and output them to the log/console, depending on how logging has been configured for the server.
statistics="true"
Use the cluster cache sample file or copy the default cache configuration file into the <extensions> directory.
Use this information to add a MIME type definition.
<alfresco-config area="mimetype-map"> <config evaluator="string-compare" condition="Mimetype Map"> <mimetypes> <mimetype mimetype="application/xxx" display="My Example Mimetype"> <extension>ex</extension> </mimetype> </mimetypes> </config> </alfresco-config>
Metadata extraction automatically extracts metadata information from inbound and/or updated content and updates the corresponding nodes properties with the metadata values.
The following example shows a new extractor written in class com.company.MyExtracter:
<bean id="com.company.MyExtracter" class="com.company.MyExtracter" parent="baseMetadataExtracter" />
Aspects use properties to enhance content types. You can attach behaviors and workflows to aspects. The following table lists the aspects available in Alfresco along with their description.
Aspects | Description | Changes in Behaviour /Share Interface |
---|---|---|
Classifiable | Enables categories to be assigned to a content item. For example, content items can be categorized under Languages, Region, Software Document Classification, etc. | Adding Classifiable aspect displays an additional Categories property on the Edit properties page. |
Complianceable | This aspect is no longer valid. For compliance-related behaviour, please use Alfresco's Record Management module. | |
Dublin Core | Enables metadata (such as publisher, contributor, identifier, etc) to be added to a content item. | Adding Dublin Core aspect displays the following additional metadata properties
on the Edit Properties page:
|
Effectivity | This aspect is no longer valid. For compliance-related behaviour, please use Alfresco's Record Management module. | |
Summarizable | Enables addition of a brief description about the content item. | Adding Summarizable aspect displays additional Summary property on the Edit Properties page. |
Versionable | Enables versioning of a content item each time it is edited (checked out and checked back in or updated). In AlfrescoShare, content items are versionable by default. | Adding Versionable aspect displays the version history of a content item in the Version History section. |
Templatable |
Enable template view.
Note: This aspect is only available in Alfresco
Explorer.
|
|
Emailed | Captures email-related information of the content item, if it is received as an email attachment. | Adding Emailed aspect displays additional properties (such as Originator, Addressee, Addresses, Sent Date and Subject) on the Edit Properties page. |
Inline Editable |
Enables content items to be edited directly within the document library. |
Adding Inline Editable aspect displays the Inline Edit link in the Document Actions section. |
Taggable | Enables tagging of content items using keywords. In AlfrescoShare, content items are taggable by default. |
Adding Taggable aspect displays the tagged keywords in the Tags section. You can also search for content items in the Document Library using the keywords displayed. |
Geographic | Enables a content item to be geographically tagged using latitude and longitude information. The location of content item is displayed as a marker on Google Maps. Click on the marker to display the Document Details page for that content item. | Adding Geographic aspect displays additional Latitude and Longitude properties on the Edit Properties page. Also, the View on Google Maps link is displayed in the Document Actions section. |
EXIF | Enables capturing and viewing of additional image-related metadata of a content
item. Note: This aspect is automatically applied to an image content
item.
|
Adding EXIF aspect displays additional information (such as Camera Model, Camera Software, Resolution Unit, etc) about the image in the Edit Properties page. |
Audio | Enables capturing and viewing of additional audio-related metadata of a content
item. Note: This aspect is automatically applied to an audio content
item.
|
Adding Audio aspect displays additional information (such as Album, Artist, Composer, Track Number, etc) about the audio file in the Edit Properties page. |
Index Control | Enables control over how a content item is indexed. | Adding Index Control aspect displays additional Is Indexed and Is Content Indexed in the Edit Properties page. |
When content is versionable, the version history is started. The first version of the content is the content that exists at the time of versioning. If you want all content to be versionable at the instant of creation, you can modify the definition of that content type in the data dictionary. The definition must include the mandatory aspect versionable.
By default, all versionable content has auto-version on. As a result, when content is updated, the version number is updated. The auto-version capability can be turned off on a content-by-content basis in the user interface. If you want auto-versioning to be off for all content, you can modify the definition of that content type in the data dictionary.
This section describes enabling versioning for all content in the repository.
<type name="cm:content"> <properties> ... </properties> <mandatory-aspects> <aspect>cm:versionable</aspect> </mandatory-aspects> </type>
This section describes how to disable versioning for all content in the repository.
version.store.enableAutoVersioning=false
When this property is set to false, the VersionableAspect will not respond to any events; even if the aspect is present, it will not create versions.
To enable replication, you set one server (the slave) to take all its updates from the other server (the master). During replication, no data is actually copied. It is the SQL statements that manipulate the data that is copied.
All statements that change the master database are stored in the master's binary logs. The slave reads these logs and repeats the statements on its own database. The databases will not necessarily be exactly synchronized. Even with identical hardware, if the database is actually in use, the slave will always be behind the master. The amount by which the slave is behind the master depends on factors such as network bandwidth and geographic location. The other server can be on the same computer or on a different computer. The effect of replication is to allow you to have a nearly current standby server.
Using more than one server allows you to share the read load. You can use two slaves. If one of the three servers fails, you can use one server for service while another server can copy to the failed server. The slaves need not be running continuously. When they are restarted, they catch up. With one or more slaves you can stop the slave server to use a traditional backup method on its data files.
Each slave uses as much space as the master (unless you choose not to replicate some tables) and must do as much write work as the master does to keep up with the write rate. Do not be without at least one slave or comparable solution if high reliability matters to you.
This section describes the replication steps for the MySQL database.
GRANT REPLICATION SLAVE ON *.* TO <slave_user> IDENTIFIED BY '<slave_password>'
[mysqld] log-bin server-id=1
This will be used to start the slave server. You can skip this step if you use the LOAD DATA FROM MASTER statement, but first review the following comments about locking the master.
master-host=master-hostname master-user=slave-user master-password=slave-password server-id=2
The slave user and slave password are those to which you set when you granted REPLICATION SLAVE permission on the master. The server-id must be a unique number, different to the master or any other slaves in the system. There are also two other options: master-port, used if the master is running on a non-standard port (3306 is default), and master-connect-retry, a time in seconds for the slave to attempt to reconnect if the master goes down. The default is 60 seconds.
Restore the data from the master, either as you would normally restore a backup or with the statement LOAD DATA FROM MASTER. The latter will lock the master for the duration of the operation, which could be quite lengthy, so you may not be able to spare the downtime.
You can also set the basic pool information in the alfresco-global.properties file.
db.pool.initial=10 db.pool.max=100
For explanations of each property shown in the file, refer to: http://jakarta.apache.org/commons/dbcp/configuration.html [29]
<configRoot>/alfresco/content-services-context.xml
<!-- Content Transformations -->
If you save the file in the <extension> directory, the filename must end with ‑context.xml.
You can use the cm:indexControl aspect to set up indexes in Alfresco Share. This aspect enables you to control indexes for the control items. The aspect exposes two properties that allow configuration of indexing of nodes to which it is applied.
Property | Allowed values | Default | Description |
---|---|---|---|
cm:isIndexed ((content + metadata)) | True or False | True | Controls whether the node is indexed or not. |
cm:isContentIndexed | True or False | True | Controls whether the node content (binary) is indexed or not. Setting this to false inhibits full text indexing of the document binary. |
Using this aspect you can choose to disable repository-wide indexing. This can prove useful in situations, such as bulk loading.
For more information on working with aspects, see Managing aspects [30] section.
Links:
[1] https://docs.alfresco.com/../concepts/jvm-tuning.html
[2] https://docs.alfresco.com/../concepts/cmd-line-config.html
[3] https://docs.alfresco.com/../concepts/jvm-prop.html
[4] https://docs.alfresco.com/../concepts/configure-ssl-intro.html
[5] https://docs.alfresco.com/../concepts/cache-memorysettings.html
[6] https://docs.alfresco.com/../tasks/mimetype-add.html
[7] https://docs.alfresco.com/../tasks/metadata-config.html
[8] https://docs.alfresco.com/../concepts/aspect-about.html
[9] https://docs.alfresco.com/../concepts/versioning.html
[10] https://docs.alfresco.com/../concepts/replication.html
[11] https://docs.alfresco.com/../tasks/connpool-config.html
[12] https://docs.alfresco.com/../tasks/contenttrans-customize.html
[13] https://docs.alfresco.com/../concepts/admin-indexes.html
[14] https://docs.alfresco.com/../concepts/ch-administering.html
[15] https://docs.alfresco.com/../concepts/programming-intro.html
[16] https://docs.alfresco.com/../concepts/jvm-settings.html
[17] https://docs.alfresco.com/../concepts/intro-core.html
[18] https://docs.alfresco.com/../concepts/jvm-lowend.html
[19] https://docs.alfresco.com/../concepts/jvm-newsize.html
[20] https://docs.alfresco.com/../tasks/props-set.html
[21] https://docs.alfresco.com/../tasks/bean-override.html
[22] https://docs.alfresco.com/solrsecurity-intro.html
[23] https://docs.alfresco.com/../concepts/cache-indsettings.html
[24] https://docs.alfresco.com/../tasks/caches-trace.html
[25] https://docs.alfresco.com/../tasks/versionable-make.html
[26] https://docs.alfresco.com/../tasks/autoversion-disable.html
[27] https://docs.alfresco.com/../concepts/serv-version-about.html
[28] https://docs.alfresco.com/../tasks/replication-setup.html
[29] http://jakarta.apache.org/commons/dbcp/configuration.html
[30] https://docs.alfresco.com/../tasks/library-item-manage-aspects.html