Hosting Directus

When hosting Directus, it's important to know how Directus works. You can then decide on your requirements and meet your budget.

Hosting Directus

When hosting Directus, it's important to know how Directus works. You can then decide on your requirements and meet your budget. This article will cover how Directus utilizes hardware and recommend different hosting options for Directus.

Hosting Directus really depends on the expected traffic or load on the API. It can run easily on a single CPU with 1GB RAM but if your traffic peaks or you have a regular stream of heavy traffic, then it's worth looking at 2 or 4 CPU cores.

I've collected some hosting companies that can run Directus. It's important to read further and find out what resrouces you will need when purchasing a server.

💡
For those on offer, be sure to get as many years as you can in one purchase to get the most saving. Renewing will always be at the full rate.
Liquid Web | VPS Plans
Liquid Web is a leader in Managed Hosting solutions for mission critical sites & apps. When uptime and reliability are non-negotiable, trust Liquid Web!
VPS Hosting Services 🖥️ Managed Virtual Servers at Namecheap
Choose the best cheap managed VPS provider? Namecheap’s VPS Linux-based web solution includes: ✔️ pure SSD ✔️ cPanel ✔️ WHMCS ✔️ 99.99% uptime ✔️ 24/7 Live Chat and more.
Managed VPS Hosting | 20X Faster SSDs & cPanel | InMotion Hosting
Powerful and secure managed VPS hosting solutions with High-Availability servers, Linux SSDs, cPanel, and WHM - all backed by 24/7 support.
Best Managed VPS Hosting Provider | A2 Hosting
With unmatched speed and reliability, our Managed VPS Hosting provides up to 20x the speed of competitors with a 99.9% uptime. Shop now!
Best Web Hosting - Domains - WordPress - Bluehost - 2022
Bluehost is one of the largest website hosting providers and powers millions of websites. Learn more about our secure and reliable hosting services today!
VPS Hosting | SSD Storage | Get Cheap VPS for $3.95 Only
Get Cloud based VPS hosting to expose your online performance. 30X faster VPS hosting is absolutely stable and secure. Now VPS hosting is up to 77% off!

Directus also provide their own hosting - Directus Hosting Plans

Directus: Open Data Platform for Headless Content Management
Directus is an open-source Headless CMS with the flexibility and power of a Data API. It allows managing both content and raw data, in any new or existing SQL database — keeping all your data pure, organized and portable, end-to-end.

If you want to read futher into this website hosting in general, Amazon have Web Hosting for Dummies or other web hosting resources.

Shared Hosting, VPS or Dedicated?

Most hosting providers offer Shared Hosting, VPS and Dedicated options. Shared Hosting is not suitable for Directus as the demand on the API can exceed your agreement. Dedicated is the best and will get you the highest performance and bandwidth, but is expensive. VPS is the happy middle-ground.

Introduction

At it's core, Directus has an API that queries your Database whenever someone interacts with the interface. If you have any app or websites, this will also interact with the API and increase the load. When a query is requested, it utilises a CPU core to process the request and return the data. With the Interface written in VueJS 3, the data is rendered using the client's device, taking that pressure away from the server. But, it's never just a single query. Whenever you interact with Directus, there are several queries running in the background, each with their own purpose. With this in mind, how many cores should I have?

How Many Cores Should I have?

A single CPU server will have a bottleneck of all the requests coming through and will ultimately seem slower to a user. Increasing the cores, increases concurrency where requests can be made at the exact same time. Here are my recommendations.

  • 1 CPU: Small Project, 1 - 3 users and a low volume website (minimal chance that 2 requests happen at exactly the same time ~30,000)
  • 2 CPUs: Medium Project, 4 - 10 users and a medium volume website (~70,000 views per day)
  • 4 CPUs: Large Project, 10+ users and a high volume website (~200,000 views per day)

More Cores or Higher Clock Speed?

Hosting providers tend to have decent clocks speeds and the only reason to increase it, is when your scripts are very long or complex. In most cases, increasing the cores is the better way to go and more cost effective.

Should I Decouple my Website to Increase Performance?

In most cases, this wouldn't make much difference since the requests still need to go through Directus. If you have a website that is using another CMS such as Wordpress, then it is definately worth hosting them seperately as they will be competing for computing power.

For example, you can use Wordpress and Kinsta, then have your Directus on another server. Unfortunately Kinsta only support Wordpress.

Plans
Kinsta’s WordPress hosting plans start at $30/month with free migrations and a hack fix guarantee, powered by Google Cloud Platform.

How Much RAM Do I Need?

RAM comes down to the volume of images you intend to have. Directus creates thumbnails on the fly and requires RAM to create them. The larger the images, the more RAM required to resize them. Here are my recommendations:

  • 1GB RAM: Small digital assets always less than 2 MBs
  • 2GB RAM: Large digital assets always less than 10 MBs
  • 4GB RAM: Photography level digital assets always greater than 10 MBs (requires changes to configration file to support more than 6000px)
  • 8GB RAM: Frequently adding new high resolution images

The RAM is also impacted by the CPU. If you have 2 CPU cores, then requests for thumbnails may come at exactly the same time and would need more RAM to complete both requests. Common server specs have twice the RAM per CPU core, for example, 1 CPU 2GB RAM, 2 CPU 4GB RAM.

Enterprise Level

When you reach Enterprise level requirements, this is where Directus can really impress. Hosting become more of a infrastructure diagram with mutiple servers. Companies like AWS, Azure and Google Cloud make this process simpler by giving you all the tools in one place.

In order to load balance Directus, you need to move the SQL database to a central location and use cloud file storage. Most Enterprise hosting companies provide a managed SQL service with load balancing so you don't need to worry about data integrity. Amazon S3, Google Cloud Storage and Azure are supported.

Once you have your SQL credentials, create multiple servers to host the Directus software and your website. Use the information from earlier to decide on the hardware specifications. When installing Directus, add you SQL server credentials. Repeat for all servers. Now you can use Directus on any server and they will always be in sync.

Here is an example of a load balanced infrastructure.

example structure

How Many Cores Should I have when load balancing?

It's quite simple. Each time you add a new server, it divides you traffic by the number of servers. Let's say you have 1 million users per day, you can use 5 servers with 4 Cores or 12 servers with 2 cores.

How to Reduce to Cost?

When load balancing servers, this can start to drive up the cost significantly, so how do we reduce the cost? This is where you can start switching servers off during quieter periods. Cloud computing companies offer many "Elastic" services where you can automatically toggle new servers on and off depending on your traffic so you are only paying for what you need.

Conclusion

Now you know how Directus handles requests with the CPU and RAM and how to choose the specifications that work for you. Ready to get started, check out some recommended hosts below.

By continuing to use our website, you consent to use essential cookies. We also use optional tracking cookies which help us gather statistics to improve our services. Do you consent to these cookies?

I Consent Do not track