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.
Serving images from 128MB VPS
I want to move images from my main server to separate VPS with 128MB of ram and then access them from subdomain http://img.domain.com. The max size of the images is about 2MB and I assume there will be about 10000 image request/day. The web server used will be nginx or openlitespeed
The question is: Will the 128MB low-end VPS be able to serve this?
Comments
Sure, but there won't be enough RAM to store all the images in cache
Use the Vps and then add cf cache everything option in cf
Nginx or lighttpd is the way to go, you could even add some basic PHP and it will be fine.
Yeah @simonindia's suggestion of cloudflare would work great, that's what I use for my screenshots site - make sure to add a page rule to "cache everything" and a VERY long cache expiration time.
The question you really have to ask is, how many concurrent requests for images do you estimate you'd get.
At 10k images/day, that's only a rate of 1 image request every 8 seconds on average. Even a 64MB VPS should be able to serve that since it'll only take one nginx process to serve it.
If you're getting 10k images/day within a 4 hour period, then you'll have to serve 1 image request per second. Still only one nginx process to serve.
10k images/day within a 2 hour period, you'll have 2 images requests per second. Now you need 2 nginx processes to serve the content, potentially doubling your RAM usage.
...and so on. The more concurrent requests you need to serve, the more the RAM becomes a factor.
Average worker nginx process on a 32-bit Debian install is < 2 MB RAM. So even serving 4 or 5 concurrent requests for simple images (5 processes times 2 MB RAM), a 128MB RAM VPS is more than adequate.
thank you, I don't know the numbers as the there are worldwide visitors. But I assume there will be no more than 3 requests/sec at the same time.
Considering this is LET, it's really nice to still see some folks pushing the limits of their LEBs.
@ckissi, building on what's already been said, go ahead with nginx and ensure that all resources/images are served with caching headers containing a decent validity period.
You may wish to also stress test the box a bit, or even simply use Apache's ab tool to get an idea of how much content can easily be served by the setup. From there, you can try to optimize even further.
As already mentioned, use of CloudFlare would definitely go a long way in assisting.