Alfresco Tuning Shortlist

During last few years, I have seen dozens of Alfresco installations in production without any kind of tuning. That makes me thing that 1) nobody cares about performance or 2) nobody cares  about documentation or 3) both of them!
I know people prefer to read a blog post instead the product official documentation. Since Alfresco have improved A LOT our official documentation and most of the information provided below can be found there, I want to point out some tips that EVERYONE has to take into account before going live with your Alfresco environment. Remember, it’s easy Tuning = Live, No Tuning = Dead.
Tuning the Alfresco side:
  • Increase number of concurrent connections to the DB in

# Number below has to be the maxThreads value + 75

  • Increase number of threads that Tomcat will use in server.xml – section 8080, 8443 and 8009 in case you use AJP


  • Adjust the amount of memory you want to assign to Alfresco in or (which is the default one):

export CATALINA_OPTS=" -Xmx=16G -Xms=16G"

in JAVA_OPTS make sure you have the flag “-server” that gives 1/3 of memory for new objects, do not use “XX:NewSize=” unless you know what you are doing, Solr takes many new objects and it will need more than 1G in production.


Tuning the Solr side:
In for both workspace and archive Spaces Store


In solrconfig.xml for both workspace and archive Spaces Store 

mergeFactor change it to 25
ramBufferSizeMB change it to 64

April/9/2015 Update! For Solr4 (Alfresco 5.x) add next options to its JVM startup options:

-XX:+UseConcMarkSweepGC -XX:+UseParNewGC

Tuning the DB side:
Max allowed connections, adjust that value to the total amount of your Alfresco or Alfrescos plus 200, consider increase it in case you use that DB for other than only Alfresco.
  • For MySQL in my.cnf configuration file:

innodb_buffer_pool_size = 4GB

  • For Postgres in postgresql.conf configuration file

max_connections = 600

Do maintenance on your DB often. Run ANALYZE or VACCUM (MySQL or Postgres), a DB also needs love!
Tuning the OS side:
I’m not very good on Windows so I will cover only a few tips for Linux:
  • Change limits in /etc/security/limits.conf to the user who is running your app server, for example “tomcat”:

tomcat soft nofile 4096
tomcat hard nofile 65535

If you start Alfresco with a su -c option in /etc/init.d/, for Ubuntu you have to uncomment the line here /etc/pam.d/su, if this is using login (by ssh) it is uncommented by default. For RedHat/Centos this line has to be uncommented here /etc/pam.d/system-auth.

  • Your storage throughput should be greater than 200 MB/sec and this can be checked by:

# hdparm -t /dev/sda
Timing buffered disk reads: 390 MB in  3.00 seconds = 129.85 MB/sec

  • Allow more concurrent requests by editing /etc/sysctl.conf

net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.ip_local_port_range = 2048 64512
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 10

Run “sysctl -p” in order to reload changes.
  • A server full reboot is a good preventive measure before going live, it should start all needed services in case of contingency and we will find if we left something back on the configuration.
Remember, this is ONLY A SHORTLIST, you can do much more depending on your use case. Reading the documentation and taking our official training will be helpful and take advantege that we were polishing our training materials lately.

16 thoughts to “Alfresco Tuning Shortlist”

  1. Toni, is there a reason to adjust memory in Wouldn’t it be better to do this in

    Append/Adjust memory by including this line in

    export CATALINA_OPTS=” -Xmx=16G -Xms=16G”

  2. Hi Gi! Thanks for your comment. I totally agree with you, this is a cleaner way to do it. I will improve the blog post with it. Thanks!

  3. Hi Toni and Gi:

    Nice post (as usual). I would say that in the default installer, the “default” JVM options for the heap memory ($JAVA_OPTS) are set in $ALF_HOME/tomcat/scripts/ (which is called by

    Although it is usual to set java and catalina properties in in Tomcat, I think it is better to set them in, for getting all JVM config in the same place.

    I would say too, maxThreads in Tomcat (7) are 200 by default (in http and ajp).

    Regarding filehandlers, you have to take into account how your java process for tomcat is launched (for example, if su is used in linux init script). Maybe it is necessary to enable user limits ( for /etc/init.d/su



  4. Hi Cesar, thank you very much for your feedback.

    Either way is fine, in most cases it depends on the installation using the installer, using or or any other place where the administrator got control of that.

    On the maxThreads this is a change for Alfresco One 5.0 but it still being a good advice for previous deployments.

    Cesar, could you give me a valid example for /etc/init.d/su configuration file please?


  5. Hi Toni:

    I’m agree that JVM propeties can be set in both files, but as the default Alfresco JVM config is in I prefer to put it there. If not, you can set heap settings in two diferent files (and twice, and that is a problem). Tomcat admin goes to set up to, instead of (where are defined by default). This is if you append, if you override in, you probably miss other important JVM settings for example, related to JMX.

    I send you a file for Ubuntu 14.04 LTS Server Edition (or 12.04) by mail. Anyway you should check that this file contains the next (by default it is commented):

    # Sets up user limits, please uncomment and read /etc/security/limits.conf
    # to enable this functionality.
    # (Replaces the use of /etc/limits in old login)
    session required


  6. Thanks Cesar, I see, if you start Alfresco with a su -c option in /etc/init.d/, in Ubuntu you have to uncomment the line here /etc/pam.d/su, if this is using login (by ssh) it is uncommented by default. For RedHat this line has to be uncomented here /etc/pam.d/system-auth.

    Adding this information to the article, I think now is more clear. Thanks!

  7. Right! Depending on how you launch the java process (in a login shell via ssh, via su or sudo in a init script, even via directly) the security settings for filehandlers are inherited or not. Probably not necessary with with a “Tomcat daemon”. Thanks for the Red Hat feedback.


  8. Hi Tony,

    Thanks for this excellent post.

    On ubuntu the max value for servernet.core.somaxconn is 65535 and not 65536


  9. I use to config the swapping management. If there is only one application running in your server(Alfresco), vm.swappiness=1 or 0(No swapping or only in so very special moment). So, server’s memory will be management by JVM (Xms, XMX high).

    Did you check tcp_tw_recycle with high volume of users from different networks (NAT/proxy)?

    Hasta luego

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.