Many e-commerce store owners believe reducing Magento hosting cost reduction requires server upgrades, but scaling up often inflates monthly bills without addressing core performance issues.
In this case study, Growsera’s Magento support team improved a client’s Magento store performance through Magento Elasticsearch tuning and MySQL/MariaDB optimization, cutting server resource usage and achieving Magento hosting cost reduction of over 52%.
Table of Contents
Challenges We Faced
1. Frequent Elasticsearch Crashes
Elasticsearch crashed every few hours, even with low traffic, disrupting search, hiding products, and impacting Magento admin panel operations.
2. Resource Overload
The store consumed 3.9GB of 4GB RAM, with ~85% CPU usage, causing unstable hosting and frequent 524 and 500 internal server errors.
3. Misconfigured Services
The previous technical team installed Elasticsearch, Redis, and MariaDB without proper configurations for Magento 2, leading to performance bottlenecks.
4. Costly, Ineffective Proposal
The prior team suggested upgrading to a t3.large or t3.xlarge server, doubling monthly costs without addressing root issues.
Root Solution for Magento Hosting Cost Reduction
- Optimized Elasticsearch with 50% Heap Rule + Module Cleanup
- Reduced
Xms/Xmx
to 1.8GB (from 4GB), aligning with Elasticsearch’s 50% Heap recommendation. - Removed unnecessary Magento modules (e.g., ingest-geoip, ingest-user-agent) using
elasticsearch-plugin remove <plugin>
, cutting JVM footprint by ~250MB and reducing compilation time. - Set
indices.query.bool.max_clause_count
to limit costly queries and closed unused indexes, enhancing Magento Elasticsearch.
- Reduced
- Proper MySQL/MariaDB Configuration
- Set
innodb_buffer_pool_size
to 2.2GB ≈ (55% of RAM), per Percona Community Forum guidelines for 50-70% of available memory. - Disabled
query_cache
to reduce memory usage and enabledslow_query_log
with a 2-second threshold to optimize SQL queries, per MySQL documentation. - Optimized queries in modules like Webkul_Marketplace for better performance optimization.
- Set
- Additional Improvements
- Disabled Transparent Huge Pages and set
vm.swappiness
to 10 to minimize swapping. - Integrated New Relic for real-time alerts when server resources exceed 70%, supporting Magento maintenance.
- Disabled Transparent Huge Pages and set
- Flexible Action Plan (Quick Fix + Flex Hours)
- Fixed urgent crashes and tuned JVM within 24 hours via Quick Fix tickets.
- Used 8 Flex Hours to review indexes and optimize the database, ensuring Magento hosting cost reduction.
These solutions achieved Magento hosting cost reduction of 52% on the client’s monthly bill.
Results by the Numbers
Metric | Before Tuning | After Tuning |
---|---|---|
Server Size | t3.large | t3.medium |
Average CPU (Peak) | 85% | 41% |
RAM Usage | 3.9GB | 1.8GB |
AWS Hourly Cost | $0.0832 | $0.0416 |
Weekly Elasticsearch Crashes | 14 | 0 |
Final Outcome: Over 52% Magento hosting cost reduction, improved store stability, and faster performance.
Business Benefits for You
- Immediate Savings: Halving resource usage cuts server costs, avoiding unnecessary upgrades with performance optimization.
- Higher Stability, More Sales: Zero downtime ensures no lost customers, supported by Magento maintenance.
- Seasonal Scalability: With Infrastructure as Code, resources can scale temporarily for peak seasons, reverting automatically to save costs.
Actionable Steps for Your Store
- Set Heap to ≤50% of RAM and ensure
Xms = Xmx
. - Remove unused Elasticsearch modules before considering server upgrades.
- Configure
innodb_buffer_pool_size
to 50-60% of RAM, reserving the rest for File System Cache. - Monitor Slow Queries regularly, especially after adding new Magento modules, for ongoing maintenance.
FAQs
How can I achieve Magento hosting cost reduction without server upgrades?
Optimize services like Elasticsearch and MySQL/MariaDB, tuning memory and CPU to match available resources, avoiding extra costs.
What are the best Elasticsearch settings for Magento stores?
Set Heap to ≤50% of RAM, remove unnecessary modules, and limit costly queries with Elasticsearch tuning.
Does MySQL/MariaDB tuning impact Magento store speed?
Yes, optimizing innodb_buffer_pool_size
and enabling slow_query_log
reduces resource usage and speeds up requests, enhancing Magento performance optimization.
How does server tuning differ from upgrading?
Upgrading increases costs without fixing root issues, while tuning saves money and resolves performance problems.
How do I know if my store uses excessive resources?
Look for slow page loads, Elasticsearch crashes, or consistent RAM/CPU usage above 80%.
Ready for a stable, cost-efficient Magento store? Try Growsera’s exceptional Magento support services. [Explore Our Support Plans]