Configuring Synchrony

Synchrony is the engine that powers collaborative editing in Confluence.

There's no UI for configuring Synchrony. Configuration changes, such as changing the Synchrony port or memory settings, are made via system properties. How you pass these properties depends on whether Synchrony is managed by Confluence, or deployed as a seperate cluster. 

In most cases, Synchrony is managed by Confluence

If you have a Data Center license, you may choose to deploy and manage Synchrony standalone in a cluster, instead of allowing Confluence to manage Synchrony for you.  See Possible Confluence and Synchrony Configurations for more information. 

On this page:

Passing recognized system properties to Synchrony

If Synchrony is managed by Confluence (the most common setup), you make changes to Synchrony by passing system properties to Confluence. See Configuring System Properties to find out the best way to do this for your operating system. 

You can find a full list of system properties at Recognized System Properties

If you're running Synchrony standalone in a cluster, you pass properties directly to Synchrony via the start-synchrony scripts.

Note that the properties are not always the same as those used when Synchrony is managed by Confluence.  A full list of required and optional properties can be found at Set up a Synchrony cluster for Confluence Data Center

Passing JVM arguments to Synchrony

Sometimes you may want to pass additional arguments, that are not already provided by a system property, directly to Synchrony's JVM.  

If Synchrony is managed by Confluence, you will need to create a file called synchrony-args.properties in your home directory (or shared home if you have a Data Center license) and include the arguments you want to pass to Synchrony, one per line.

For example:

synchrony.jvm.arg.0=-Dproperty1=value1
synchrony.jvm.arg.1=-Dproperty2=value2
...
synchrony.jvm.arg.N=-XX:NumberOfGCLogFiles=5

For more examples, see How to Enable Garbage Collection (GC) Logging for Synchrony process.

Remember, you can't use this method for passing any value that is already handled by a Confluence system property, such as synchrony.port, Xmx or Xss.

If you're running Synchrony standalone in a cluster, you pass arguments to Synchrony's JVM directly, by adding them to your start-synchrony script, in the Optional Overrides section.

Common configuration changes

The two most common changes people make to Synchrony is to change the port that Synchrony runs on, if port 8091 is already in use, and to change the maximum heap memory allocated to Synchrony. 

Change the port Synchrony runs on

Synchrony runs on port 8091 by default. If this port is already in use by another application on your server you can use the the synchrony.port system property to change it to an available port.  

If you're running Confluence 6.0.3 or earlier you'll need to use reza.port instead of synchrony.port.

To change the maximum heap for Synchrony

Synchrony has a maximum heap size of 2 GB by default. 

If you experience out of memory errors related to Synchrony, you can change the heap size allocated to Synchrony using the synchrony.memory.max system property.

If you're running Confluence in a cluster, you may want to increase the maximum heap size to 4gb on each node. 

For an example, see How to Increase Synchrony Heap Allocation.

Change the logging level for managed Synchrony

The logging level for managed Synchrony is set to INFO by default. If you find this too verbose, you can decrease the logging level to WARN or ERROR

To change the managed Synchrony logging level: 

  1. Create a file called synchrony-log4j.properties with the following content:

    log4j.rootLogger=WARN, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] [%c{4}] %m%n

    In this example we'll set the logging level to WARN . Replace this with ERROR if you only want to log errors. 

  2. Save the file. You can place the file anywhere, but we recommend your home directory (or shared home) alongside the synchrony-args.properties file. 
  3. Edit your <home-directory>/synchrony-args.properties  file. If you're running Confluence in a cluster, this will be in your shared home directory. 
  4. Add the following line to tell Synchrony where to find your log configuration. 

    log4j.configuration=file://<path-to-file>/synchrony-log4j.properties

    Replace <path-to-file> with your file path. In Linux this will be something like =file:///var/confluence/local-home/synchrony-log4j.properties, for example.

  5. In Confluence, go to Administration  > General Configuration > Collaborative editing and select Restart Synchrony to pick up the changes.

Exclude the Confluence DEBUG prefix

Because Synchrony is managed by Confluence, the Synchrony logs include a prefix with information from Confluence itself.  You can omit this prefix to make the logs easier to read.

To omit the Confluence DEBUG prefix from the Synchrony logs:

  1. Edit the <install-directory>/confluence/WEB-INF/classes/log4j.properties  file.
  2. Change the log4j.appender.synchronylog.layout.ConversionPattern line to remove %d %p [%t] [%c{4}]  as follows:

    log4j.appender.synchronylog.layout.ConversionPattern=%m%n
  3. Save the file, then restart Confluence to pick up the changes.

If you're running Confluence in a cluster, you'll need to repeat this process on each Confluence node. 

Change the logging level for Synchrony standalone

If you choose to deploy and manage Synchrony standalone in a cluster, you can configure the logging level in your start-synchrony script. 

To change the Synchrony standalone logging level: 

  1. Create a file called synchrony-log4j.properties  with the following content:

    log4j.rootLogger=WARN, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] [%c{4}] %m%n
    log4j.category.com.hazelcast=INFO
    log4j.category.hazelcast=INFO

    In this example we want to set the logging level to WARN . Replace this with ERROR  if you only want to log errors.  We keep the Hazelcast logging level at INFO so you can still see the Synchrony nodes communicating with each other.

  2. Save the file. You can place the file anywhere, but we recommend your Synchrony directory. 
  3. Edit your <synchrony-directory>/start-synchrony.sh or start-synchrony.bat file.
  4. Add the following line in the Optional Overrides section to tell Synchrony where to find your log config:

    log4j.configuration=file://<path-to-file>/synchrony-log4j.properties
  5. Restart Synchrony to pick up the changes. 

Repeat this process on each Synchrony node. 

Troubleshooting

  • If you have a Data Center license, and Synchrony is managed by Confluence, we recommend storing the synchrony-args.properties file in the shared home directory, so that all Synchrony processes are started with the same JVM arguments. If you do locate the synchrony-args.properties file in the local home, the arguments will only be passed to the Synchrony process on that node.
  • Since 7.20, we enabled passing JVM arguments to Synchrony to help with diagnosing Synchrony-related issues. See How to Enable Garbage Collection (GC) Logging for Synchrony process.
Last modified on Oct 31, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.