Alternatives to Lighthttpd with a 256MB NAT?

Usually a topic for LES Forums but since I’m not on there thought I’d ask:
Is there any real alternative to using Lighthttpd on a 256MB RAM NAT Vps to host a website?
Not that I’m not satisfied with Lighthttpd, just wondering what else is out there. Anyone has had experience using Caddy? Would it work out?

I have not used it myself, but I read good things about hiawatha, I think it should be able to run with 256MB ram

1 Like

Cool thanks! Will check it out :wink:

nginx should work fine.

5 Likes

+1.

I have 2 OVZ 128 NATs and both of them have nginx + mysql + phpfpm, but it may be a good idea to add a bit of swap

2 Likes

Looks nice :slight_smile:

If you do use Nginx and you’re on Ubuntu or Debian, install nginx-light rather than nginx-full. It has fewer modules compiled into it and thus uses slightly less memory. Good references for the difference between the flavours: Nginx - Debian Wiki and https://docs.google.com/spreadsheet/ccc?key=0AjuNPnOoex7SdG5fUkhfc3BCSjJQbVVrQTg4UGU2YVE#gid=0

If you use PHP, you’ll likely also want to disable OPCache and APCu if you run into memory limits. No point caching stuff in RAM if you have a very small amount of it :slight_smile:

MySQL on 128 MB RAM?! :astonished: Unless you have very small databases, that’s going to be swapping a lot once you actually try to use it. Would recommend SQLite for low-memory use cases.

3 Likes

It only has a default WP installation. I just playing with the NATs for a while (for $1/y I just had to…), not actually using them in anything

But 256MB is the double of what I had to work with, so he has way more legroom.

1 Like

Never had any problems with nginx on 64/128MB VPS’ for very low traffic php sites (no db), or moderate traffic static sites.

1 Like

Confirmed. Nginx can work super great on low resources, so can PHP. MySQL however is a resource hog, even MariaDB. As long as one can keep things simple, Nginx can run like a russian watch, but without MySQL eating low resources.

1 Like

Any database system is, unless it’s explicitly designed to have a small footprint (like SQLite). Databases are designed to try and use as much RAM as possible without being too greedy, in order to improve performance. For a lowend-like setup, it might be useful to have a small VPS just dedicated to MySQL, and connect from the other VPSes via a private network or VPN.

Also, profile your queries (using EXPLAIN) and make sure they’re not doing anything silly like full table scans on large tables :slight_smile:

3 Likes

Thanks for all the feedback :slight_smile:
I’d very much like to use some kind of database system so maybe go with sqlite and nginx-light then?

MySQL might be fine if the database is small and you tune it a bit, but SQLite is really great for smaller apps. SQLite works quite well for apps with a low amount of concurrency (if you don’t expect many writes to happen at the same time), and avoids you having to run an extra server daemon (it’s embedded directly into your app or programming language runtime).

Where SQLite doesn’t work so well is if you have a lot of writes happening all at the same time. Many apps are read-heavy rather than write-heavy though, and SQLite is fine with lots of read requests at the same time.

2 Likes