2

Right now I am using Magento 1.7.0.2 with Redis Session Storage. I am looking forward to adding additional frontend server behind a load balancer. Can I use the same Redis server for sessions for both frontend servers?

Idea:

Server1 = Apache + PHP + Redis
Server2 = Apache + PHP + Database

Varnish listens for connections and uses Server1 or Server2 to handle misses and esi stuff

Thanks!

2

You can provided you are using Redis over TCP and not via a local socket.

0

You can use the conlinmollenhour extension for redis session in magento (if you have magento 1.8 and up this is included) Point both session configuration in app/etc/local.xml to the same redis server and same db (make sure the parameter in the redis configuration are the same)

for server 1

<config>
    <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>0</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>
    ... </config>

for server2

<config>
    <global>
        ...
        <session_save>db</session_save>
        <redis_session>
            <host>internal ip of server 1</host>
            <port>6379</port>
            <password></password>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>0</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>
    ... </config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.