fballiano / docker-magento2

Cluster ready Magento2 + Varnish 7 + PHP 8.1 + Redis 6.2 + Elasticsearch 7.17 + SSL
355 stars 164 forks source link

redis fpc + varnish #9

Closed gaiterjones closed 7 years ago

gaiterjones commented 7 years ago

Just a question really, why do you need a redis fpc cache when you are using varnish, doesn't varnish replace the redis cache?

Your probe file in the container is a txt file created at startup, in your readme you say it is a css file. Also docker-compose scale is deprecated. Use the up command with the --scale flag instead.

This is a great collection of images and I like the idea of the dynamically scaleable apache servers. I think I would control the varnish cache update from the host though and monitor the container health state to build the array of apache servers available. I guess swarm would make this redundant but for scaling containers on the same host it is stilla neat solutiom.

fballiano commented 7 years ago
  1. Every "backend" cache is on redis, i would't store FPC on file (it's a cluster, must be shared) or DB (really a bad idea to me), redis is the perfect place to store the FPC along all other caches, also if varnish serves everything (so it's kinda a copy)
  2. Fixed the probe
  3. AFAIK it's only for docker-compose >=2.2 so I wouldn't change it at the moment, I'll leave the issue open for when I'll have more time to update and test all docker-compose files
  4. I could never test a real swarm but it should work on swarm (new docker is almost always a swarm) without problems (which is the thing that makes sense, scaling on a single host is more a proof-of-concept than a useful thing)

thanks for the notes!

gaiterjones commented 7 years ago

You might be interested in my implementation of the varnish load balancer, I blogged about it here.

http://blog.gaiterjones.com/docker-mono-host-magento-2-service-scaling-and-dynamic-load-balancing-with-varnish/

Inspired by your example my manager container queries docker directly to dynamically update the varnish vcl config.

fballiano commented 7 years ago

interesting but at the moment I really have no time to study/rewrite and test your solution, did you notice any improvement managing it that way?