Every Magento store should have a minimum hardware setup consisting of 4GB RAM, 4 vCPUs, and 25GB of SSD storage to ensure smooth operations. However, the exact numbers for processors, memory, and storage will vary based on the needs of each business and the deployment of its system.
Magento hardware requirements and components
There are three hardware components that every store owner must consider when choosing their hosting setup:
CPUs are responsible for processing the requests made by the website. A well-configured caching system will transfer most of the processing load onto the memory, so the CPUs handle only the uncached requests. However, you must ensure that your system has enough processing power to manage all uncached requests.
Insufficient processing power will lead to sluggish website performance and 5XX errors, whereas providing excessive processing power will lead to over expenditure and idle CPUs. Generally, a single CPU core can serve between two to four Magento requests efficiently.
You can use the following equation to determine the number of web nodes or CPU cores your store would require for processing incoming requests effectively:
Cores = (Requests / 2) + Crons
This will help you get a baseline number of cores for your store that can be altered manually during high-traffic periods to ensure the website can manage its traffic without slowing down.
Magento’s memory requirements vary significantly between stores and must be calculated based on how each system is deployed. Adobe recommends allocating a minimum of 2GB of RAM for a single server Magento store.
For stores with less than 2GB of RAM, they recommend creating a swap file to avoid running out of memory when updating or installing the Magento application or its associated components such as themes, extensions, or language packs.
Below is a breakdown of different scenarios and potential memory requirements for each:
These values only account for the PHP memory required by the Magento application and do not consider other aspects such as the database and caching. When calculating the amount of memory for your site’s database, you should consider the amount of data stored in the database as well.
To ensure your store can effectively leverage the MySQL database indexation, you must ensure the amount of memory that’s available is at least half the size of the data in your website’s database. This will avoid indexation failures and bottlenecks at the database level when serving live traffic.
Additionally, you must also consider the amount of cache your website will store and the applications that will be configured for caching. To ensure optimal performance on your Magento 2 store, you must use both Redis and Varnish caching.
Follow these guidelines when calculating the memory required for your caching systems:
- Calculate and allocate enough memory to Varnish for full-page caching so that it can hold the most popular pages on your store in memory.
- Calculate the average duration of storage of a session in the cache, consider your website’s cart abandonment recovery strategies, if any, and use Redis for the session cache.
- All other caches must be allocated to Redis for optimal performance. Block cache is the primary factor in determining this value. You can multiply the number of SKUs on your store by the number of store views to determine this value.
The amount of storage usually depends on the amount of data your server would need to host. This can be calculated based on your site’s data, your backup strategy, and the number of applications on your system.
The most crucial consideration for storage is ensuring that you use high-availability NVMe SSDs to ensure your website storage doesn’t bottleneck its performance. A good starting point for a new store with a few hundred products is having 25GB of storage space.
If you’re hosting a large amount of media such as product images and videos, and have all your applications and database on the same server, consider each aspect individually when calculating the ideal storage space for your website.
Once you’ve gathered the processing, memory, and storage requirements for your website, you can consider other aspects like the network bandwidth and integrate a content delivery network such as Cloudflare into your stack.
Building the right foundation for your store will allow you to leverage Magento effectively for all its worth and give your business the best chance for success.