Opentext™ Brava!™ Enterprise Champions Guide For Tuning Performance
Opentext™ Brava!™ Enterprise Champions Guide For Tuning Performance
Opentext™ Brava!™ Enterprise Champions Guide For Tuning Performance
Contents
Brava! Enterprise Architecture .................................................................................. 3
Brava! Server (BESS)............................................................................................. 3
Display List Cache (DLC) ....................................................................................... 4
Persisted and temporary entries in Display List Cache ................................... 4
Display List Cache Size ................................................................................... 5
Display List Cache eviction (truncation) strategy. ............................................ 6
Threads .................................................................................................................. 6
Synchronous vs Asynchronous request processing ........................................ 7
Blocking I/O vs asynchronous I/O .................................................................... 7
Blocking HTTP request vs server-side processing .......................................... 7
File monitoring, single page publishing and publishing evasion ............................ 8
Single page publishing ..................................................................................... 8
File monitoring ................................................................................................. 9
Publishing evasion ........................................................................................... 9
Brava! License ...................................................................................................... 10
Job Processor/Publishing Agent (JP/PA) ............................................................. 10
JP threads vs processes ................................................................................ 11
Communication between JP/PA and Brava! Server....................................... 11
CDL characteristics ........................................................................................ 12
XDL format............................................................................................... 12
Print Publishing (Bi2dl)................................................................................... 13
Alternatives for Office documents ........................................................... 14
Search artifacts .............................................................................................. 14
Publishing noise ............................................................................................. 14
Monitoring Tool ......................................................................................................... 16
Live JP/PA jobs tracking ....................................................................................... 16
Queue statistics .................................................................................................... 17
Display List Cache ................................................................................................ 17
Recommendations .................................................................................................... 18
Adjust the default configuration ............................................................................ 18
Monitor and adjust ................................................................................................ 18
Display List Cache size ........................................................................................ 18
Configure your servlet container for best performance ........................................ 19
Keep system I/O clean ......................................................................................... 19
Keep Brava! Server and JP/PA close to each other: ............................................ 20
Use sharding and scale out .................................................................................. 20
Routing Service .............................................................................................. 20
Avoid single page publishing ................................................................................ 21
HTML viewer page precaching ...................................................................... 21
Disable generating heartbeat files ........................................................................ 22
Precaching ............................................................................................................ 22
Document upload vs HTML viewer composition ............................................ 22
by doing that, the entry will be persisted. It will not be removed until it is either removed
through an admin action, invalidated through manual folder removal from DLC (not a
supported operation), or deleted through cache truncation. Document entries are
persisted immediately after creation while document sources are never persisted.
Sources will be removed eventually (with one caveat which we will discuss later), and
renditions/jobs after finishing successfully are persisted and will not be automatically
deleted.
The timeout is set to be 3 times the publishing timeout configured in server.properties:
publish.request.timeout=7
Typically, an entry is created when a job/rendition is created, and the timeout is
measured from the creation time. Creating a job does not mean that the task will be
assigned to a JP/PA immediately. It first goes to one of the queues and is then pulled
by a JP/PA instance, and results are published. The timeout spans the whole operation,
which means that it is possible that the timeout’s expiration can be triggered when the
job is still in the queue or when it has already been sent to a JP/PA but has not yet
finished.
Entry types stored in DLC:
• document sources - a temporary entry that holds 1 or more (xrefs or external
references) source documents that usually are uploaded to the system by the
integration.
• documents - metadata entry that keeps the status of the document (if it has
been processed to XDL form already or not) and holds data such as: document
source, XDL representation, and all the related renditions based on this source.
• renditions (publishing jobs) - this entry holds artifacts published by Job
Processor.
Because of these specifics, it is important to understand that usually Display List Cache
is taking more space on the disk than the reported total size seen in the Monitoring
Tool.
The maximum Display List Cache that can be set up in the application settings is
enforced based on the total size of the Display List Cache, measured as explained
above.
Once the size of the cache exceeds a certain threshold set up in the configuration,
truncation mechanisms are executed.
The total size of Display List Cache can be monitored using the Monitoring Tool.
displaylist.cache.maximum.size=10000
displaylist.cache.size.reduction.percent=90
displaylist.cache.max.files.to.delete=20
When an entry is deleted from the in-memory map of entries, it is removed from the
map immediately and moved to a queue of entries that should be cleaned up. The
queue becomes the only element in the system that still knows where the entry has its
files system data. The queue is not persisted and will not survive a restart. The removal
from the map means that the entry is no longer accessible, even if it is still in the
deletion queue.
There is only one thread responsible for cleaning up entries from the deletion queue.
The thread runs in burst mode, deletes some amount of entries from the disk
(displaylist.cache.max.files.to.delete), then goes idle. That ensures that even if the
whole cache is invalidated or removed, a delete operation will not take over the whole
I/O bandwidth of the system. Because of that fact, folder deletion through truncation
should not have a dramatic impact on I/O performance of the system. It is important to
understand that when the system hits the truncation threshold, additional I/O
operations will be happening in the background that will compete with the main
upload/publishing/reading role of Brava! Server and JP/PA in tandem.
Threads
Predominantly, Brava! Server works as event-based system with most endpoints being
processed asynchronously. We recommend at least 200 threads to be assigned to the
Connector that is handling content distribution to the viewers.
<Connector
...
maxThreads="200"
...
/>
identical requests, regardless of the job status on the server side. Brava! Server
decides if the request must wait for some jobs to be finished, some artifacts to be
present on the filesystem, or if a single page publish job should be created.
When asynchronous request processing was not implemented, it meant that such a
request was blocking a single thread on the servlet container (or connector's
threadpool) and idly waiting for publishing to finish. Currently, when a job is not finished,
the threads are not blocked. Instead, the Brava! Server application wait for the proper
event to happen and then the Brava! Server application we inform the servlet container
that the response is ready. Servlet 3.0 API (and its proper implementation by the servlet
container along with spring framework) is responsible for orchestrating different
threads to provide the content in a less blocking way. This allows the Brava! Server to
support more concurrent blocking HTTP requests to the server than threads assigned
to process. Because of this, the asynchronous timeout on the servlet container must
be increased. By default, in Tomcat, that setting is set to just 30 seconds, and that is
not enough time even for the default JP/PA processing timeouts (7 minutes by default).
We recommend increasing the asynchronous timeout to be at least equal to the JP/PA
processing timeout.
<Connector
...
asyncTimeout="420000"
...
/>
The increase of the async timeout can, in theory, have negative effects on the servlet
container because the server must track more request at the same time and is not
capable of timing them out earlier, although the number of threads needed should not
be affected by this setting. Therefore, the increased timeout could potentially increase
the risk of DoS (Denial of Service) but should not have a significant impact on the
overall maximum throughput or general performance of the system for expected load.
From throughput perspective, single page publish jobs should be avoided. Their results
are redundant and not persisted (eventually they will be removed from the Display List
Cache).
File monitoring
Beginning with Brava! Enterprise v.16.5, the server began actively tracking artifacts
created by PA/JP. This allows the server to generate events that a particular artifact is
ready. Additionally, it started checking to see if the requested artifact is already
available - even for jobs that have started but have not finished yet. This way, single
page publishes are avoided for any artifacts that have already been processed.
While this approach was originally optional, it is now the only way to monitor and serve
artifacts to Brava! HTML Viewer.
This feature automatically, without making any changes to Brava! Server configuration
or external API, saves a lot of single page publishes from being created.
This process works based on JVM provided folder monitoring of rendition folders.
JP/PA is not responsible for that monitoring, and the whole process is conducted only
by the server.
With this method, the following new information became available to the system:
• That a job has already started (previously, Brava! Server only knew if it has
been queued, but not if JP has already pulled the job).
• Which artifact is currently being processed and which page of the whole
document will be next to be produced.
Using this data, the server can implement the next step to avoid producing
unnecessary redundant work in the form of single page publishes.
File monitoring is not used by the ActiveX Viewer because this viewer currently decides
if it wants to see a single page publish job or if it can download artifacts from the
finished complete XDL job.
Publishing evasion
Let us consider the following scenario. The client requests the first SVG pages from a
document that has just been uploaded to the server. The SVG job has already been
created and sent to JP/PA. In this case, the page 0 SVG artifact has not been created
yet. It is currently being published by JP.
In this situation, creating a new single page publish job to create that particular SVG
makes no sense. The main job is likely going to finish creating the SVG before the
single page publish job gets to JP/PA. Because of job tracking, the Brava! Server know
that that JP is actively working on the page 0 SVG. The Brava! Server can reasonably
decide not to create the single page publish and let the main job finish working on it.
This way, the single page job is not created, is not taking up JP/PA processing power,
and does not put more pressure on the I/O.
We can expand on that mechanism and assume that creating page 1 (the second
page) through single page publish has no value and decide to skip it as well.
We call this mechanism single page publishing evasion.
In the system properties, you can set in advance the number of pages to avoid for
single page publish. You can do this for both SVGs and thumbnails. For thumbnails,
we recommend a much higher value (>20).
Increasing the number of pages skipped should decrease the amount of single page
publish jobs created but doing so could increase the perception of viewer being less
responsive. If the system produces a lot of single page publish jobs and the server
statistics reports that most of the time is spent on creating these jobs, our advice is to
increase the evasion threshold to let main jobs do more work.
#single.page.publishing=off
#single.page.publishing.evasion=1
#single.page.publishing.thumbnails=off
#single.page.publishing.thumbnails.evasion=20
Brava! License
Brava! License provides licensing for Brava! Server only. It is not accessed by JP/PA
or by end-users directly. It provides general licensing for the application. That license
is cached and does not require constant acknowledgements. The second role is client
“slot” tracking, which typically happens one time per document view. Each slot is not
managed individually and the total number of claimed slots is kept and is reset
periodically (refresh window). This approach makes the implementation of the License
Server quite trivial.
Brava! License is typically not CPU intensive, nor does it consume a lot of memory.
Since Brava! License is still using synchronous HTTP request processing; it is
important to understand that there is a potential "deadlock" when the same thread pool
is shared between Brava! License and Brava! Server. To avoid this, our
recommendation is to use a different servlet container for Brava! License or use a
separate Connector other than the Connector used by end-user endpoints.
JP threads vs processes
What is called a thread in JP/PA needs an explanation. A JP/PA thread is responsible
for managing a single worker CDL process (converter). These processes are single-
threaded and cannot use any multithreading capabilities of the system's CPU. A JP
thread works roughly in the following loop:
• request a job from Brava! Server
• if no task is returned, return to job requesting
• initial work related to starting the job (create heartbeat file, I/O checks etc.)
• pass job to converter CDL process
• monitor CDL process
• finish job and send notification back to Brava! Server that the job has finished
• cleanup
• return to job requesting
For example, a configuration with 10 pdf JP "threads" means that there are 10 threads
in JP application that are monitoring at most 10 converter CDL processes. Each of
these processes are autonomic. They do not share any data between each other. While
they work on separate target folders, they can work on the same source document.
They cannot be stopped (even when they time out on the Brava! Server side).
thread.single=2
thread.drw=2
thread.pdf=2
thread.doc=2
thread.3d=1
job.error.sleep.0=1500
Changing this property to a value near 0 can have negative consequences and adds
virtually no potential gains.
CDL characteristics
As of 16.6.6, the CDL version that is used is a single-threaded process that relies
heavily on global structures that are not thread safe. The same single thread is
responsible for all the tasks needed to process content: loading loaders into memory,
reading the source file, exporting data to the requested format, and saving the data to
the disk. All these tasks happen sequentially, meaning that CPU-heavy tasks are
intermittent with I/O and therefore a single process of CDL is usually not capable of
maximizing usage of a single CPU core/thread. It also means that the more I/O
bottlenecked your server is operating, the less CPU utilization you will get.
To some extent, you can tell that the CDL process is constantly switching between a
high CPU period (artifact publishing) and a high I/O period (artifact saving to the disk).
The most important conclusion is that if an I/O blocks a CDL process, CPU power
cannot be fully utilized. Additionally, scaling CPU processes and using more of them
concurrently is possible as long as I/O can scale as well.
XDL format
XDL is the internal format of CDL. Through Brava! Enterprise architecture, every
document uploaded to Brava! Server is eventually replaced by its XDL representation.
After the XDL representation of the document is ready, it becomes the source for any
other publishes based on that document. The original uploaded source file is not used
anymore, nor are the loader files.
XDL characteristics:
• file based
• multiple files
• page based
• single-threaded
From a performance perspective, generating XDL files is relatively fast; currently faster
than generating SVG files.
Brava! HTML Viewer (BHV) cannot read XDL resources directly. The only resources
that are needed by BHV are search artifacts. All other XDL artifacts are not used.
Typically, when a document is initially uploaded to Brava! Server before the HTML
viewer composition is created, the complete XDL job is not ready before the SVG and
the thumbnail jobs are created and queued. In that case these jobs will be based on
the original source file and not the XDL (and loaders will be used to process the original
document).
When the XDL job is ready, it becomes the representation of the document within the
system. All additional publishing based on the document (such as printing, publish to
PDF or TIFF) will be based on the XDL instead of the original source file.
extensions.wait.for.XDL.publish=doc,dochtml,docx,htm,html,
mhtml,mht,...
This setting specifies that the listed formats cannot be processed by SVG, thumbnails,
or single page publish jobs directly. The system should first wait for the complete XDL
job to finish, otherwise, responsiveness can be negatively impacted while viewing
these documents.
Search artifacts
There are 3 search artifacts. The first, Text.idx, is used with ActiveX viewer and can
only by used when you have access to other data from XDL. The other 2 artifacts are
used solely by HTML viewer: textinfo.txtinf and searchtextinfo.txtinf. Both are
uncompressed and can therefore become quite large. These are the last artifacts
created within the complete XDL job.
Publishing noise
Brava! Server has been implemented to publish more artifacts to support the viewing
the file requested by client. When HTML viewer is in use, most of the artifacts produced
by the complete XDL job will not be used as long as the complete XDL job is not being
used as the source for other jobs.
Additionally, if the document contains many pages, a large portion of the published
pages might never be read. If the thumbnail panel is closed, the thumbnails that will be
generated might not be accessible as well.
While this approach ensures that artifacts are ready to be sent when needed by an
end-user navigating the content of a file, it also enables JP/PA to process items that
will never be needed. Currently there is no way to decrease this publishing noise.
One option that can help reduce noise is using raster rendering mode in HTML viewer.
In that mode, instead of serving SVG artifacts, raster images (usually jpgs) are
generated. In raster mode, every requested page is provided as a single page publish
and there is not one job that creates all the pages rasterized. The system is not going
to create artifacts for pages that have not been requested.
Monitoring Tool
In Brava! Enterprise 16.6.5 we introduced the Monitoring Tool - a new, simple, web-
based UI tool to monitor Brava! Server instance status.
The tool allows you to observe and adjust the whole Brava! Enterprise set up or check
that the environment is not overwhelmed by the number of jobs sent to it.
Figure 1
Live Publishing Chart
In lower sections’ rows, the longer gaps that exist between the rectangles blocks
representing a single job while the queued work size is not 0, may suggest that longer
time was unused by a JP/PA thread between finishing one job and starting another.
In the example above, we can see that there are gaps between single page publish
jobs. The gaps are caused by the fact that the queued work size is basically at 0 size
for quite some time.
Queue statistics
The tool provides several basic statistics on the queue types. The stats are not
persisted and reset with every server reset.
Figure 2
Queue Statistics
The total time value can give a highly indicator which queue is receiving the most tasks.
Recommendations
displaylist.cache.maximum.size=10000
displaylist.cache.size.reduction.percent=90
In this example, we have a max size of 10GB with 1GB of margin that is going to trigger
truncation if cache size exceeds 9GB (10GB x 90%). In this case, any job that is around
1GB in size can cause significant problems, so increasing the size to 100GB, for
example, should help.
find a unique 8-character name for it. The impact is minimal, but one more thing that
the OS and filesystem must worry about.
displaylist.cache.root=d:\\
local.displaylist.cache.root=d:\\
Routing Service
Routing Service is a separate independent element in the Brava! Enterprise ecosystem
that provides viewing session persistence for a cluster of Brava! Server instances.
Currently it cannot provide load balancing on its own - that part must be provided by
an additional software or hardware solution. It can, however, track which node the
traffic was routed to and then it can keep that information and use it for subsequent
requests.
single.page.publishing=on
single.page.publishing.evasion=4
single.page.publishing.thumbnails=off
single.page.publishing.thumbnails.evasion=40
By default, single page publishing for thumbnails is enabled. If that is causing far too
many single page publishes on the server side, we recommend disabling that feature
or at least increasing the evasion number to a higher value.
Check the statistics provided by the Monitoring Tool to see how many single page
publishes are being created.
publish.heartbeat=false
Precaching
Precaching is a process of uploading or even creating HTML viewer compositions prior
to the on-demand view triggered by an end-user.
Currently, Brava! Server does not support precaching directly. We do not maintain or
update the LRU (least recently used) list to know which item is the one least needed.
We do not support any external blob storages, so it is quite common to work constantly
in truncation mode when newly uploaded documents and triggered publishing jobs
triggers the eviction of older items.
Precaching can make the system seem more responsive, but that is true only if the
integration can correctly predict which documents will be viewed in the future.
Publishing of the pre-cached documents (which are not currently needed by end-users)
does not affect the current on-demand views of documents.
Still, a simple upload of a document and creation of an HTML composition from it
should effectively prepare all the needed artifacts beforehand.
already has a XDL representation ready, then the source of the document will be the
complete XDL job.
That difference is completely hidden from integrators and end-users. There is a slight
performance hit to processing jobs directly from source documents because in that
case, a loader library is involved. The XDL format, on the other hand, is an internal
format that is recognized by the core CDL library.
In practice, the best option is to upload a document first, wait for complete XDL to
finish, then create the HML viewer composition. This strategy would be based on
current internal implementation details for publishing documents, which is something
that could change at any time in the future.
Be aware of one additional aspect of potential precaching and a general note about
JP/CDL performance versus Brava! Enterprise architecture. From the throughput
perspective, it is better to generate all the artifacts (XDL, SVG, thumbnails) as a single
job than to create multiple jobs to generate them separately. Doing them separately
might make some sense when we can ensure that all the tasks are running
simultaneously, but usually the time spent reading the content using a loader library is
wasted in such a scenario. Brava! Server currently cannot merge these separate jobs
into a single task.
About OpenText
OpenText enables the digital world, creating a better way for organizations to work with
information, on premises or in the cloud. For more information about OpenText (NASDAQ:
OTEX, TSX: OTC) visit opentext.com.
Connect with us:
Copyright © 2022 Open Text. All rights reserved. Trademarks owned by Open Text.