2016-07-21 6 views
0

Ich habe versucht, Redis für Magento für Leistungssteigerung zu verwenden, aber ich habe Probleme mit Redis in Magneto CE 1.9.2.4.Magento Redis Sitzung Problem: nach ein paar Stunden Website verlangsamt

Meine Website nach einigen Stunden verlangsamt, wenn ich Redis verwende, manchmal kann es etwa eine Minute dauern, um eine Seite zu laden. Seltsam, dass Admin-Zone normal funktioniert.

Ich benutze easyengine Stapel, um Hauptabhängigkeiten zu Server zu installieren: hhvm als PHP-Compiler, Nginx als Webserver, Redis als Cache-Server.

Server OS: Ubuntu 14.04 CPU: 4 x 2,40 GHz RAM: 3072 MB + 384 MB plus + 1536 MB SWAP (mit 3261 MB)

server ram usage

Meine local.xml config:

<config> 
    <global> 
     <install> 
      <date><![CDATA[Wed, 27 Apr 2016 21:17:58 +0000]]></date> 
     </install> 
     <crypt> 
      <key><![CDATA[***********]]></key> 
     </crypt> 
     <disable_local_modules>false</disable_local_modules> 
     <resources> 
      <db> 
       <table_prefix><![CDATA[]]></table_prefix> 
      </db> 
      <default_setup> 
       <connection> 
        <host><![CDATA[localhost]]></host> 
        <username><![CDATA[*********]]></username> 
        <password><![CDATA[*********]]></password> 
        <dbname><![CDATA[*********]]></dbname> 
        <initStatements><![CDATA[SET NAMES utf8]]></initStatements> 
        <model><![CDATA[mysql4]]></model> 
        <type><![CDATA[pdo_mysql]]></type> 
        <pdoType><![CDATA[]]></pdoType> 
        <active>1</active> 
       </connection> 
      </default_setup> 
     </resources> 
     <session_save><![CDATA[db]]></session_save> 

    <!-- redis cache --> 
     <cache> 
      <backend>Cm_Cache_Backend_Redis</backend> 
      <backend_options> 
      <server>127.0.0.1</server>        
      <port>6379</port> 
      <persistent></persistent>         
      <database>0</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>     
      <use_lua>0</use_lua>          
      </backend_options> 
     </cache> 

    <!-- redis session storage --> 
     <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> 
      <first_lifetime>600</first_lifetime>     
      <bot_first_lifetime>60</bot_first_lifetime>   
      <bot_lifetime>7200</bot_lifetime>      
      <disable_locking>0</disable_locking>     
      <min_lifetime>60</min_lifetime>      
      <max_lifetime>2592000</max_lifetime>     
     </redis_session> 
    </global> 

    <admin> 
     <routers> 
      <adminhtml> 
       <args> 
        <frontName><![CDATA[admin]]></frontName> 
       </args> 
      </adminhtml> 
     </routers> 
    </admin> 
</config> 

HHVM php.ini config:

; php options 
session.save_handler = files 
session.save_path = /var/lib/hhvm/sessions 
session.gc_maxlifetime = 1440 

; hhvm specific 
hhvm.log.level = Warning 
hhvm.log.always_log_unhandled_exceptions = true 
hhvm.log.runtime_error_reporting_level = 8191 
hhvm.mysql.typed_results = false 
hhvm.log.header = true 
hhvm.log.natives_stack_trace = true 
hhvm.mysql.socket = /var/run/mysqld/mysqld.sock 
hhvm.pdo_mysql.socket = /var/run/mysqld/mysqld.sock 
hhvm.mysqli.socket = /var/run/mysqld/mysqld.sock 
hhvm.log.header = true 
hhvm.log.natives_stack_trace = true 

mysql config:

[client] 
port  = 3306 
socket  = /var/run/mysqld/mysqld.sock 

[mysqld_safe] 
socket  = /var/run/mysqld/mysqld.sock 
nice  = 0 

[mysqld] 
user  = mysql 
pid-file = /var/run/mysqld/mysqld.pid 
socket  = /var/run/mysqld/mysqld.sock 
port  = 3306 
basedir  = /usr 
datadir  = /var/lib/mysql 
tmpdir  = /tmp 
lc_messages_dir = /usr/share/mysql 
lc_messages = en_US 
skip-external-locking 

max_connections  = 100 
connect_timeout  = 5 
wait_timeout  = 600 
max_allowed_packet = 16M 
thread_cache_size  = 128 
sort_buffer_size = 4M 
bulk_insert_buffer_size = 16M 
tmp_table_size  = 32M 
max_heap_table_size = 32M 

myisam_recover_options = BACKUP 
key_buffer_size  = 128M 
#open-files-limit = 2000 
table_open_cache = 400 
myisam_sort_buffer_size = 512M 
concurrent_insert = 2 
read_buffer_size = 2M 
read_rnd_buffer_size = 1M 

query_cache_limit  = 128K 
query_cache_size  = 64M 

log_warnings  = 2 

slow_query_log_file = /var/log/mysql/mariadb-slow.log 
long_query_time = 10 
log_slow_verbosity = query_plan 

log_bin   = /var/log/mysql/mariadb-bin 
log_bin_index  = /var/log/mysql/mariadb-bin.index 

expire_logs_days = 10 
max_binlog_size   = 100M 

default_storage_engine = InnoDB 

innodb_buffer_pool_size = 256M 
innodb_log_buffer_size = 8M 
innodb_file_per_table = 1 
innodb_open_files = 400 
innodb_io_capacity = 400 
innodb_flush_method = O_DIRECT 

[mysqldump] 
quick 
quote-names 
max_allowed_packet = 16M 

[isamchk] 
key_buffer  = 16M 

!includedir /etc/mysql/conf.d/ 

Antwort

0

Redis Sitzung

SCHRITT 1 Verriegelung:

hinzufügen <disable_locking> zu Ihrem Magento local.xml

<session_save><![CDATA[db]]></session_save> 
<redis_session> 
. 
. 
    <disable_locking>1</disable_locking> 
</redis_session> 

SCHRITT 2:

NB: Ältere Versionen von Cm_RedisSession diese Funktion nicht haben. Um dies herauszufinden, öffnen Sie die App/code/community/Cm/RedisSession/Model/Session.php und suchen Sie nach "disable_locking".

grep disable_locking App/Code/Gemeinschaft/Cm/RedisSession -r App/Code/Gemeinschaft/Cm/RedisSession/Model/Session.php::! (string ("{$ config-> descend ('disable_locking')}}")? (bool) "{$ config-> absteigend ('disable_locking')}}": self :: DEFAULT_DISABLE_LOCKING);

If you see the above, it will work with no further action. This updated code is bundled as of Magento CE 1.9 or EE 1.14. 
If you don’t see that, then the module needs to be updated. 
+0

Hallo Rebin, danke für die Antwort. Darf ich fragen, was genau Sperrung deaktivieren soll? –

Verwandte Themen