Posted by jpstrikesback on February 11, 2010 at 2:56pm
Just wondering about the usage of Mercury / Pressflow+Varnish with things like Ubercart?
The benchmarks on http://www.missionbicycle.com/ included ubercart & panels but I wonder if it's recommended to run production ubercart on Mercury, and what the caveats are if known.
I've noticed on my test server that Block Caching (or something) seems to have weird side effects on the cart block (which I think makes sense since session is stored in a cookie) but then again isn't varnish meant to ignore anything with a cookie?
Cheers,
JP
Comments
you need to setup session
you need to setup session caching in varnish. look in the high performance groups, there is anywhere an article with some configs about varnish and sessions.
Hi, can you link to it? It's
Hi, can you link to it?
It's not this one is it?
http://groups.drupal.org/node/47734
It should work
You shouldn't have any problems running Ubercart on Mercury. Varnish is a whole-page caching system, and functions at a level above the block cache or anything else. It works by handling repeat requests for the same page without even asking Drupal. That's what makes it so fast. Varnish will serve a request if it has the page cached, the page's "max age" hasn't expired, and the requesting user doesn't have a PHP Session cookie set.
The only thing to be aware of is that once anonymous users put items into their cart, they will get a $_SESSION, which sets the PHP session cookie, and they will stop getting cached pages from Varnish. This is by design though. As soon as they become a potential customer, we can't very well serve them a stale page. ;)
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
Good Lord!
I sorted out my session cookie issue by getting rid of the cart block & sorting a few little things and it's now screaming for all cache-able pages!
ab -n 10000 -c 200 http://ec2-compute-x.amazonaws.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking ec2-compute-x.amazonaws.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache/2.2.11
Server Hostname: ec2-compute-x.amazonaws.com
Server Port: 80
Document Path: /
Document Length: 14864 bytes
Concurrency Level: 200
Time taken for tests: 4.405 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 154236750 bytes
HTML transferred: 149329920 bytes
Requests per second: 2270.25 [#/sec] (mean)
Time per request: 88.096 [ms] (mean)
Time per request: 0.440 [ms] (mean, across all concurrent requests)
Transfer rate: 34194.95 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 19 10.8 16 106
Processing: 20 67 36.2 54 332
Waiting: 7 26 27.2 18 245
Total: 32 86 37.3 75 349
Percentage of the requests served within a certain time (ms)
50% 75
66% 87
75% 96
80% 103
90% 120
95% 154
98% 246
99% 251
100% 349 (longest request)
Welcome to mercury-landia :)
Welcome to mercury-landia :)
Kyle Mathews
Feels good, yah?
Feel the power! :)
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
link varnish ans session
link varnish ans session caching an example
http://groups.drupal.org/node/47734#comment-125008
hope this helps
caching with cart block
ok so the above solution was great but I still wanted the Ubercart Cart Block, without adding the ajax cart cause I dunno if it works with a host of other ajax stuff happening in my carts...and i didn't want to change everything
The issue is that the cart block initiates a session before there's anything in the cart, while checking for cart contents it calls the uc_cart_get_id() which sets session if it's not there...in my mind this doesn't make sense in the context of seeing what's in an existing cart...
along with mkalkbrenner's patch in #47 to get the cart block playing nice with pressflow: http://drupal.org/node/377798#comment-2581898
here's what I did: http://drupal.org/node/377798#comment-2637798
maybe this will help someone...or if you see a glaring error...let me know :)