+ Reply to Thread
Results 11 to 20 of 24
Thread: Varnish is my new best friend
-
03-30-2012 07:28 AM #11
It would basically be backwards of what you do now. Setup a varnish server and point your domains to varnish. Set varnish to use apache as the backend (or multiple apache servers depending on how you have that setup). Requests come into varnish and are served statically if they are cached, otherwise varnish calls apache, generates the response, and forwards it to the end user as usual.
In other words, this sits in front of apache where as memcache sits behind apache.
-
04-12-2012 04:35 AM #12Senior Member
- Join Date
- Apr 2011
- Posts
- 845
Would a RAID 10 setup be enough for varnish to be cached on disk instead of RAM? currently have a database that's about 70gb big and I'm using all 16gb of ram to run searches on (It's IIS/SQL Server, trying to apply some of my Prosperent knowledge to a client's setup to speed up load times, especially on searches)
-
04-12-2012 07:16 AM #13
A raid based disk cache would likely be faster than fetching the data from the database, running any operations on it and returning it. At least that's my hunch.
-
04-16-2012 05:53 AM #14Senior Member
- Join Date
- Apr 2011
- Posts
- 845
Just another dumbass question, Varnish caches per site correct? Whereas Memcache will cache the feed based on query parameters. So if site 1 and site 2 queries to see top performing products, one (or both, depending if it's still cached) will receive the cached content from the API, whereas with Varnish, it'll have to cash both pages independently?
I'm thinking of scaling to more than 2 sites (lets say, aim for 100). And would like to squeeze as much processing power/speed out of my current hardware as possible.
-
04-16-2012 07:46 AM #15
Right, varnish caches on a page level where as memcache for the api caches at the api request level. It really depends on what you are doing. If you have a large number of sites, memcache might be more efficient, but without testing it's hard to say
-
04-16-2012 10:35 AM #16Senior Member
- Join Date
- Apr 2011
- Posts
- 845
Think I'll test it, thanks

The only thing that keeps me from using caching is the lack of RAM I have at the moment and my disks are too slow (no SSD unfortunately)
-
04-16-2012 11:00 AM #17
Yeah, an ssd IMO would be ideal for this type of thing. No access penalty just like ram, and still a lot less expensive.
-
04-19-2012 02:13 PM #18Senior Member
- Join Date
- Apr 2011
- Posts
- 845
I was worried about my disk not being fast enough (because if I file-cached the API, it sky rocketed a bit). But I have installed Varnish now and the response time for my homepage went from 1.8s to 0.256s :-0 and my disk wait time wasn't touched!
Just a question though, when I run varnishstat, is it normal for it to start at 1 at the hit ratio part on top?
-
04-19-2012 02:51 PM #19
I believe it starts computing it when you load it. It doesn't store the historical stats.
-
04-19-2012 03:11 PM #20Senior Member
- Join Date
- Apr 2011
- Posts
- 845
Ah okay... still amazed at how fast the response time is now. I'm busy monitoring it and hopefully Pingdom would agree


Reply With Quote