Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How many static sites on 512MB VPS?
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.

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

  • NeoonNeoon Community Contributor, Veteran
    edited October 2020

    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

  • raindog308raindog308 Administrator, Veteran
    edited October 2020

    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?

    Thanked by 2kkrajk doughnet
  • pkrpkr Member

    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.

    Thanked by 1dustinc
  • NeoonNeoon Community Contributor, Veteran

    @pkr said:
    If you really want cheap badass VPS, you can check offers from RackNerd @dustinc on LEB.

  • dustincdustinc Member, Patron Provider, Top Host

    @pkr said:
    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!

    Thanked by 1TheKiller
  • @TheKiller said:
    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.

    If the sites are truly lightweight, your only limiting factors would be

    • How many combined visitor do you expect at a single time?
    • How much data transfer per visit?
    • Do you have and enough Disk and Data bandwidth?
    Thanked by 2TheKiller yoursunny
  • pkrpkr Member

    @Neoon said:

    @pkr said:
    If you really want cheap badass VPS, you can check offers from RackNerd @dustinc on LEB.

  • Unlimited if you setup a CDN!

  • yoursunnyyoursunny Member, IPv6 Advocate
    edited October 2020

    @sanvit said:
    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

    Netlify is even easier: just drag and drop the folder.

    @raindog308 said:
    You could host a billion sites if no one ever visited them.

    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?

    Thanked by 1raindog308
  • raindog308raindog308 Administrator, Veteran

    @yoursunny said: Assuming each site is 1KB, you need 1TB disk for a billion sites. I've never heard about a 64MB 1TB box.

    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.

  • yoursunnyyoursunny Member, IPv6 Advocate
    edited October 2020

    @raindog308 said:

    @yoursunny said: Assuming each site is 1KB, you need 1TB disk for a billion sites. I've never heard about a 64MB 1TB box.

    What if you served the same content under 1 billion different domains?

    If it's same content, it's one website with a billion domains.

    I wonder how long you can make the nginx server_name parameter...

    If insecure HTTP is acceptable, keep server_name empty and run the website on the IP address directly.

    though you may still need 1KB for SSL certs.

    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.

    Thanked by 1vimalware
  • @TheKiller said:
    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.

    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

  • eva2000eva2000 Veteran
    edited October 2020

    @yoursunny said: 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.

    Put sites behind Cloudflare Flexible SSL and let CF handle HTTPS/SSL certs

    @yoursunny said: Assuming each site is 1KB, you need 1TB disk for a billion sites. I've never heard about a 64MB 1TB box.

    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 :)

    curltest gzip http://localhost
    URI: http://localhost (gzip)
    Uncompressed size : 4.40 KiB
    Compressed size   : 1.81 KiB
    
    curltest br http://localhost    
    URI: http://localhost (br)
    Uncompressed size : 4.40 KiB
    Compressed size   : 1.53 KiB
    

    with Zopfli pre-compression gzip

    pigz -11k index.html
    
    curltest gzip http://localhost
    URI: http://localhost (gzip)
    Uncompressed size : 4.40 KiB
    Compressed size   : 1.79 KiB
    

    with Brotli precompressed

    brotli -9 index.html -o index.html.br
    
    curltest br http://localhost
    URI: http://localhost (br)
    Uncompressed size : 4.40 KiB
    Compressed size   : 1.52 KiB
    
    Thanked by 1yoursunny
  • The best thing is to host static websites on S3 compatible services.
    For some providers it will be free, so...

  • yoursunnyyoursunny Member, IPv6 Advocate

    @eva2000 said:

    @yoursunny said: Assuming each site is 1KB, you need 1TB disk for a billion sites. I've never heard about a 64MB 1TB box.

    Enable nginx gzip_static and just create precompressed gzip or brotli HTML files without uncompressed version. But yeah 1 billion sites is a reach :)

    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.

  • raindog308raindog308 Administrator, Veteran

    @yoursunny said: Having 1 billion files is going to cause problems with filesystems also: inodes and directory entries would take up space.

    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?

  • @raindog308 said:
    I suppose if I can afford the $10bn a year in domain fees, I can probably afford more than a 64MB VPS.

    free IPv6, because IPv4 is too expensive :)

Sign In or Register to comment.