You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all containers should be (as far as possible) single process, but the most important thing is that (if someday we'll be able to deploy this infrastructure in production) we may need a cluster of apache+php containers but a single cron container running.
@@ -92,6 +93,46 @@ rm -rf magento2/var/cache/*
92
93
```
93
94
from now on the var/cache directory should stay empty cause all the caches should be stored in Redis.
94
95
96
+
## Enable Redis for Magento's sessions
97
+
open magento2/app/etc/env.php and replace these lines:
98
+
```php
99
+
'session' => [
100
+
'save' => 'files',
101
+
],
102
+
```
103
+
104
+
with these ones:
105
+
106
+
```php
107
+
'session' => [
108
+
'save' => 'redis',
109
+
'redis' => [
110
+
'host' => 'sessions',
111
+
'port' => '6379',
112
+
'password' => '',
113
+
'timeout' => '2.5',
114
+
'persistent_identifier' => '',
115
+
'database' => '0',
116
+
'compression_threshold' => '2048',
117
+
'compression_library' => 'gzip',
118
+
'log_level' => '3',
119
+
'max_concurrency' => '6',
120
+
'break_after_frontend' => '5',
121
+
'break_after_adminhtml' => '30',
122
+
'first_lifetime' => '600',
123
+
'bot_first_lifetime' => '60',
124
+
'bot_lifetime' => '7200',
125
+
'disable_locking' => '0',
126
+
'min_lifetime' => '60',
127
+
'max_lifetime' => '2592000'
128
+
]
129
+
],
130
+
```
131
+
and delete old Magento's sessions with
132
+
```
133
+
rm -rf magento2/var/session/*
134
+
```
135
+
95
136
## Enable Varnish
96
137
Varnish Full Page Cache should already be enabled out of the box (we startup Varnish with the default VCL file generated by Magento2) but you could anyway go to "stores -> configuration -> advanced -> system -> full page cache" and:
97
138
* select Varnish in the "caching application" combobox
@@ -139,7 +180,6 @@ Please note that your php.ini will be the last parsed thus you can ovverride any
139
180
## TODO
140
181
* migrate to alpine/linuxkit based containers?
141
182
* optimize everything for docker swarm
142
-
* sessions on redis?
143
183
* DB clustering?
144
184
* optional RabbitMQ
145
185
@@ -148,3 +188,5 @@ Please note that your php.ini will be the last parsed thus you can ovverride any
148
188
* migrated to docker-compose syntax 3.7
149
189
* implemented "delegated" consistency for some of volumes for a better performance
150
190
* varnish.vcl was regenerated for Varnish 5 (which was already used since some months)
0 commit comments