Share
Embed
Magento doen affeceren - PHPWVL14
Slides for my Magento performance talk at PHPWVL14. My first ever talk deliverd in my local dialect "West-Vlaams". Will make an English version soon.
Thijs Feryn PRO
April 08, 2014
Transcript
110 slides
-
Eerste pogingen ✓Dikke machinen derachter zetten ✓Vele heheuhen en zwoare
CPU’s ✓Loadbalancing ip de webservers ✓Master/master op de MySQL’s ✓Hoge memory limit ✓APC byte code caching -
Eerste Magento kennisse ✓Caching activeren in ’t admin panel ✓Flat
catalogs ✓De Magento compiler ✓JS & CSS minification -
Eerste concluuzjes ✓Gelik verwacht vele RAM en CPU verbruuk ✓Verdacht
vele I/O ✓Meha vele belastienge ip de MySQL -
./mage-‐-‐c ./mage-‐-‐a ./mage-‐-‐4 ./mage-‐-‐7 ./mage-‐-‐e
./mage-‐-‐5 ./mage-‐-‐b ./mage-‐-‐9 ./mage-‐-‐0 ./mage-‐-‐f ./mage-‐-‐3 ./mage-‐-‐6 ./mage-‐-‐8 ./mage-‐-‐d ./mage-‐-‐1 -
./mage-‐-‐8/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_STORE_BE_EN_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_STORE_LU_EN_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_NL_NL_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_LU_EN_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_LU_FR_CONFIG_CACHE
./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_FR_EN_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_STORE_LU_FR_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_BE_FR_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_STORE_ADMIN_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_STORE_BE_FR_CONFIG_CACHE ./mage-‐-‐8/mage-‐-‐-‐MAGE_DB_PDO_MYSQL_DDL_sales_flat_shipment_grid_3 ./mage-‐-‐d/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_APP_E4D52B98688947405EDE639E947EE03D ./mage-‐-‐d/mage-‐-‐-‐MAGE_APP_B1FB6E8F13287C01E5C05063633DDA4C ./mage-‐-‐d/mage-‐-‐-‐MAGE_DB_PDO_MYSQL_DDL_log_url_info_1 ./mage-‐-‐d/mage-‐-‐-‐MAGE_APP_E4D52B98688947405EDE639E947EE03D ./mage-‐-‐d/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_APP_B1FB6E8F13287C01E5C05063633DDA4C ./mage-‐-‐d/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_DB_PDO_MYSQL_DDL_log_url_info_1 ./mage-‐-‐1/mage-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_currencysymbol_ ./mage-‐-‐1/mage-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_nametocurrency_ ./mage-‐-‐1/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_currencynumber_ ./mage-‐-‐1/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_currencysymbol_ ./mage-‐-‐1/mage-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_currencynumber_ ./mage-‐-‐1/mage-‐-‐-‐internal-‐metadatas-‐-‐-‐MAGE_Zend_LocaleC_nl_NL_nametocurrency_ -
In app/etc/local.xml <global> <cache>
<backend>apc</backend> <prefix>MAGE_</prefix> </cache> </global> -
<global> <cache> <memcached>
<servers> <server> <host><![CDATA[127.0.0.1]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> </servers> </memcached> </cache> </global> In app/etc/local.xml Meerdere servers meuglik -
2-level cache ✓Een rappe backend (den adapter) ✓Een trage backend
(standoard file) -
19280 33686 1.3 0.4 322052 110408 ? S 14:07
0:01 /usr/local/php-‐5.4/bin/php-‐cgi 18834 33696 0.0 0.0 267780 13608 ? S 14:07 0:00 /usr/local/php-‐5.4/bin/php-‐cgi 19280 33698 0.9 0.4 321808 110948 ? S 14:07 0:01 /usr/local/php-‐5.4/bin/php-‐cgi 19057 33700 0.0 0.0 268124 13416 ? S 14:07 0:00 /usr/local/php-‐5.4/bin/php-‐cgi 18767 33710 0.0 0.0 269728 14156 ? S 14:08 0:00 /usr/local/php-‐5.4/bin/php-‐cgi Losse processen zoender gedeelde cache -
root 26067 0.0 0.0 342892 6248 ? S 13:43 0:00
php-‐fpm: master process (/etc/ php5/fpm/php-‐fpm.conf) www-‐data 26068 0.2 1.1 396952 94684 ? S 13:43 0:03 php-‐fpm: pool www www-‐data 26069 0.0 0.6 363472 56456 ? S 13:43 0:01 php-‐fpm: pool www www-‐data 26087 0.0 0.6 362708 50188 ? S 13:44 0:00 php-‐fpm: pool www Master proces dat de caches bieoet -
zend_extension=/usr/lib/php5/20100525/opcache.so opcache.validate_timestamps = off opcache.memory_consumption = 128
opcache.max_accelerated_files = 20000 Agressieve tuninge -
% time seconds usecs/call
calls errors syscall -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 53.78 0.012718 13 953 3 stat 34.15 0.008076 2 3369 215 access 6.03 0.001426 2 785 flock 3.40 0.000803 0 3283 read 2.19 0.000519 0 1210 open 0.30 0.000071 0 986 write 0.10 0.000024 0 24254 time 0.05 0.000012 0 1582 fstat 0.00 0.000000 0 1212 close 0.00 0.000000 0 2011 2011 lstat 0.00 0.000000 0 976 poll 0.00 0.000000 0 1305 lseek 0.00 0.000000 0 1 mmap 0.00 0.000000 0 1 munmap 0.00 0.000000 0 84 brk 0.00 0.000000 0 1 rt_sigaction 0.00 0.000000 0 1 rt_sigprocmask 0.00 0.000000 0 1 pwrite 0.00 0.000000 0 4 setitimer 0.00 0.000000 0 1 socket 0.00 0.000000 0 1 1 connect 0.00 0.000000 0 1 accept 0.00 0.000000 0 1 recvfrom 0.00 0.000000 0 2 shutdown 0.00 0.000000 0 5 setsockopt 0.00 0.000000 0 8 fcntl 0.00 0.000000 0 2 getdents 0.00 0.000000 0 5 getcwd 0.00 0.000000 0 2 chdir 0.00 0.000000 0 217 217 readlink 0.00 0.000000 0 3 umask -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 100.00 0.023649 42267 2447 total Vele lstats Zonder opcache -
% time seconds usecs/call
calls errors syscall -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 100.00 0.000007 0 3109 read 0.00 0.000000 0 971 write 0.00 0.000000 0 1182 open 0.00 0.000000 0 1184 close 0.00 0.000000 0 463 2 stat 0.00 0.000000 0 1548 fstat 0.00 0.000000 0 960 poll 0.00 0.000000 0 1271 lseek 0.00 0.000000 0 64 brk 0.00 0.000000 0 1 rt_sigaction 0.00 0.000000 0 1 rt_sigprocmask 0.00 0.000000 0 1 pwrite 0.00 0.000000 0 3385 377 access 0.00 0.000000 0 3 setitimer 0.00 0.000000 0 1 socket 0.00 0.000000 0 1 connect 0.00 0.000000 0 1 accept 0.00 0.000000 0 1 shutdown 0.00 0.000000 0 4 1 setsockopt 0.00 0.000000 0 8 fcntl 0.00 0.000000 0 781 flock 0.00 0.000000 0 2 getdents 0.00 0.000000 0 3 getcwd 0.00 0.000000 0 2 chdir 0.00 0.000000 0 3 umask 0.00 0.000000 0 2 times 0.00 0.000000 0 2195 time -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 100.00 0.000007 17147 380 total Geen lstats Met opcache -
query_cache_limit
= 5M query_cache_size = 64M join_buffer_size = 32M innodb_buffer_pool_size = 1024M innodb_additional_mem_pool_size = 50M key_buffer_size = 64M sort_buffer_size = 5M read_buffer_size = 5M read_rnd_buffer_size = 10M MySQL meer heheuhen geevn -
<global> <resources> <default_setup>
<connection> <host><![CDATA[Master-‐host]]></host> <username><![CDATA[user]]></username> <password><![CDATA[pass]]></password> <dbname><![CDATA[magentodb]]></dbname> <active>1</active> </connection> </default_setup> <default_read> <connection> <use/> <host><![CDATA[Slave-‐host]]></host> <username><![CDATA[user]]></username> <password><![CDATA[pass]]></password> <dbname><![CDATA[magento]]></dbname> <type>pdo_mysql</type> <model>mysql4</model> <initStatements>SET NAMES utf8</initStatements> <active>1</active> </connection> </default_read> </resources> </global> R/W splittinge -
is ZALIG! ✓Standoard ingebouwde replicoasje ✓Spesjale datatiep’n (hash, list, …)
✓De meuglikeid voe te saven ip disk ✓Session clustering ✓Cm_Cache_Backend_Redis standoard vanaf Magento 1.8 CE en 1.13 EE ✓Geen 2-level cache ✓Meerdere databases ✓Authenticoasje -
In app/etc/local.xml <global> <cache>
<backend>Cm_Cache_Backend_Redis</backend> <backend_options> <server>127.0.0.1</server> <port>6379</port> <persistent></persistent> <database>1</database> <password></password> <force_standalone>0</force_standalone> <connect_retries>1</connect_retries> <read_timeout>10</read_timeout> <automatic_cleaning_factor>0</automatic_cleaning_factor> <compress_data>1</compress_data> <compress_tags>1</compress_tags> <compress_threshold>20480</compress_threshold> <compression_lib>gzip</compression_lib> </backend_options> </cache> </global> -
In app/etc/modules/Cm_RedisSession.xml <config> <modules>
<Cm_RedisSession> <active>true</active> <codePool>community</codePool> </Cm_RedisSession> </modules> </config> -
In app/etc/local.xml <global> <session_save>db</session_save> <redis_session>
<host>127.0.0.1</host> <port>6379</port> <password></password> <timeout>2.5</timeout> <persistent></persistent> <db>1</db> <compression_threshold>2048</compression_threshold> <compression_lib>gzip</compression_lib> <log_level>1</log_level> <max_concurrency>6</max_concurrency> <break_after_frontend>5</break_after_frontend> <break_after_adminhtml>30</break_after_adminhtml> <bot_lifetime>7200</bot_lifetime> </redis_session> </global> -
Varnish ✓Werkt juuste in de cataloog en de CMS pagina’s
✓Werkt dus nie bie de checkout ✓Oj sessiedata gebruukt in de cataloog goat ’t ook niet marcheren ✓Is ook ideal voor statische bestand’n ✓Gin SSL onderseunienge ✓De beste maniere voe full page caching te doen -
Turpentine ✓Community module voe Varnish in Magento ✓ESI of AJAX
voe session data ✓Configureerboar in den admin ✓VCL wordt geduwd van Turpentine no Varnish via den Telnet interface ✓Doet de nodige purginge ✓SSL terminoasje via Nginx of Pound -
In app/etc/local.xml <global> <fpc>
<lifetime>86400</lifetime> <debug>false</debug> <backend>Cm_Cache_Backend_Redis</backend> <backend_options> <server>127.0.0.1</server> <port>6379</port> <persistent>cache-‐fpc</persistent> <database>1</database> <password></password> <force_standalone>1</force_standalone> <connect_retries>1</connect_retries> <lifetimelimit>86400</lifetimelimit> <read_timeout>10</read_timeout> <compress_data>1</compress_data> <compress_tags>1</compress_tags> <compress_data>gzip</compress_data> </backend_options> </fpc> </global> Werkt ook met andere backends -
ALTER TABLE `log_customer` ENGINE=BLACKHOLE; ALTER TABLE `log_quote` ENGINE=BLACKHOLE;
ALTER TABLE `log_summary` ENGINE=BLACKHOLE; ALTER TABLE `log_summary_type` ENGINE=BLACKHOLE; ALTER TABLE `log_url` ENGINE=BLACKHOLE; ALTER TABLE `log_url_info` ENGINE=BLACKHOLE; ALTER TABLE `log_visitor` ENGINE=BLACKHOLE; ALTER TABLE `log_visitor_info` ENGINE=BLACKHOLE; ALTER TABLE `log_visitor_online` ENGINE=BLACKHOLE; -
Loadbalanced ElasticSearch Redis Loadbalanced MySQL MySQL Loadbalanced frontend Nginx Nginx
Loadbalanced Varnish Varnish Loadbalanced backend Nginx Nginx Client Admin PHP-FPM PHP-FPM PHP-FPM PHP-FPM SSL endpoint ElasticSearch -
In app/etc/local.xml <global> <cache>
<backend>Cm_Cache_Backend_Redis</backend> <backend_options> <servers> <server> <server>127.0.0.1</server> <port>6379</port> <persistent></persistent> <database>1</database> <password></password> </server> <server> <server>127.0.0.1</server> <port>6380</port> <persistent></persistent> <database>1</database> <password></password> </server> </servers> </backend_options> </cache> </global> Client-‐side hash distribution -
public function hash($key) {
$needle = hexdec(substr(md5($key),0,7)); $server = $min = 0; $max = count($this-‐>nodes) -‐ 1; while ($max >= $min) { $position = (int) (($min + $max) / 2); $server = $this-‐>nodes[$position]; if ($needle < $server) { $max = $position -‐ 1; } else if ($needle > $server) { $min = $position + 1; } else { break; } } return $this-‐>ring[$server]; } } -
In app/etc/local.xml <global> <cache>
<backend>Cm_Cache_Backend_Redis</backend> <backend_options> <servers> <server> <server>127.0.0.1</server> <port>6379</port> <persistent></persistent> <database>1</database> <password></password> <master>true</master> </server> <server> <server>127.0.0.1</server> <port>6380</port> <persistent></persistent> <database>1</database> <password></password> </server> </servers> <read_on_master>true</read_on_master> </backend_options> </cache> </global> Master/slave -
Sentinel ✓Discovery service voe Redis servers ✓Deel van de Redis
core ✓Monitoring, notification & autofailover ✓Wit wuk dat de masters & slaves zien ✓Vorkomt zevers ot de master no de wup is ✓Vorkomt zevers ot de master werekeert ✓Eest met Sentinel verbiend’n, toene mo met Redis -
port 26379 sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-‐after-‐milliseconds mymaster 5000 sentinel parallel-‐syncs mymaster 2 daemonize yes dir ./ pidfile redis-‐master.pid port 6379 daemonize yes dir ./ pidfile redis-‐slave.pid port 6380 slaveof 127.0.0.1 6379 daemonize yes dir ./ pidfile redis-‐slave2.pid port 6381 slaveof 127.0.0.1 6379 Sentinel master/slave config redis-‐server redis-‐master.conf redis-‐server redis-‐slave.conf redis-‐server redis-‐slave2.conf redis-‐sentinel redis-‐sentinel.conf -
[74129] 08 Apr 15:54:35.443 * Max number of open files
set to 10032 _._ _.-‐``__ ''-‐._ _.-‐`` `. `_. ''-‐._ Redis 2.8.7 (00000000/0) 64 bit .-‐`` .-‐```. ```\/ _.,_ ''-‐._ ( ' , .-‐` | `, ) Running in stand alone mode |`-‐._`-‐...-‐` __...-‐.``-‐._|'` _.-‐'| Port: 6379 | `-‐._ `._ / _.-‐' | PID: 74129 `-‐._ `-‐._ `-‐./ _.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | http://redis.io `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' `-‐._ `-‐.__.-‐' _.-‐' `-‐._ _.-‐' `-‐.__.-‐' ! [74129] 08 Apr 15:54:35.445 # Server started, Redis version 2.8.7 [74129] 08 Apr 15:54:35.445 * The server is now ready to accept connections on port 6379 [74129] 08 Apr 15:54:53.105 * Slave asks for synchronization [74129] 08 Apr 15:54:53.105 * Full resync requested by slave. [74129] 08 Apr 15:54:53.105 * Starting BGSAVE for SYNC [74129] 08 Apr 15:54:53.106 * Background saving started by pid 74188 [74188] 08 Apr 15:54:53.107 * DB saved on disk [74129] 08 Apr 15:54:53.184 * Background saving terminated with success [74129] 08 Apr 15:54:53.184 * Synchronization with slave succeeded [74129] 08 Apr 15:55:08.601 * Slave asks for synchronization [74129] 08 Apr 15:55:08.601 * Full resync requested by slave. [74129] 08 Apr 15:55:08.601 * Starting BGSAVE for SYNC [74129] 08 Apr 15:55:08.602 * Background saving started by pid 74268 [74268] 08 Apr 15:55:08.604 * DB saved on disk [74129] 08 Apr 15:55:08.609 * Background saving terminated with success [74129] 08 Apr 15:55:08.609 * Synchronization with slave succeeded Master -
[74187] 08 Apr 15:54:52.102 * Max number of open files
set to 10032 _._ _.-‐``__ ''-‐._ _.-‐`` `. `_. ''-‐._ Redis 2.8.7 (00000000/0) 64 bit .-‐`` .-‐```. ```\/ _.,_ ''-‐._ ( ' , .-‐` | `, ) Running in stand alone mode |`-‐._`-‐...-‐` __...-‐.``-‐._|'` _.-‐'| Port: 6381 | `-‐._ `._ / _.-‐' | PID: 74187 `-‐._ `-‐._ `-‐./ _.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | http://redis.io `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' `-‐._ `-‐.__.-‐' _.-‐' `-‐._ _.-‐' `-‐.__.-‐' ! [74187] 08 Apr 15:54:52.105 # Server started, Redis version 2.8.7 [74187] 08 Apr 15:54:52.105 * The server is now ready to accept connections on port 6381 [74187] 08 Apr 15:54:53.104 * Connecting to MASTER 127.0.0.1:6379 [74187] 08 Apr 15:54:53.104 * MASTER <-‐> SLAVE sync started [74187] 08 Apr 15:54:53.105 * Non blocking connect for SYNC fired the event. [74187] 08 Apr 15:54:53.105 * Master replied to PING, replication can continue... [74187] 08 Apr 15:54:53.105 * Partial resynchronization not possible (no cached master) [74187] 08 Apr 15:54:53.106 * Full resync from master: 021fe0141871282912fee4951b40ed4579916bd0:1 [74187] 08 Apr 15:54:53.184 * MASTER <-‐> SLAVE sync: receiving 18 bytes from master [74187] 08 Apr 15:54:53.185 * MASTER <-‐> SLAVE sync: Flushing old data [74187] 08 Apr 15:54:53.185 * MASTER <-‐> SLAVE sync: Loading DB in memory [74187] 08 Apr 15:54:53.185 * MASTER <-‐> SLAVE sync: Finished with success Slave -
[74267] 08 Apr 15:55:08.596 * Max number of open files
set to 10032 _._ _.-‐``__ ''-‐._ _.-‐`` `. `_. ''-‐._ Redis 2.8.7 (00000000/0) 64 bit .-‐`` .-‐```. ```\/ _.,_ ''-‐._ ( ' , .-‐` | `, ) Running in stand alone mode |`-‐._`-‐...-‐` __...-‐.``-‐._|'` _.-‐'| Port: 6382 | `-‐._ `._ / _.-‐' | PID: 74267 `-‐._ `-‐._ `-‐./ _.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | http://redis.io `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' `-‐._ `-‐.__.-‐' _.-‐' `-‐._ _.-‐' `-‐.__.-‐' ! [74267] 08 Apr 15:55:08.598 # Server started, Redis version 2.8.7 [74267] 08 Apr 15:55:08.598 * DB loaded from disk: 0.000 seconds [74267] 08 Apr 15:55:08.598 * The server is now ready to accept connections on port 6382 [74267] 08 Apr 15:55:08.600 * Connecting to MASTER 127.0.0.1:6379 [74267] 08 Apr 15:55:08.600 * MASTER <-‐> SLAVE sync started [74267] 08 Apr 15:55:08.600 * Non blocking connect for SYNC fired the event. [74267] 08 Apr 15:55:08.601 * Master replied to PING, replication can continue... [74267] 08 Apr 15:55:08.601 * Partial resynchronization not possible (no cached master) [74267] 08 Apr 15:55:08.602 * Full resync from master: 021fe0141871282912fee4951b40ed4579916bd0:29 [74267] 08 Apr 15:55:08.609 * MASTER <-‐> SLAVE sync: receiving 18 bytes from master [74267] 08 Apr 15:55:08.609 * MASTER <-‐> SLAVE sync: Flushing old data [74267] 08 Apr 15:55:08.609 * MASTER <-‐> SLAVE sync: Loading DB in memory [74267] 08 Apr 15:55:08.610 * MASTER <-‐> SLAVE sync: Finished with success Slave 2 -
[74338] 08 Apr 15:55:26.293 * Max number of open files
set to 10032 _._ _.-‐``__ ''-‐._ _.-‐`` `. `_. ''-‐._ Redis 2.8.7 (00000000/0) 64 bit .-‐`` .-‐```. ```\/ _.,_ ''-‐._ ( ' , .-‐` | `, ) Running in sentinel mode |`-‐._`-‐...-‐` __...-‐.``-‐._|'` _.-‐'| Port: 26379 | `-‐._ `._ / _.-‐' | PID: 74338 `-‐._ `-‐._ `-‐./ _.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | http://redis.io `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' |`-‐._`-‐._ `-‐.__.-‐' _.-‐'_.-‐'| | `-‐._`-‐._ _.-‐'_.-‐' | `-‐._ `-‐._`-‐.__.-‐'_.-‐' _.-‐' `-‐._ `-‐.__.-‐' _.-‐' `-‐._ _.-‐' `-‐.__.-‐' ! [74338] 08 Apr 15:55:26.299 # Sentinel runid is 984143fbdaeaa2b724ebe9ae6d85b3ae2f11cfce [74338] 08 Apr 15:55:26.299 # +monitor master mymaster 127.0.0.1 6379 quorum 1 [74338] 08 Apr 15:55:27.296 * +slave slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:55:27.296 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6379 Sentinel -
[74338] 08 Apr 15:57:39.042 # +sdown master mymaster 127.0.0.1 6379
[74338] 08 Apr 15:57:39.042 # +odown master mymaster 127.0.0.1 6379 #quorum 1/1 [74338] 08 Apr 15:57:39.042 # +new-‐epoch 1 [74338] 08 Apr 15:57:39.042 # +try-‐failover master mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:39.042 # +vote-‐for-‐leader 984143fbdaeaa2b724ebe9ae6d85b3ae2f11cfce 1 [74338] 08 Apr 15:57:39.042 # +elected-‐leader master mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:39.042 # +failover-‐state-‐select-‐slave master mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:39.145 # +selected-‐slave slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:39.145 * +failover-‐state-‐send-‐slaveof-‐noone slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:39.204 * +failover-‐state-‐wait-‐promotion slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:40.052 # +promoted-‐slave slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:40.052 # +failover-‐state-‐reconf-‐slaves master mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:40.116 * +slave-‐reconf-‐sent slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:41.065 * +slave-‐reconf-‐inprog slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:41.065 * +slave-‐reconf-‐done slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:41.128 # +failover-‐end master mymaster 127.0.0.1 6379 [74338] 08 Apr 15:57:41.128 # +switch-‐master mymaster 127.0.0.1 6379 127.0.0.1 6381 [74338] 08 Apr 15:57:41.128 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381 [74338] 08 Apr 15:57:41.129 * +slave slave 127.0.0.1:6379 127.0.0.1 6379 @ mymaster 127.0.0.1 6381 [74338] 08 Apr 15:57:46.174 # +sdown slave 127.0.0.1:6379 127.0.0.1 6379 @ mymaster 127.0.0.1 6381 De master is met z’n hoar -
[74187] 08 Apr 15:57:38.297 * Connecting to MASTER 127.0.0.1:6379
[74187] 08 Apr 15:57:38.298 * MASTER <-‐> SLAVE sync started [74187] 08 Apr 15:57:38.298 # Error condition on socket for SYNC: Connection refused [74187] 08 Apr 15:57:39.204 * Discarding previously cached master state. [74187] 08 Apr 15:57:39.204 * MASTER MODE enabled (user request) [74187] 08 Apr 15:57:39.206 # CONFIG REWRITE executed with success. [74187] 08 Apr 15:57:40.685 * Slave asks for synchronization [74187] 08 Apr 15:57:40.685 * Full resync requested by slave. [74187] 08 Apr 15:57:40.685 * Starting BGSAVE for SYNC [74187] 08 Apr 15:57:40.685 * Background saving started by pid 74356 [74356] 08 Apr 15:57:40.687 * DB saved on disk [74187] 08 Apr 15:57:40.718 * Background saving terminated with success [74187] 08 Apr 15:57:40.718 * Synchronization with slave succeeded De slave wordt master -
[74267] 08 Apr 15:57:39.679 * Connecting to MASTER 127.0.0.1:6379
[74267] 08 Apr 15:57:39.679 * MASTER <-‐> SLAVE sync started [74267] 08 Apr 15:57:39.679 # Error condition on socket for SYNC: Connection refused [74267] 08 Apr 15:57:40.116 * Discarding previously cached master state. [74267] 08 Apr 15:57:40.117 * SLAVE OF 127.0.0.1:6381 enabled (user request) [74267] 08 Apr 15:57:40.118 # CONFIG REWRITE executed with success. [74267] 08 Apr 15:57:40.684 * Connecting to MASTER 127.0.0.1:6381 [74267] 08 Apr 15:57:40.684 * MASTER <-‐> SLAVE sync started [74267] 08 Apr 15:57:40.684 * Non blocking connect for SYNC fired the event. [74267] 08 Apr 15:57:40.684 * Master replied to PING, replication can continue... [74267] 08 Apr 15:57:40.685 * Partial resynchronization not possible (no cached master) [74267] 08 Apr 15:57:40.685 * Full resync from master: 13f081057c3b4c0bb148e53f2097b8c2e8d8dfbb:1 [74267] 08 Apr 15:57:40.718 * MASTER <-‐> SLAVE sync: receiving 18 bytes from master [74267] 08 Apr 15:57:40.718 * MASTER <-‐> SLAVE sync: Flushing old data [74267] 08 Apr 15:57:40.718 * MASTER <-‐> SLAVE sync: Loading DB in memory [74267] 08 Apr 15:57:40.719 * MASTER <-‐> SLAVE sync: Finished with success Den anderen slave moet herconnecteren -
[74359] 08 Apr 16:01:49.806 # Server started, Redis version 2.8.7
[74359] 08 Apr 16:01:49.806 * DB loaded from disk: 0.000 seconds [74359] 08 Apr 16:01:49.806 * The server is now ready to accept connections on port 6379 [74359] 08 Apr 16:01:59.877 * SLAVE OF 127.0.0.1:6381 enabled (user request) [74359] 08 Apr 16:01:59.877 # CONFIG REWRITE executed with success. [74359] 08 Apr 16:01:59.888 * Connecting to MASTER 127.0.0.1:6381 [74359] 08 Apr 16:01:59.889 * MASTER <-‐> SLAVE sync started [74359] 08 Apr 16:01:59.889 * Non blocking connect for SYNC fired the event. [74359] 08 Apr 16:01:59.889 * Master replied to PING, replication can continue... [74359] 08 Apr 16:01:59.890 * Partial resynchronization not possible (no cached master) [74359] 08 Apr 16:01:59.890 * Full resync from master: 13f081057c3b4c0bb148e53f2097b8c2e8d8dfbb:17013 [74359] 08 Apr 16:01:59.985 * MASTER <-‐> SLAVE sync: receiving 18 bytes from master [74359] 08 Apr 16:01:59.985 * MASTER <-‐> SLAVE sync: Flushing old data [74359] 08 Apr 16:01:59.985 * MASTER <-‐> SLAVE sync: Loading DB in memory [74359] 08 Apr 16:01:59.986 * MASTER <-‐> SLAVE sync: Finished with success De master is doar were en is geen master meer -
In app/etc/local.xml <global> <cache>
<backend>Cm_Cache_Backend_Redis</backend> <backend_options> <servers> <server> <server>127.0.0.1</server> <port>26379</port> </server> <server> <server>127.0.0.1</server> <port>26380</port> </server> </servers> <sentinel>true</sentinel> <select_random_slave>true</select_random_slave> <read_on_master>true</read_on_master> <master_name>mymaster</master_name> </backend_options> </cache> </global> Sentinel -
<global> <cache>
<backend>Zend_Cache_Backend_Apc</backend> <prefix>MAGE_</prefix> </cache> </global> <global> <cache> <backend>apc</backend> <prefix>MAGE_</prefix> </cache> </global> 2-level cache deruut aaln