New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How many static sites on 512MB VPS?
I saw a thread on LEB hosting 18 static sites on 64MB VPS. That maybe not be possible now considering the resources used by OS alone.
In current scenario, with 512MB VPS, how many static sites can we host?
Nginx only, no PHP and Database. Sites with max 3 HTML pages, 20 visits per site on average.
Comments
https://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/
I already read that, read my post.
Well, your title included everything it needed, so I did not bother reading the body.
Despite a body is required.
Besides, 128MB container runs fine, should result in the same or even better.
512MB you got plenty so.
for me, the biggest limit was the disk size, and not RAM. Just a simple NGINX install worked fine for me. However, if I were you, I'd rather host my static sites on BunnyCDN storage because of the ease of setup, and added redundancy from both having redundant storage (globally synced), and redundant delivery platform
The number of sites isn’t the determining factor.
You could host a billion sites if no one ever visited them.
OTOH, one site may be too mich if it’s high volume.
The question is how many concurrent requests you get, not the number of sites. 20 visits over a day? Over a second?
Wow!! 18 static sites on 64MB VPS. But why?
If you really want cheap badass VPS, you can check offers from RackNerd @dustinc on LEB.
Appreciate the recommendation!
If the sites are truly lightweight, your only limiting factors would be
Unlimited if you setup a CDN!
Netlify is even easier: just drag and drop the folder.
Assuming each site is 1KB, you need 1TB disk for a billion sites. I've never heard about a 64MB 1TB box.
On the other hand, if nobody ever visit a site, does it even exist?
What if you served the same content under 1 billion different domains?
I wonder how long you can make the nginx server_name parameter...though you may still need 1KB for SSL certs.
If it's same content, it's one website with a billion domains.
If insecure HTTP is acceptable, keep server_name empty and run the website on the IP address directly.
If they are subdomains of the same main domain, obtain a wildcard certificate.
Otherwise, you can pack 100 domains into each 2KB certificate, so it's 10 million certificates totaling 20GB storage.
A bigger problem is, NGINX would load all the certificates into RAM during startup and that would not fit in 64MB, so you'll have to rewrite the httpd.
Easy to test yourself. Just write a script to automate creation of all nginx vhosts, their public web roots and the 3x HTML pages and then load test it with h2load/wrk and loader.io
Put sites behind Cloudflare Flexible SSL and let CF handle HTTPS/SSL certs
Enable nginx gzip_static and just create precompressed gzip or brotli (with ngx_brotli and brotli_static) HTML files without uncompressed version. But yeah 1 billion sites is a reach
with Zopfli pre-compression gzip
with Brotli precompressed
The best thing is to host static websites on S3 compatible services.
For some providers it will be free, so...
Having 1 billion files is going to cause problems with filesystems also: inodes and directory entries would take up space. At this scale, it may be better to store the precompressed documents in a LevelDB database, to reduce filesystem overhead.
if all are just static,
simply dump them into netlify/render and get your 20 vists per site served from their global CDN.
I suppose if I can afford the $10bn a year in domain fees, I can probably afford more than a 64MB VPS.
It depends on a lot of factors. You have Disk IO, How clogged will the CPU get from all of the requests? (Too many requests and you can CPU waiting without running out of CPU time depending on core and thread count) and how many requests will you be seeing on the network?
free IPv6, because IPv4 is too expensive