Since search engines benefit heavily from caching, their JVM memory profiles are substantially different from those of a JVM focused on serving content and web views (e.g., a JVM running Liferay DXP). In production environments, search engines and Liferay DXP should always be on separate JVMs.
The following sections provide a synopsis of Elasticsearch configurations. Prior to deployment, we strongly recommend reading Elastic’s documentation on production deployment.
You’ll learn how to configure these settings:
- JVM
- File System
- Scale
JVM
The JVM vendor and version must be the same for the Elasticsearch server and the
Liferay DXP server. In general, you should allocate 45 percent of the available
system memory to Elasticsearch, up to a maximum of 31 GB. Configure heap sizing
by setting the ES_HEAP_SIZE
environment variable.
File System
Configure your operating system for at least 64,000 file descriptors (the default Linux value is 1024). Since Elasticsearch uses NioFS and MMapFS, ensure there is sufficient virtual memory available for memory-mapped files. Consult your system administrator for information on how to configure these values.
Tuning and Scaling an Elasticsearch Cluster
Proper scaling and tuning of an Elasticsearch cluster primarily depends on the type of indexes it holds and how they’re intended to be used. Since Liferay DXP is a flexible development platform, no two applications index and search for data in exactly the same way. Read the definitive Elasticsearch guide, and understand the differences between indexing-intensive applications and search-intensive applications. Then you’ll be able to predict usage patterns for your Liferay DXP indexes and design the optimally scaled and tuned cluster.
Once you determine the appropriate number of shards and replicas, configure them in the Liferay Connector to Elasticsearch module, using these settings:
indexNumberOfReplicas
corresponds to Elasticsearch’snumber_of_replicas
property.indexNumberOfShards
corresponds to Elasticsearch’snumber_of_shards
property.
Tune, scale, and prosper.