We always like to ease out the complicated process that one has to go through. So, this time while working on the Docker based version 4 of EasyEngine, we came across two possible option for databases.
- Global database: To create a single Database container across all the websites.
- Local database: An individual Database container per website.
To find out the best performer, we ran a load test using Locust to find the average response time of the sites in each case. The WordPress database was populated with the same 10,000 posts in each of the websites which were tested. After this the homepage and archive page were queried in the load testing by using the Locust . The Locust load test was run for a time duration of 30 minutes with 100 users spawning at a hatch rate of 10 users per second on a VM with a single core and 1GB RAM. The test created approximately 20k+ requests and yielded following results of average response time of the pages:
|Type Of Site
|Average Response Time
|Single db container across all site
|Per site db container
Apart from response time, other factors like resource utilization, will be higher in case of the per site database container as every site will have its own individual database container. On the other hand, individual database containers will provide data isolation which will not be possible in the single database container for all sites.
Your feedback and comments are valuable to the EasyEngine community. Also this discussion will help a lot of people to understand the pros and cons of the same. Leave your comments on this issue on GitHub.