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.
LE Varnish?
I'm used to use, on my vpses, squid in reverse proxy mode. I decided to give a try to Varnish, but I don't understand how I can limit it's ram usage.
I'm trying to run it on a 64mb vps (squeeze 32bit) and I'd like to limit it's ram usage to 16mb.
I tried with "-l " but I continue to get OOM when I run it (as it allocate 80mb of ram, seems to me):
[8356445.308026] OOM killed process 9593 (varnishd) vm:85904kB, rss:76652kB, swap:0kB
Anyone know how to reduce Varnish memory usage?
Comments
Why would you....
Try this option:
-s malloc,16MB
Edit /etc/default/varnish
to whatever value you want. Set it as ~13MB if you want to use only 16MB.
At least that how I remember it back then
Go NGINX :-P
Normally you wouldn't run Varnish on something as small as a 64MB VPS... like trying to run memcachd or PHP + APC on something that size, it simply isn't feasible, your best bet is for high performance with low ram is to go with nginx primarily for static caching.
Essentially even if you could limit it to fit within a 64MB VPS, it's usefulness wouldn't be worth much, unless your website is merely a dozen or so static HTML pages (in which case a simple nginx setup would have worked).
At least that how I remember it back then
I already did that. I also tried with file cache instead of memory cache. But still it tries to allocate 80mb.
I use PHP + APC on that vps (very few dynamic pages and a lot of static contents), and squid as reverse proxy. And it works quite good.
I don't use nginx (and don't want to) and also I'd like to try Varnish.
PHP + APC can be very happy on 64MB.
Now add Apache, MySQL and Varnish...
That is not the point, nor would I want to.
I miss the point.
Did I wrote that I want to install a lamp stack + Varnish on a 64mb vps?
I simply stated that I use PHP + APC + Squid + Cherokee on my 64mb vps and I'd like to try Varnish instead of Squid.
The question was "how to limit Varnish memory usage?", rather than "nginx vs varnish on 64mb vps".
Thank you anyways, however.
It's quite the point if the OP is trying to make Varnish work on a 64MB VPS along side PHP+APC, Apache and Possibly MySQL
Sorry, no.
I didn't wrote that I used Apache (!nginx != apache) nor that I want to use MySQL.
I think it's more a question of why would you want to run Varnish with only 16MB available to it? Doesn't seem like you'd get much more benefit over just straight Cherokee with that limitation.
You try editing the varnish config file itself?
@Steve81 If you are using Debian, you're most likely using an old version of Varnish that does not support malloc restrictions. I believe it will silently ignore the size specification. Compiling Varnish from hand from the latest stable version, should do the trick.
But that's not what you originally said:
I disagreed with the bit about PHP + APC not being feasible on 64MB. That's it.
The OP made no mention of Apache, MySQL, memcache... or PHP for that matter.
You introduced all that...
Various reasons. One could be that Cherokee is vulnerable to slowloris, while squid or varnish aren't.
Or that a static file readed from ram cache is better that a static file readed from disk.
I already tried editing relevant sections.
Thank you.
I use Squeeze, so Varnish 2.1.3; I'll try compiling the new version.
Edit: However I got the same problem with -s file