colinmollenhour / Cm_Cache_Backend_Redis

A Zend_Cache backend for Redis with full support for tags (works great with Magento)
Other
389 stars 142 forks source link

Snappy compression is not working #130

Closed ghost closed 6 years ago

ghost commented 6 years ago

hi,

I'm using both of your extensions for Magento Session cache and Backend cache, and I'm trying to use snappy compression, which is working fine for the Session cache, but when I configure the Backend Session I'm getting the error like the extension wasn't installed: PHP Fatal error: Call to undefined function snappy_compress() in /data/web/public/lib/Cm/Cache/Backend/Redis.php on line 866

Here's my configuration file:

        <cache> 
            <backend>Cm_Cache_Backend_Redis</backend>
            <backend_options>
                <server>redismaster</server>
                <port>6379</port>
                <persistent />
                <database>0</database>
                <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>snappy</compression_lib>
            </backend_options>
        </cache>
Xon commented 6 years ago

You need the php extension installed

ghost commented 6 years ago

Hello @Xon I’m sorry if I wasn’t so clear. The extension is installed and is working fine with the Cm_RedisSession module. The problem only happens with the backend cache module.

ghost commented 6 years ago

Issue solved after proper PHP extension configuration.

TimQSO commented 4 years ago

@maaxxicarvalho I'm having the same issue. But I'm not sure how to solve it. What extention did you configure?

ghost commented 4 years ago

Hi @GuiltyNL

Actually, the only thing I did was double check the server to see if the extension installation was ok.
Then I had to flush the cache (including Redis) completely.

Below you can find my current configuration (local.xml) which is working fine.

    <global>
        <redis_session>
            <host>redismaster</host>
            <port>6379</port>
            <password/>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>2</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>snappy</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>
        <cache>
            <backend>Cm_Cache_Backend_Redis</backend>
            <backend_options>
                <server>redismaster</server>
                <port>6379</port>
                <persistent/>
                <database>0</database>
                <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>snappy</compression_lib>
            </backend_options>
        </cache>
    </global>
anantajabe05 commented 1 year ago

You need the php extension installed

Can you please tell us which PHP extension needs to be installed?