Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfparker2002/e78a728691a6c69e594e to your computer and use it in GitHub Desktop.
Save dfparker2002/e78a728691a6c69e594e to your computer and use it in GitHub Desktop.

Offline Oak compaction with debug logging:

  1. Install the latest Oak hotfix to your AEM instance:
  1. Download the oak-run version matching your oak version: https://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/
  2. Upload the oak-run jar file to your server
  3. Create a file logback-compaction.xml (on the server in the same folder as the oak-run jar)
<configuration>
  <appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
    <target>System.err</target>
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>
  <logger name="org.apache.jackrabbit.oak.plugins.segment.Compactor" level="DEBUG"/>
  <root level="warn">
    <appender-ref ref=“STDERR" />
  </root>
</configuration>
  1. Run this command from the same folder as logback-compaction.xml (change the paths and jar file name to match your system’s paths, and tune -Xmx10g to not exceed your server's memory while leaving room for the OS memory):
nohup java -Dtar.memoryMapped=true -Dupdate.limit=5000000 -Dcompaction-progress-log=1500000 -Dcompress-interval=10000000 -Doffline-compaction=true -Dlogback.configurationFile=logback-compaction.xml -Xmx10g -jar /opt/wem/aem6/oak-run-1.0.22.jar compact /opt/wem/aem6/crx-quickstart/repository/segmentstore > tarcompaction.log 2>&1
  1. If you want to disable debug logging then change level="DEBUG" to level="INFO"
@andrewmkhoury
Copy link

@dfparker2002 there was a bad quote in the logger config under <appender-ref ref=“STDERR" />, it needs to be a normal quote instead of a left quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment