Cortex Container
The Cortex Server provides the API that is the core of the Commerce system. In production it must be performant and highly-available.
Prerequisites
The cortex
container image must be built and available. For information on building container images, see Building Container Images.
Suitable Environment Types
The Cortex application is a core application and is always deployed.
Include in Development and QA Environments? | Include in Authoring Environments? | Include in Live Environments? |
---|---|---|
Yes | Yes | Yes |
Configuration
The sections below describe typical configurations.
Note about production sizing and tuning
The values shared in this document are suggestions that are known to work well in typical scenarios.
important
Planning and validation is required to finalize resource and scaling settings for production. The settings should be reviewed and re-validated periodically, such as when significant Commerce application changes are deployed or when traffic and load requirements change. For more information, see the Elastic Path Commerce Sizing Guide.
Resource allocation
Resource allocation can vary by usage and load. Below are typical values.
Resource | Non Production | Production Like (See Note) |
---|---|---|
Container Memory (MB) | 4608 | 5120 |
Container Cores | 0.5 | 3 |
Java Heap (MB) | 3584 | 3584 |
Scaling and replicas
This service is horizontally-scalable. Scaling requirements vary depending on business requirements. Below are typical values.
Configuration | Non Production | Production Like (See Note) |
---|---|---|
Minumim Replicas | 1 | 2 |
Maximum Replicas | 1 | 6 |
Target CPU Utilization (%) | 50 | 50 |
Max Surge (%) | 25 | 100 |
Max Unavailable (%) | 25 | 0 |
Ingresses
The table below describes the ingress requirements for this service.
Port | Context Path | Non Production | Production | Purpose | Comment |
---|---|---|---|---|---|
8080 | /cortex | Yes | Yes | API traffic. | The container is always listening on this port. Expose this port and path to all clients that require direct access to the API server. |
8080 | /studio | Yes | No | Web-based tool to assist developers to use the Cortex API. | Expose this port and path to internal users and developer only. |
8080 | /system/console | Optional | No | Java OSGI checks | Expose this port and path to internal users and developer only. |
8180 | N/A | Yes | Yes | Health and liveness checks. | This port should only be exposed internally, ideally only to the container orchestrator. |
8888 | N/A | Optional | Optional | JMX. | The container listens on this port when the ENABLE_JMX environment variable is set to true . This port should only be exposed internally to users and tools that require access to JMX data. |
1081 | N/A | Optional | No | Java debugger. | The container listens on this port when the ENABLE_DEBUG environment variable is set to true . This port should only be exposed internally, to developers who debug Java application code. This port is typically not open in production. |
Egresses
The table below describes the egress requirements for this service.
Endpoint | Purpose | Comment |
---|---|---|
Commerce JDBC endpoint | Commerce database | This service must be able to access the Commerce database. |
Commerce JMS endpoint | Java Messaging Service | This service must be able to access the JMS service for messaging, which is typically ActiveMQ. |
Commerce Search-secondary endpoint | Intra-service communication | This service must be able to access the Self Managed Commerce search-secondary service. |
Git Service | Optional: inject config at start-up | The service can optionally be configured to inject config files from a secured Git project at startup time. If that is configured then the container must be able to connect to the Git project specified in environment variable EP_COMMERCE_CONFIG_REPO . For more information about secure configuration, see Injecting Commerce Configuration at Startup. |
Third-party services | Optional: custom third-party integrations | Your development team may have implemented integrations with third-party or corporate services or systems. If yes, ensure egress to those systems is permitted. |
Health, Liveness and Readiness
Container orchestration tools monitor the health and responsiveness of containers. For information about supported endpoints, see Health Monitoring Usage.
Volumes
Mount Point | Purpose | Comment |
---|---|---|
/hdump | Store Java heap dump files, which are created when a Java OutOfMemoryError occurs, on a filesystem that persists after the container dies. These files are large but can be very helpful to diagnose Java memory usage issues. | Each heap dump file can be multiple gigabytes in size so it is important to ensure that the filesystem is large and regularly maintained so that it does not fill up. Consider using a shared filesystem filesystem across all containers for this purpose. |
Environment Variables
The application is configured using container environment variables. Some environment variables must be set and some are optional. The environment variables are read and consumed by the container entrypoint scripts. Review Common Environment Variables for a list of required and optional environment variables that are common to all Commerce application services.
The following table shows additional environment variables specific to this service:
Variable Name | Description | Required |
---|---|---|
EP_CORTEX_X_JVM_ARGS | Can be used to set additional custom Java arguments. | No |
important
The entrypoint scripts are and will remain the source of truth on the required environment variables. Review the container entrypoint scripts in your selected release to validate the required variables.