Ruby store performance tuning
Optimizing performance tuning in the Ruby store is important for delivering the best browsing experience. If you have a slow-running storefront, you can optimize it to improve performance. Use the following points to check and optimize your store performance.
Grafana dashboard
For the HCL Commerce version 9.1.15, the Grafana dashboard supports the Ruby store and helps troubleshoot performance problems with Next.js servers. The dashboard is designed to monitor different server metrics. For more information, see https://github.com/HCL-TECH-SOFTWARE/hcl-commerce-performance/tree/main/Grafana/dashboards/chart/dashboards/prometheus-operator.
Worker threads
For the HCL Commerce version 9.1.14, cluster API in the Ruby store implementation helps multiple worker threads to improve performance. This is achieved using the NODE_INSTANCE_NUMBER variable. The NODE_INSTANCE_NUMBER environment variable sets the number of Node.js instances for deployment in the Next.js store container. The NODE_INSTANCE_NUMBER is read from the environment variable during deployment. If not specified, it derives from the CPU units in the helm chart for the Next.js container.
CPU Throttling
If resources are not configured correctly, CPU throttling may increase response time. Check the Grafana dashboard for CPU throttling in HCL Commerce version 9.1.15 onwards. If CPU throttling is detected in Grafana dashboard, recommend horizontal pod autoscaling or adjust the cluster's node resources.
Memory
To see the steps for memory settings and handling Out of Memory (OOM) situations, visit the Node.js article at https://nodejs.org/en/docs/guides/diagnostics/memory/using-gc-traces.