Small Site With Flat Files as its Backend: Shared Hosting or VPS

Hello everyone. My website is graysonpeddie.com and I currently built my website from scratch. I SCP my files to and from my website from my development server. My website uses PHP and is considered dynamic but it does not use a database but simply gets posts from HTML files. Here’s an example:

/var/www/grayson-mvcblog/modl/posts/20230219-1115-need-filemanager-for-linux/

So basically I have index.html for my main post, excerpt.html for excerpt, an meta.json for metadata.

Currently, my load average is “0.01, 0.00, 0.00” which basically uses very little CPU resources and my VPS runs a dual core CPU with 2GB of RAM but only less than 256MB of RAM is used. Apparently Apache and PHP-FPM is using no CPU resources at all. I tried visiting my website and still none.

I’m currently paying $21/month for Digital Ocean with dual-core AMD and 2GB of RAM and 50GB of storage space and about 9GB is used by /usr and /var and my website only consumed 120MB (about 252KB used by PHP files to power my website minus the posts and multimedia files).

I do take security into my own hands such as making use of mod_security2 in Apache and I am well versed in configuring Apache web server with headers in mind such as a basic Content-Security-Policy that does not allow JavaScript code in my website (and yes, I did built my website thinking JavaScript does not exist).

If I do go with shared hosting and do away with VPS, I do not like the claim “unlimited” when it comes to disk space. I mean, sure if “unlimited” means I could host my let’s plays of videos, that would be great so I could just make use of plain HTML5 video, but I do have Odysee for that (sorry YouTubers, can’t stand AI for moderating videos and comments and even my comments get deleted from time to time even if I did not swear or post links). However, I could see myself storing my own music that I made in the past, but I have to watch out for the claim “unlimited disk space” as nothing is truely unlimited.

Will I be better served with going for shared hosting?

1 Like

What outcomes would you be looking for in moving to shared hosting? Just reduce cost or simplify management?

I haven’t used shared hosting in some time but traditionally, the downside was that if someone else’s site had a security issue, this could affect other sites on the same shared host. You may also be contending for resources which could be oversold but it doesn’t sound like your site uses much resources.

Cost wise, perhaps you could move to a cloud free tier instance - Oracle has a surprisingly generous free tier, especially if you opt for the ARM based Compute.

Final suggestion is would it suit you to refactor your site as a static site that calls some form of serverless function for the dynamic code? - then you could host the static files in cloud blob storage or on a platform like Netlify

2 Likes

You could downgrade your current VPS to a less powerful one, and use those savings for object storage. Some providers offer 10GB for $1 so I guess it depends on how much storage you really need.

1 Like

I’d say to downgrade the VPS too. If you can find a VPS that offers a low tier 512MB + 1 core CPU, that’ll be plenty. If it comes with limited storage, try asking for a lighter distro, like Alpine Linux, some VPSes can be very accommodating. If you still need more storage, you can run wireguard and host your data at home, but serve it from the VPS through the wg tunnel.

I’d also suggest moving to a static site generator (ssg6, jekyl, hugo, pick one). But I love that you choose to make your website w/o JS, GJ! I love being able to navigate sites with NoScript enabled (and generally when websites don’t work, I just leave instead of adding exceptions for them, which makes for a very sanitized web, which I enjoy). But if the current solution works, hey, more power to you.

I wouldn’t go with a shared hosting, because if their servers get compromised, then your website could also potentially deliver malware to your users (and TBF, you shouldn’t be trusting shared hosting providers anyway).

Thank you for the comments everyone. I wish Digital Ocean has a 1 vCPU/1GB RAM plan with 50GB of storage. Sadly 2GB of RAM is the lowest I can go with 50GB of storage… And because I care so much about security, yeah, I cannot trust shared hosting if people do not keep their CMS up to date or allow any kind of malware into the web server and get my website infected in the process.

Check out the Oracle Free Tier then. You can get 2 AMD Epyc based servers of that spec or up to 4 ARM based VMs with 4 cores, 24GB shared between them. There is 200GB block storage to share between all of your VMs (minimum 50GB per VM.)

I’m not Oracle’s biggest fan by any means but this is quite a good deal for playing around or personal projects - the ARM servers is even enough to spin up a Docker Swarm or K8s cluster (not your need obviously in this instance.)

1 Like