Magento AWS – The Definitive Hosting Guide

Today there are approx. 12,000 Magento stores that are hosted by Amazon’s cloud-based solution and this number is increasing as Magento AWS hosting is getting more popular. Let’s see what exactly this is and what benefits it can bring to your online business.

Cloud Computing and AWS

Cloud computing is a network-based shared computing model, where resources, like servers, storage applications and services, are not tied to dedicated hardware but are available in a managed, shared computer infrastructure typically in an on-demand fashion. Thanks to this

the user doesn’t need to know about the details of service management and configuration,

there’s no need for expertise in low-level infrastructure management,

the focus is on the effective use of technology and accessing resources fast and easy.

A cloud resource can be accessed through the Internet through a local area network, but the main difference lies in who owns the resources. Practically, we can call an infrastructure a private cloud where every single element is managed privately and is connected to the public network through an access point (firewall).

To put it very simply: A common type of cloud based-service is when it is used in a corporate environment, but the infrastructure that provides this service is operated outside the company and the servers are not run locally.

In many cases you don’t even know where the elements of this infrastructure are located. However, the details of availibility and safety features, as well as, of course, the costs of the services are well defined.

Cloud computing has been a major factor in the IT world since the mid-2000’s.

The origins and first implementations of cloud computing are well summarized by IBM here. It was first an idea of J. C. R. Licklider in the 1960’s, who visualized an “intergalactic computer network” interconnecting everyone on the globe who can access its resources “remotely” (Licklider was an American computer scientist and psychologist, responsible for the development of ARPANET, the direct predecessor of the Internet).

Amazon has been providing cloud services since 2006.

Amazon’s services can be divided into three main categories:

SaaS (Software as a Service)

The software itself is provided as a service. Some applications can be used via a secure http/https protocol through a web browser. On the other hand, some computation-intensive applications need a special client on the user’s end (e.g. online games requiring live connection or the Spotify desktop application).

PaaS (Platform as a Service)

It provides the environment that is needed for running, managing and running the required applications with proper load distribution, process management, user interface and security updates.

To be able to serve your Magento store seamlessly and reliably we suggest you run it in the most appropriate hardware environment.

What we use: We at AionHill primarily use AWS for hosting Magento ecommerce stores. Some of these are hosted in a hybrid environment, some use exclusively Magento AWS hosting and some are served in a private cloud, either ours or the client’s.

AWS is utilized by a huge range of big corporations, such as

Netflix,

Dropbox,

HTC,

Hitachi,

NASA,

SoundCloud,

Spotify

and Samsung.

It’s also important to note that AWS, just as its three main competitors, has a robust global infrastructure with redundant data centres, so downtime is basically never experienced.

At the moment AWS has 42 Availability Zones in 16 geographical regions worldwide. There are 7 data centres in Europe alone, located in Frankfurt, London and Ireland. Amazon is expanding its services globally, new data centres will be launched soon in China and Paris as well.

Please note: The figures for the “Number of eCommerce Sites by Platform”, provided by BuiltWith, might not be the actual, precise numbers. In our opinion these should be higher. However, these stats can give a rather precise picture about the proportions between the platforms.

Who do we recommend cloud services to?

Cloud services have their own advantages both for small or medium sized and big enterprises, that make it very appealing for these segments.

Many say that this technology is the future of IT, but there’s a good number of sceptics, too, that raise issues mainly about security.

Cloud-based solutions: pros and cons

Not for every kind of business

Cloud-based computing services can be beneficial to any type of small or large companies, but a smart decision is needed on what kinds of services and which parts of the IT infrastructure should be actually moved to the cloud. It is mainly recommended to migrate applications that are inherently connected to external services or solutions.

Security concerns (?)

It is rather difficult to find an appropriate cloud-based environment that complies fully with the American PCI security standards (regulating credit card data management). However, Amazon offers such VPCs that meet the PCI-DSS requirements. Of course, it has its price.

Losing control over data stored in the cloud

To solve this problem, you can look for an experienced company which guarantees that your data will be stored safely and will meet all rules defined by you, no matter if your company is a law firm or a financial services provider. Also, by making local, daily 3rd party or local backups of your cloud data, can be a simple, but effective solution.

Price

If you use cloud-based services, many times there’s no need to buy additional dedicated hardware, which helps you save money. The allocated resources can also be scaled up and down rapidly, which is another great advantage.

The main pro is that you don’t have to invest heavily right at the beginning.

Neither should you calculate with a TCO budget for these types of technological assets because you don’t own them. Costs and fees related to the cloud computing services are due usually on a monthly basis. If you make a commitment for a longer term, it can bring you a considerable price discount as well.

Performance scalability, in both directions is another advantage. Due to this, services can be tested and adjusted in different traffic scenarios easily at relatively low costs.

There are fewer and fewer companies that we don’t recommend AWS cloud hosting to.

A couple of years back, enterprises that processed big chunks of data and used considerably large bandwidths could use cloud services with difficulty or could not use it at all. Today it’s not a problem. Transferring terrabytes of data we should use the AWS SnowBall service. In case of dedicated, broadband connection, AWS DirectConnect is the best choice.

Are there any special requirements for hosting a Magento store in the AWS cloud?

Amazon Web Services offers very flexible solutions that are easy to tailor and scale depending on traffic and use-case.

Thanks to the AWS TCO calculators, you can see all the costs to be paid, and you can be sure there are no hidden cost elements.

Everything is predictable, practically, in the case of HDDs, writing or reading costs of hard disk usage can be precisely defined. It may sound odd at first, but thanks to this you truly pay for those services that you actually use.

Installing Magento in the AWS cloud

If you don’t have a few years’ experience in sysadmin or devops, it’s wise to let an expert team do this job. On top of cost efficiency, this way you are also guaranteed business continuity.

So the point is: AWS makes it possible to create a flexible, excellently scalable infrastructure for your Magento ecommerce store.

Pricing, of course, depends on the computing capacity of the given resource and on the storage size to be used.

The table below shows the key parameters and costs for some cloud resources (AWS calls its host computers “Instances”):

Instance Type

vCPU

Memory (GiB)

Storage (GB)

Networking Performance

Physical Processor

Clock Speed (GHz)

t2.medium

2

4

EBS Only

Low to Moderate

Intel Xeon family

Up to 3.3

t2.large

2

8

EBS Only

Low to Moderate

Intel Xeon family

Up to 3.0

t2.xlarge

4

16

EBS Only

Moderate

Intel Xeon family

Up to 3.0

t2.2xlarge

8

32

EBS Only

Moderate

Intel Xeon family

Up to 3.0

m4.large

2

8

EBS Only

Moderate

Intel Xeon E5-2676 v3

2.4

m4.xlarge

4

16

EBS Only

High

Intel Xeon E5-2676 v3

2.4

m4.2xlarge

8

32

EBS Only

High

Intel Xeon E5-2676 v3

2.4

m4.4xlarge

16

64

EBS Only

High

Intel Xeon E5-2676 v3

2.4

m4.10xlarge

40

160

EBS Only

10 Gigabit

Intel Xeon E5-2676 v3

2.4

m4.16xlarge

64

256

EBS Only

20 Gigabit

Intel Xeon E5-2686 v4

2.3

m3.medium

1

3.75

1 x 4 SSD

Moderate

Intel Xeon E5-2670 v2

2.5

m3.large

2

7.5

1 x 32 SSD

Moderate

Intel Xeon E5-2670 v2

2.5

m3.xlarge

4

15

2 x 40 SSD

High

Intel Xeon E5-2670 v2

2.5

m3.2xlarge

8

30

2 x 80 SSD

High

Intel Xeon E5-2670 v2

2.5

c4.large

2

3.75

EBS Only

Moderate

Intel Xeon E5-2666 v3

2.9

c4.xlarge

4

7.5

EBS Only

High

Intel Xeon E5-2666 v3

2.9

c4.2xlarge

8

15

EBS Only

High

Intel Xeon E5-2666 v3

2.9

c4.4xlarge

16

30

EBS Only

High

Intel Xeon E5-2666 v3

2.9

Explanation: Instances marked with a “t” are used for testing, the “m” (memory-intensive) types can be used for processing larger databases or installing single servers. The large capacity “c” (CPU-intensive) Instances are recommended for hosting Magento stores.

Specifications of EC2 servers and the entire list can be seen on AWS’s website.

AWS Services

In the following, we give you a list, with short descriptions, containing the services that are necessary for hosting a test Magento store:

Amazon EC2– Amazon Elastic Compute Cloud allows you to start and control computing resources of virtual machines, and to choose from a wide spectrum of operating systems already installed. You can select either an already existing AMI (Amazon Machine Image), or an image file imported from a different location.

Amazon VPC– with Amazon Virtual Private Cloud you can define an isolated private network in the cloud, where you can launch different services and resources. You are totally free to configure your network just as you desire, including the creation of your own IP range and sub-network as well as configuring your routing tables and network gateways.

AWS CloudFormation– AWS CloudFormation is a simple way to create and supervise the related AWS services, and also to update them according to your schedule. This is a cloud automation tool for creating predefined infrastructures and services described in a template file. Thanks to this you don’t need to configure the selected resources manually. Although it needs a lot of effort and expertise to create this template at the beginning, the new cloud infrastructure later can be handled with less competence.

Amazon RDS– It’s easy to create, manage and scale an Amazon Relational Database Service. With this solution it takes only a few minutes to install a MySQL database, together with a re-definable hardware capacity.

Elastic Load Balancing– It automatically manages and allocates inbound network traffic if you operate more than one Amazon EC2 Instances.

Amazon S3– Amazon Simple Storage Service is a safe and efficient way to store all your data in a cloud platform. It is mostly used to store multimedia files, for instance it is here where EC2 servers access the images of your products appearing in your online store.

IAM– AWS Identity and Access Management allows you to create users and control authentication, permissions and access parameters in relation to the different services and resources. Using IAM, you can further create access keys, permissions and rules, just as you see them with well-known operating systems.

CloudFront – as a content delivery network (CDN), it handles static content. It manages content load in a way that the user gets the required content (e.g. pictures) from the closest available servers in the fastest way possible so that page load times stay short.

Naturally, you have the opportunity to try AWS Cloud for free.

You have two options for that: AWS Free Tier and Hosting Provider Demos.

AWS Free Tier

If you like challenges or have the necessary operating competence we described earlier, then after making a registration on Amazon you’ll be granted a one-year free access to certain AWS solutions.

Don’t be surprised if you need to give your credit card data in the registration process. It is so because of the confirmation by phone and the circumstances to be described below.

We advise you to make your selections with special attention because you can easily start or configure such resources that will cost you more money than necessary.

Luckily, you can follow your consumption on the Dashboard, but it’s always good to get information about the service you’re about to launch. To make it easier, AWS labels those resources that are free to try.

If you see the “Free Tier Eligible” sign with a service, then you should not worry.

You can store files in the AWS Cloud,

You can create users and authentications,

Use business analytics services,

Start a micro server with an operating system of your choice for launching the services

Run commands in its command shell.

But don’t just yet get too excited: this free server will not meet the technical requirements of your Magento store!

However, if you feel the urge to get a closer look at the “free version” of AWS, just click the link and you can start discovering this cloud platform right away.

Hosting Provider Demos

Many hosting service providers aim to obtain new clients with one-week or one-month free to try offers or pre-configured environments.

However convenient it seems to migrate your store to the cloud in 5 minutes, it has an extremely low chance that your specific needs and expectations will be matched (in any way) by a free hosting service.

Ready-made hosting environments, understandably, are not prepared and tailored to your requirements.

Therefore such demo shops cannot be properly adjusted and optimized to custom needs. Sooner or later you will need to pay for the services that will enable you to operate a store which is always up-to-date, fast, stable and reliable offering a flawless user experience to your shoppers.

What is managed hosting?

Before you start running your online store in the cloud, it’s worthwhile for you to take your time and collect information about what kinds of solutions and providers there are on the market.

If your ecommerce store is still before development, it’s a good option if you choose a company that deals with both development and cloud hosting. This has a great advantage for the future: later misunderstandings and frictions between the developer and the hosting service provider can be avoided.

What kind of issues can arise that can finally leave the merchant helpless?

A ton of problems can emerge, now let’s see a simple and frequent one:If you experience that your website slows down, you naturally would like to know the reason for that.

You’ll first turn to the developers who may blame the hosting provider saying they haven’t integrated the online store in the proper way.

The answer from the hosting company could be that the code is not optimized or that it’s flawed so that caching solutions cannot be implemented.

And the story goes on and on…

It may be better to choose a company that provides both services.

If the hosting and development are in one hand, they are more likely to have the expertise to operate your store reliably, taking special care of performance and data security.

Managed hosting is basically an extension of normal hosting (whether in a dedicated or shared environment), where the service provider leases out not only the basic infrastructure, but it also adjusts the environment to the specific business application (e.g. Magento).

In addition, the provider installs and maintains all those micro services that help the application run faster, more smoothly and more safely.

There can be other micro services to be needed since every single ecommerce application can be very different.

In the scope of managed hosting, this sysadmin or sysop tasks are included in the contract. Pricing can vary a lot because these services require high level competencies and each provider may work with different service portfolios.

To summarize it: in case of managed hosting, you not only hire the hardware infrastructure but buy the competency needed for installation and operation, too.

Afterwards, you only need to handle the application as a business user. Therefore it is very important to clarify responsibilities and authentications on both sides.

Based on the scope and quality of the service implemented, there can be many ways of defining the tasks of managed hosting. This list of services and definitions can either be shortened or broadened according to how the parties make agreements.

Let’s take a look at the most important aspects:

Server Monitoring – Monitoring actively the servers. In a preventive way, smaller errors can be detected and solved before getting more serious.

Security – Anti-virus protection, spam filtering, firewall and operating system configuration and updates belong here. Security is of high-priority with every computer and every network, especially where personal or business data may get damaged. This includes Operation Security, Security and Safety tasks, accessing and saving data, according to the SLA guides. Security certifications of the store are also important. They used to be checked mostly by payment gateways and banks, but nowadays Google also takes it into consideration as a ranking factor.

Overall security back-up and storage – Losing data is a loss on several levels for a company: it consumes time, money and weakens customer satisfaction. Thus the service provider has to get prepared to enhance stability with regular back-ups, storing and archiving data according to its security routine.

Support – Service providers give support on an ongoing basis and continuous service availability to avoid downtimes. If a problem arises, the client can notify the provider and the necessary steps can be taken immediately. There is a number of types for the support service: e.g. by telephone, via email, all year round, 24/7.

A well managed hosting service has several advantages for your business.

Let’s summarize these:

Lower costs of operation – Paying for the hardware environment and maintenance can be difficult for many businesses.

For ecommerce store owners, the costs of investment and the returns don’t match up so they cannot get an edge on that.

Hosting service providers can help the client use the infrastructure in a cost effective way. Scalability is an important factor, too.

Example: in case of peaks, when there is a need for larger computing capacity (e.g. during the pre-holiday period), you can allocate bigger resources. As a compensation, you can run your store for the rest of the year with cheaper operation.

More efficient resource management – If the client employs IT specialists, then he knows exactly that a reliable, competitive workforce should be paid high salaries so it’s of crucial significance to rationalize the resources. If the client can find this kind of expertise “externally”, with the service provider, then the in-house IT personnel can spend more time solving company issues and supporting their colleagues.

How and what do you pay for when using AWS hosting?

AWS offers its more than 70 cloud-based services on a „pay-as-you-go” basis.

There’s no trick here. You’re invoiced only for those items that you really used, based on the duration of the service use. There are no binding, long-term contracts (however, it’s worth giving it a thought for getting considerable discounts) or infrastructure start-up fees.

Similarly to electricity or heating costs, Amazon measures and records all usage and sends a detailed report of it in the accounting period, usually on a monthly basis. If you don’t need any of the hosting service components, then you just stop using it and that’s it.

One of the main advantages is that you don’t have to calculate with considerable investments or upfront costs.

All costs related to hardware assets (e.g. servers, active network tools), rents and rates of real estate and software licence fees, are all included in the price of the hosting service. So you can calculate with predictable and far lower prices for operation and maintenance.

Thanks to the pay-as-you-go model, your IT infrastructure can flexibly adjust to the rapidly or frequently changing business requirements. As we’ve already mentioned, resources can be triggered or stopped fast, therefore you can save money and avoid overspending or, on the contrary, avoid losses due to underestimations.

The point: You can use your own resources for corporate development in a much more predictable and cost-effective way allowing you to react dynamically to changing market patterns.

AWS is willing to give a volume discount as consumption increases. With services such as S3 or EC2, data export is layered.This means that the larger your data traffic, the lower the cost of service per gigabyte.

Besides, data import is free. As a consequence, as AWS usage needs to be increased, economies of scale take effect which facilitates controlling and optimizing costs. As your business is growing, AWS allows you to get those services more easily that help to handle new business needs.

For example, the fees of the data storage portfolio of AWS may be reduced based on how frequently and quickly you want to access your data. In order to optimize savings, you need to choose a combination of the specific storage solutions that help in cost optimization while not making a compromise on performance and security either.

With certain services, like Amazon EC2 and Amazon RDS, you can utilize the given capacity. In the case of the applied Instances, you can even save 75% of capacity. These savings can be realized on the basis of three payment options: All up-front (Auri), Partial up-front (Puri) or No up-front (Nuri).

Staying with the above example, the larger the starting instalment, the larger the discount.

With partial up-front payments discounts are smaller, but the start-up costs are also lower. If you don’t want to pay up-front costs at all, you’ll get only the smallest discount available, however, in this case you may keep funds for other business projects you consider important.

What types of costs does Managed Magento Hosting have?

What kind of information is taken into consideration when a managed Magento hosting service provider calculates costs?

On the one hand, in the case of AWS, the fees are public, anyone can check them at the simple monthly calculator of AWS. However, if you request a quote from a hosting service provider, you’ll get different cost figures, which shouldn’t be a big surprise, should it?

The cloud hosting service provider gets the AWS service at the same price as you see on AWS’s calculator site.

The added value you get from the hosting company lies within the services expert team gives you:

Fine-tuning and tailoring AWS to the needs of your ecommerce store,

Migration,

Configuring and updating servers,

Managing database back-ups,

and all the other IT competence the client doesn’t have to deal with,

letting them focus their attention to store operation, marketing, customer service etc.

The client pays the extra costs for this kind of service.

Most hosting service companies show their prices openly, in other cases, if you click on the “Pricing” tag, you are simply redirected to the contact page so that you can get a custom price.

If the prices are shown, it is a usual approach that you meet different price categories or pricing packages for different hosting portfolios.

When comparing these, you’ll notice that there are no big differences, mostly, you see 4-5 package offers, with a rather wide price range of $35 ‒ $5000.

Important: AWS always indicates prices in US dollars, so it’s worth paying special attention to any quote in another currency you get from a service provider.

We at AionHill offer a one-server AWS environment between $150 ‒ $760, while for a multi-server infrastructure we generally charge between $500 ‒ $1600.

There are no two identical requirements, just as there are no two identical online stores.

Therefore it’s wise if you let the IT experts of your chosen cloud hosting company set the most appropriate environment possible. For that a wide range of IT capabilities will be needed so that an accurate price calculation can be made in the end.

What to expect when negotiating with a cloud hosting service provider?

Sizing up technical parameters takes place either via email in advance or in person, with the involvement of AWS specialists in the estimation process. As the client, you need to know why you’d like to migrate your ecommerce store to the AWS Cloud, what benefits this will have, what costs and downtime it will call forth.

Logically, the more complex and customized your system, the more sophisticated the solution you’ll need. The more tailored solutions you expect, the more resources are needed for the process.

However, if you add up all the costs of buying, installing and managing your own server infrastructure and compare it to the costs of managed hosting, then you’ll clearly see that your cloud investments will likely pay off even in the mid-term.

The most critical data can be obtained from Google Analytics. This is enough for the hosting company to start their calculations. Additionally, there can be some questions that only your IT team or former developers can answer. It’s also worth drawing up a draft of the public part of the server topology and its specifications (Visio).

Let’s see what kind of questions you may encounter:

What is the daily visitor number on your website?

What is the number of started sessions in a month?

In the case of peaks, what was the highest number of sessions in the given period?

How frequently do these peaks occur in a given fiscal year?

Which version of Magento do you want to have developed or which version type would you like to migrate?

What is the number of SKU’s in your store at the moment?

What specifications do the present servers have?

What type of external systems does your store communicate with and are there any plans for expanding this infrastructure (database type and size, invoicing software, ERP, CRM etc.)?

What services and technologies should you expect from the cloud service provider?

Your Magento ecommerce store has to meet a set of requirements in order to be able to serve your clients’ needs in an adequate quality. That includes a lot of things starting from the professional competence of the operator, through the used technologies that are kept up-to-date, to customer support:

What kind of services are provided to the client in addition to the leased infrastructure, and how can the online shop owner benefit from them?

How is data security guaranteed?

Through which channels communication and error reporting are done and how efficient are they?

A bit earlier we summarized the basic tasks, however, if the satisfaction of the client is important to the hosting company, those won’t be enough.

What should you pay attention to as a client in the “gate” of the cloud?

Migration

In case you’d like to see your already existing, finished ecommerce store in the cloud, professionals of the service provider will manage the complete process, but in order to be able to accomplish that, they will most probably need to cooperate with the owner of the online shop or the IT specialists of the store.

You should facilitate that as a client, as a contact person, and you should also be sure that everything on both sides is documented for the sake of being able to be followed up.

Pay attention to the following:

Does the service provider inform you about the circumstances of the migration?

Is the process subject to separate pricing or is it built in the price of the service?

What time-frame do they undertake for the completion of the task, and how much does that affect the business continuity, how much loss or downtime should the ecommerce store expect?

Be consistent and circumspect, not only with your business partner, but with yourself as well! You should rather ask a question several times during the negotiation process rather than to experience some kind of technical obstacle at a critical time.

Code audit

When the service provider is hired to migrate an ecommerce store to the cloud, smooth and quick operation of the shop is a legitimate expectation. However, the proper operation does not depend only on the server environment, but on the combination of the environment and the development together.

Hosting companies – just like developers – use certain cache procedures, technologies, the use of which makes the page load faster, optimizes the reach of the static content, or it gains the valuable data from the behavioural patterns of the shop’s visitors with analytical techniques. Data which will help you make “Data Driven Decisions”.

Attention!: Access to the code of the ecommerce store is necessary for the use of such technologies, in order to find out the quality of the code with the appropriate examination and to find out whether these technologies can be applied. If a service provider doesn’t bring up the possibility of this in case of a page that should be migrated, you should start having doubts of their professionalism!

SSD and EBS

Nowadays there’s an increasing number of service providers who store your data on “Solid State Drive” in order to achieve higher write/read values.

These drives have already spread even among the public users in the last few years. And in the case of cloud hosting, this technology can almost be considered as a must. In the cloud of Amazon, you can find both SSD and so-called EBS (Elastic Block Storage) storage solutions.

The most important difference between them is their flexibility: you can attach or detach EBS to an Instance any time, which means it’s independent of servers, while SSD is physically within the server.

Apache and NGINX

Apache and NGINX are the two most used open-source code web servers in the world. Together they account for 50% of the traffic realized through the internet. Both solutions allow various work loads and they are capable of working with other pieces of software, forming a kind of web stack.

Apache

This solution is often chosen thanks to its flexibility, strength, and because it’s widely supported. It can be extended with a dynamically loadable module system that’s capable of processing a lot of scripting languages without having to use a separate software application for that.

NGINX

In 2002, Igor Sysoev started to work on NGINX, trying to find a solution for the C10K problem (management of 10,000 concurrent connections) that was a great challenge for the web servers, which was a prerequisite for the modern world wide web.

Thanks to the exploitation of such a small resource and its flawless operation on minimal hardware, popularity of NGINX has been increasing ever since its release.

NGINX manages the static content perfectly, and it was created in a way that it redirects the dynamic queries to another software application that is much more suitable for their management.

Varnish Cache

This is a widespread caching technology, because it increases the performance of the web page extremely effectively by being able to reduce the load time on the server side.

This feature facilitates not only the improvement of the user experience, but it makes this technique popular from an operational point of view as well.

Another strength of this technique, in addition to loading optimization, is ESI (Edge Slide Includes), which breaks the page down into components and “boosts” these elements one by one independently.

Load Testing

Load testing is a type of non-functional testing.

It is a type of software testing which is conducted to understand the behaviour of the application under a specific expected load.

Load testing is performed to determine a system’s behaviour under both normal and peak conditions.

It helps to identify the maximum operating capacity of an application as well as any bottlenecks and to determine which element causes degradation. E.g. If the number of users increases, how much CPU, memory will be consumed and what network and bandwidth response times are to be experienced.

Load testing can be done under controlled lab conditions to compare the capabilities of different systems or to accurately measure the capabilities of a single system.

When computing in Amazon’s cloud, we might want to think a bit different from the traditional ways. The old(er) methods do not seem to work well with CloudFront, Amazon’s CDN service.

It uses DNS to balance loads across geographically dispersed edge locations and within each edge location.

CloudFront is designed to scale for viewers that have different client IP addresses and different DNS resolvers across multiple geographic regions. To perform load testing that accurately assesses CloudFront performance, we recommend doing all of the following:

Send client requests from multiple geographical regions.

Configure your test so each client makes an independent DNS request; each client will then receive a different set of IP addresses from DNS.

For each client that makes requests, spread your client requests across the set of IP addresses that are returned by DNS, which ensures that the load is distributed across multiple servers in a CloudFront edge location.

Security in the cloud of AWS

In the life of a company, be it a medium-sized enterprise or a small start-up ecommerce store, it’s many times the attitude that prevents the business from moving into the cloud and not the capacity problems.

In the developing countries, companies often strongly insist on having their own machine farm, servers being within reach, just as if their physical proximity in itself would guarantee the security of company data.

AWS provides a lot of solutions for the security of the critical data, of work networks, and of the quick but reliable access:

Network firewalls have been built into Amazon VPC, and AWF WAF (Web Application Firewall) allows creation of private networks within the cloud, furthermore, access to the servers and the applications can be restricted

TLS encryption is provided for all services

Private or dedicated connection options, from place of work or from a desired secure environment

"I really believe that you have no business on the internet if you do not make protection of your customers a top priority.… We are responsible for the security of the cloud. We innovate rapidly so you have the tools to protect your business in the cloud."Werner Vogels, VP & CTO at Amazon.com

DDoS – Massive, Distributed Denial of Service attack

Accessibility in case of cloud-based services is of vital importance. The technologies used by AWS today are already resistant to distributed denial of service attacks.

The appropriate combination of the services guarantees the strategy against DDoS. When experiencing such an attack, the different services automatically notify the other parts of the system, thus minimizing any time loss and the effect of the attack.

Auto scaling of AWS, CloudFront and Amazon Route 53 (which is a DNA service) together help prevent or alleviate any DDoS attacks.

AWS encryption

Encryption of AWS is another security level for the protection of the data within the cloud. It’s also well scalable and effective:

The encryption is available for the data storing and database services such as EBS, S3, Glacier, Oracle RDS,SQL Server RDS and Redshift.

The flexible key management settings, like the AWS Key Management Service, allow setting whether AWS or you have full authority over the management of accesses.

WS Directory Service performs user management similar to what Microsoft Active Directory does, thus reducing time loss due to administrative requests and tasks.

AWS supports integration of user accounts and access-monitoring applications into their own services, just like it supports API integration with any of their own applications or services.

AWS Shield

AWS Shield is a managed Distributed Denial of Service (DDoS) protection service that safeguards web applications running on AWS. There are two types of AWS Shield: Standard (at no additional charge) and Advanced.

If your business needs higher levels of protection against attacks targeting your web applications, you probably have to subscribe to Shield Advanced. This happens when you are using Elastic Load Balancing (ELB), Amazon CloudFront and Amazon Route 53 resources to serve your business needs.

Basically Shield Advanced provides additional detection and mitigation against large and sophisticated DDoS attacks and also gives you access to the AWS DDoS Response Team (DRT), 24×7. Another benefit of Shield Advanced, is customizable protection, which means you have the flexibility to write customized rules to mitigate sophisticated application layer attacks.

In the case of working with networking pros and experts in your managing team, whether they belong to a hosting provider or they are under your control, you should start with Shield Standard first.

Hosting companies usually use 3rd party monitoring tools and combining these tools, their expertise and AWS Services (WAF, Shield) is a very effective way of protecting your application.

Conclusion: It’s clear that Amazon makes every effort to provide a well scalable, secure cloud infrastructure for its clients. Can it be said then that AWS Cloud is secure? Yes, it can be stated that it’s no riskier than the operation of dedicated local servers.

SummaryNowdays the companies behind the biggest brands communicate with you from behind the cloud. Because of their robust nature, these corporate structures have all benefitted from the advantages of cloud computing, of optimized resources and of the cost effective operation model.

There are more and more players on the hosting market as well, the number of possible solutions is increasing, and as a result, the number of those who choose to upload their data in the cloud is also increasing.

The attitude, trust and security issues are much more in your way, and if you can overcome those as a client, you can set your ecommerce store, your company on a new development path. Increasing efficiency by taking advantage of the computing capacities lying in the cloud is not the privilege of the multinational companies any more.

You should start finding a new solution if your online shop could not fully serve the needs of your customers during the latest heavy loads, in case you’d like to recalculate the IT investments concerning your operation, or in case you’d like to modernize your corporate infrastructure.

Look for service providers with references, ask for their opinion about how they can make your ecommerce store benefit from their professionalism and take advantage of the huge capacity lying within the cloud.

UPDATE: Based on reader comments, we added two sections to this post.

The first helps you choose the most appropriate AWS EC2 infrastructure for your Magento ecommerce business, written by János Mikó, one of our experienced system administartors.

The second guide shows you step by step how to install Magento in the AWS cloud, brought to you by Tamás Bognár, the leader of AionHill’s IT department.

Which are the best AWS EC2 instances for your Magento 1 or Magento 2 store?

Basically, all AWS Instances, excluding the smallest ones, can handle a Magento 1 store. The real question is how the instances should be used properly for achieving the best performance.

The answer is not at all simple in most cases. It is a challenge involving many factors that need to be studied.

Here we are going to categorize and analyse these factors in order to be able to provide you with a thorough description about the solution that could best match the needs of your Magento online store.

It’s important to note that there is a considerable difference between the main versions of Magento 1 and Magento 2. Basically, the whole system was recreated and it now needs more resources in every aspect.

Apart from that, there are two major areas that need to be considered thoroughly when installing (and running flawlessly) a Magento store on an AWS EC2 Instance.

These two categories (with sub categories) are:

Structure, quality and complexity of the technological environment:

Web server and PHP engine and how they are optimized

Cache mechanisms (OPcache, Varnish, Redis, Elasticsearch)

Size and location of the database

Usage of “external” solutions

Quality of the code

Website traffic, load distribution

Web server and PHP processor

First, we mention the web server, including the elements of the system that are not very resource intensive.

Although there is a broad range of choices in this respect, according to Magento’s official documentation, there are only two officially supported web server types:

Apache HTTP Server, developed by Apache Foundation

Nginx, developed by Igor Sysoev

There are only slight differences between the two both in terms of speed and required resources. However if we are strict on performance and memory use, nginx is probably a better option.

Of course, there are a lot of aspects that need to be considered during maintenance and according to which we can fine-tune web server and processor performance.

Being familiar with the functions of web servers (to put it very simply, it is serving directly the requests for static content, and forwarding the requests to the PHP interpreter in the case of dynamic content), we can state that for serving the minimal needs of a Magento store, a properly optimized web server should not use more than 100-200 MB of memory.

Naturally, this number increases sharply when we serve tens of thousands of users.

If we talk about the ideal memory limit recommended for the PHP engine, we have a more complex issue.

Even in the case of Magento 1, the minimal memory limit is of 256 MB, but the recommend is 512 MB. And for Magento 2 it’s significantly higher: 2 GB, under which the use of swap is recommended.

Having these requirements in mind, we now can say that for running Magneto 1, every type of AWS instance (except for the smallest: t2.nano) can be used.

On the other hand, for Magento 2 stores the ones with at least 2 GB of memory should be selected.

Please note: these resources can serve only the minimal or basic server requirements. Here we don’t calculate with caching technologies like Varnish or Redis or running your own dedicated database solutions.

Using caching technologies in the system

In order to better understand the resource needs of the different caching solutions, it’s worth talking a little about how they work and what their purpose is.

Caching technologies are temporary storage solutions that store data so further data requests can be served faster.

Let’s see an example: Let’s suppose we’d like to show an image to a user request.

The process is basically the following: the HTTP server uses the hard disk, reads the image and “transmits” and displays it to the user. Now let’s suppose that the next 50 users would like to see the same image. The HTTP server forwards the request to the hard disk every single time.

Now, we know that there is a huge difference between the read/write speed of hard disks and RAM (30-500 MB/sec. vs. 4-10 GB / sec.), so it would be logical to store the data, which users will need often in the future, in the memory.

This realization led to the development of caching solutions. Here are the most popular types.

PHP OPcache

It’s been part of PHP since the launch of PHP 5.5. For the earlier versions it could be downloaded as an extension. It’s a simple and easily configurable caching solution, therefore we recommend using it.

Varnish

We highly recommend using it especially for Magento 2 stores. It’ll help you speed up your pages considerably.

Caching in general takes a lot of memory.

Varnish, depending on the content size of the website, may need a memory capacity of 128 MB up to several GB. It’s definitely worth taking into account using it before migrating your ecommerce store to the AWS cloud.

Redis

Redis is an object caching tool (key/value store), which can be used by the Magento system for storing configuration parameters, entire pages (FPC) and sessions.

The official Magento 2.0 DevDocs also recommends using it. Although the default setting doesn’t define a memory limit for it, experience suggests that it’s enough to set Redis memory usage in the range of 64–1024 MB even with a high-traffic store offering lots of products.

Elasticsearch

Elasticsearch is a search and analytics engine that helps us make product search faster.

It is not so widely used. It’s quite computing and memory intensive, supported officially only by Magento 2 Enterprise Edition.

It can be obtained for Community Edition and earlier versions of Magento as an extension. Minimal memory requirement is 256 MB, while the recommended memory requirement is about 1 GB.

Database

As we build the server environment, it seems logical to have the database at the same location as the web server (Apache / nginx) and the module (PHP-FPM) processing PHP requests.

With smaller online shops (having only a few products with low traffic), it’s not necessary to dedicate a lot of resources to the database server, however, with large stores with lots of products and heavy traffic, high-performance processors and a lot of memory are needed.

In the latter case, it’s worth giving it a serious thought to have the database on a separate server (or even servers) or using the dedicated and scaled database management solution of AWS.

A properly optimized database of a smaller store would need only 256–512 MB of memory, but you must be aware that this number will strongly increase if your store gets popular.

Using “external” solutions

Note: The term “external” refers to AWS services that are used “out of” the EC2 Instance.

If you have made the decision to migrate your online store to the AWS cloud, and started thinking about what type of instance you should choose, you need to be aware of the external services as well, offered by AWS.

These provide a solution for the services mentioned above.

Their advantages include helping to reduce the EC2 instance size that would be needed originally, they can be scaled finely and they are easy to manage.

On the other hand, these services are rather costly. Consequently, if you have an expert who can manage these technologies properly, it may be better to have these installed on your EC2 Instance.

This table summarizes these services and their AWS equivalents:

Name of service

AWS equivalent of service

MySQL

Amazon RDS

Redis

Amazon ElastiCache

Elasticsearch

Amazon Elasticsearch Service

Quality of the code

Beyond the server infrastructure maintenance, you can also optimize your online store on the code level, which helps save further resource capacity thus saving money as well.

Although we have mostly dealt with memory capacities so far, it is important to note that processor usage increases proportionately along with the increasing number of visitors.

For this reason, we don’t recommend using the EC2 Instances with 1 VCPU.

If your visitor number is quite high, it’s wise to invest in using C3-C4 machines optimized for computing performance.

Which is the smallest EC2 Instance enough for running a Magento 2.0+ environment?

You can see in the table above that a t2.medium instance may be enough for running a Magento 2 store.

However, if your goal is to operate a store serving more than 3-5 visitors simultaneously, then you should give a serious thought to using larger instances.

Conclusion

In this section we have described the services and resources that you’ll likely need for running your Magento store conveniently in an AWS environment. However, we have not yet added up these resources.

In the table below we make an attempt to sum up what types of EC2 Instances you’ll need for serving your online store securely. But you also need to know that the required size of the instances largely depends on the traffic served by the web server.

That being said, we assume that the store has low traffic with approx. 3-5 concurrent users and a maximum visitor number of 300 per day.

Migrating an online store with higher traffic than that, in our opinion, needs involving an expert to eliminate the risk of ruining user experience due to slower page speeds or even downtimes.

This table includes only some rough estimates for the minimal requirements, both in terms of hardware and visitor numbers.

Magento Enterprise Cloud Edition

Magento Enterprise Cloud Edition is a reliable choice for bigger companies that wish to fully move their business, and all related process, to the cloud.

Currently, retailers using Magento have to manage their own hosting (i.e. via a hosting partner). Setting up and running a Magento store just got a whole lot easier, because it is designed and developed that way. It is fully optimized for cloud computing environments.

In a nutshell, Magento Enterprise Cloud Edition is a PaaS (Platform-as-a-Service) offering built on AWS infrastructure. With this move Magento has the capabilities to introduce more dynamic deployment processes.

By building Magento Enterprise Cloud Edition on AWS, using the Elastic Beanstalk service, Magento can handle demand more efficiently.

We are talking about a PaaS here, so there is a handful of services and technologies built into the package. All solutions are architected and optimized for Magento 2.0.5.

Magento announced a series of strategic partner services that make up the Cloud Edition package.

These include:

Platform.sh – An extremely flexible cloud hosting solution. It is all about speed and automation. Development environments can be created, tested and merged quickly while its infrastructure is designed to run system components in isolation. This could helps store owners to experiment and react quickly without risking their running eCommerce business flows.

New Relic – Probably the best application performance monitoring. It goes far beyond standards. New Relic will assess everything from server infrastructure to browser performance and alerts when something goes wrong.

Plus, Amazon supports Magento, as Hal Bennett (General Manager Global Technology Partners, Amazon Web Services, Inc.) said last year:
„We are pleased to see that Magento has built its new commerce platform on top of AWS as we firmly believe that AWS offers merchants a flexible, secured, scalable and low-cost environment for online sales and retailing. We look forward to supporting Magento and their customers on their journey to the cloud.”

How to install Magento on AWS EC2? (Step by step guide)

In this section we’re going to show you step by step how to install Magento on AWS cloud.

There are a good number of ways to do this, we think basically these are the most popular methods:

1) You install the services to a completely empty machine manually (web and database server, PHP) and configure these yourself. Then install Magento.

2) Use a pre-installed AMI (Amazon Machine Images), on which the necessary services are already installed. AionHill has such a system readily available.

3) Find a Magento hosting company and assign them to install your store according to your requirements, be it an existing store or a new one.

From the options above we describe the second one in more detail, which is using an AMI for installing a Magento store.

We’ll discuss how to configure your own EC2 instance and then how to install the Magento store.

Creating an EC2 instance

First, log in to your AWS account. Then choose the region where you want to run your machine:

Next, go to the AWS EC2 console dashboard and choose Launch instance.

On the next page you can select the most appropriate solution for your needs – Choose an Amazon Machine Image (AMI).

Here we’ll use AionHill’s custom public AMI with which the database, the webserver and PHP is already installed.

On the Community AMIs tab, choose AIONHILL-Magento-Public.

Afterwards, server resources can be configured: Choose an Instance Type

In the following we are going to install the Magento store on a t2.mirco instance.

This version is not recommended for an operating store environment!

Now we’re going to configure the network.

Here you need to define the network and subnet parameters, and network devices data. You can use an existing network or prepare a new one specifically for this service.

Then you need to set the data of the server storage.

There is a 10 GB disk space here by default for the system. We recommend installing Magento on a different dedicated disk (volume) and not on this one.

Add a 20 GB disk capacity to it and make sure you note what name you give to the device. In this case we note the last letter (b), because this parameter will help to find the disk later.

On the next tab you can customize network settings.

For the just installed machine you need to set the following in order to ensure accessibility from any location:

For SSH access: port 22

For HTTP and HTTPS access: port 80 and port 443

Having checked the settings of your machine, now it can be started.

As a final step, an SSH key pair should be set in order to have a remote access.

Installing Magento 1

1)

Log in to your server with the private key of the SSH key pair, given in the last phase of machine installation and start. The public section is inserted by AWS in the relevant field after installation. A suitable piece of software for this is Putty on Windows, while on Linux you can log in the following way using the terminal:

ssh ubuntu@elastic-ip-address -i /route/to/private-key

2)

After logging in, update your system:

apt update && apt upgrade

3)

During installation we set to have Magento on a dedicated volume. Before using it, a few commands need to be run:

This can be done as seen in the screenshot above, you need to insert the password in the User Password field, which you set in step 4 with the second script (SQLWAPWD).

After filling out the fields, you may proceed.

On the Create Admin Account tab, you can set the parameters for an admin user.

Having set the user name, email address and password, click “Continue” to get to the final step.

Here you can view the backend and frontend pages:

If everything has been done correctly, you can see the following pages on your browser page:

Frontend:

Backend:

For configuring cron jobs (i.e. time-based jobs), you need to give the following command, which, in one step, will enable the cron jobs for the user (webapp) running Magento, according to the official Magento documentation:

Zoltán Hetényi

Hosting Services Specialist

Zoltán is an Amazon Web Services cloud hosting specialist, continuously looking for the optimal solutions for clients. His mission is to give a helping hand to online store managers who are interested in the “cloud” as well as to those who already use this type of hosting service. In his free time, Zoltán enjoys computer games and plays bass in the legendary RGB band.

More articles

In our previous three articles, we described how to build up a sample Magento 2.0 module. We created an admin panel and a custom database table for it, showed how to save and manage data and also how to display data on frontend. Then we went on describing how to use Observers with the help of another sample module. In this post we will explain how to use Knockout.js which is used many times within the Magento 2.0 system.

Those who want to create an online store may find several dozens of different ecommerce systems on the market. Magento and OpenCart are both popular, they are known as reliable solutions, however, their capabilities are certainly not identical. In order to help you decide which system may be the most suitable in a given situation, we will compare the two systems in detail.

Do you need our support?

TELL US ABOUT YOUR MAGENTO PROJECT!

We will happily put our experience gained in complex and comprehensive international Magento projects at your disposal. No matter how complex your ecommerce project may be, we’re sure the mission can be completed.