Seperate the API part for smaller deployments #1272
Matthijz98
started this conversation in
Ideas
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have a random idea and wanted to get some feedback.
TLDR
I want to reduce the amount of ram my sites need by not using Node.js because it needs 25-35mb of ram.
While nginx would only need about 4-8mb.
*While idle
So if the API would be split out, that would reduce the server load a lot.
First, a bit about my situation and origin story (sorry it is a bit long):
I manage about 300 small sites for, mostly non-profit organizations.
Most sites have about 100-300 views a month.
The content on the sites is only updated ones a month on average.
One of my goals is to make the operating cost of hosting the sites as low as possible because most organizations don't have big budgets.
So I did some research, hosting WordPress costs about 2 dollars a month. So for all sites, that is about 600 dollars a month.
Trying to reduce the cost, I looked at switching it to a VPS.
On the cheapest Digital Ocean VPS, I can host about 8-10 WordPress installations (a bit more i they would share the same database container).
To increase the number of sites I can host on one VPS, I came up with a solution to install only one WordPress container and database.
Then manage multiple sites using the WordPress Multisite plugin.
Then statically rendering out the sites and serving it with nginx.
This way I can host about 70 sites on a single 4 dollars a month VPS.
Because the static rendering of WordPress sites has plenty of problems, I stated looking into Astro.
And switched some sites over for clients that were capable of using git and VS Code to edit .md files.
The docker container with the sites uses only 5-8mb of ram, so I can host many more sites on a single VPS.
But now my issue and idea
I want to switch more sites over to Astro.
And I want a CMS for my users, and I love Keystatic for how easy it is to use.
But because Keystatic needs Node.js for the API, all sites need to use a Node.js container and not nginx.
That would require about 3 times the amount of ram on my VPS for hosting an API that is only used a few times a month.
I looked at the code for Keystatic and as far as I can see, the API calls are all for interacting with GitHub, the file system with the project is not needed only for the validation of the data, but that is mostly done client side.
So what would be great is to be able to host the API only ones and then point all the Keystatic installations to that API.
Or when using the Cloud version, it would be even better if I don't need to host any API stuff similar to how Tiny CMS works.
Beta Was this translation helpful? Give feedback.
All reactions