48

TL; DR - On MageStack we use Varnish, Redis (cache), Redis (sessions) and Eaccelerator/Zend OPCache (depending on PHP version) You've already got most of it understood. The cache backend, session store, opcode cache, full page cached and reverse proxy cache are all completely different. You can use different technologies for all and you can use them ALL ...


11

Flush and refresh: Refreshing means that it cleans up alle the invalidated cache keys. for example: when you save a widget while the cache is active you get a message that the cache is invalid. In this instance you don't need to flush the cache, just refresh it. Flushing means that it throws all the cache away, it will rebuild everything from scratch. CSS/...


8

I Would go for Redis + APC with Varnish on top. 'Why Redis' you ask? Read this excellent SO answer. Redis basically replaces Magento's standard file-based caching system. Since Redis is faster it'll give you some improvement on speed. Varnish actually doesn't have that much to do with the inner workings. It's put on top and caches static content so it ...


5

The problem is not memcached, but a small typo in your code: 'session' => array ( 'save' => 'memcached ⇨’⇦, 'save_path' => 'localhost:11211', ), You used a single quote ' at the beginning of the memcached string and and an acute accent ´ at the end. That's the reason for the PHP parse error.


4

I've seen this quite a lot on New Relic as well. From what I've seen there are a few different causes, I don't have a complete understanding of this issue but it is something I've been looking into recently. Here's my findings. Sessions in Magento, Locking, and New Relic Every controller action in Magento uses the session, whether it needs to or not. The ...


4

As long as you are confident you will have sufficient memory available for both then yes there isn't any reason why you can't run both - they do completely different things. Memcached (note not memcache - memcached is newer and faster option) is key value store - so you are able to store a value to a key you define for later recall, and opcache is an opcode ...


4

persistent=1 This is a boolean expressed as integer (1=true, 0=false). If true, PHP will leave open its connections to Memcached, which removes approximately 10–100 ms of overhead from each page load (mostly depending on network distance and congestion). weight=2 This defines server priority (I think a higher weight means the server is chosen first), ...


4

I'm having the same issue when I upgraded my stack to PHP 7 to do some M2 performance testing. The temporary fix is in the SaveHandler.php file: /vendor/magento/framework/Session/SaveHandler.php Cast the return value for the read function and you'll be good to go. Here's the issue I logged on M2's github page: https://github.com/magento/magento2/issues/...


3

If you know the tags of the pages you can remove only those using $cache = Mage::app()->getCache(); foreach($cache->getTags() as $tag){ if(strpos($tag, 'my_cache_tag')){ $ids = $cache->getIdsMatchingAnyTags(array($tag)); foreach($ids as $id){ $cache->remove($id); } } ...


3

Yes you can do it with one php script with inbuilt function <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* item will be deleted by the server */ memcache_delete($memcache_obj, 'key_to_delete'); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $memcache_obj->...


3

Pankaj, Contrary to popular belief, neither using APC or Memcache as cache/session backends will make a noticeable difference to single-user page load time - unless you had a disk I/O bottleneck to begin with (meaning that the memory backed cache will outperform the slow disk based cache). If you don't have I/O issues, then enabling them won't make a ...


3

No, you just need to configure it in app/etc/local.xml and then check the performance change. Or you can check it by type this command line echo "stats cachedump 15 4" | nc 127.0.0.1 11211 I think you know how to use this kind of command. If it is working well then you should see a lot of data.


2

Here is a working example of Memecached: It looks like yours is a little different. Have you confirmed that memcache is working? btw: REDIS is a much faster option. <cache> <backend>memcached</backend> <slow_backend>database</slow_backend> <memcached> <servers> <server> ...


2

It's always better to put the data you want to cache in Ram memory as is faster than a SSD. RAM is much faster than SSD but volatile, that means if the power is gone then the data is lost. Also Ram is not only faster but the OS uses it in a complete different way. This is just to give an example but a tipycal DRAM has a transfer rate of approximately 2-...


2

Magento uses the memcached php extension to communicate with Memcache, but won't warn you if you don't have it.


2

There is multiple issues for this case. First Magento recommend Memcache for M2, I suppose the same for M1 : http://devdocs.magento.com/guides/v2.0/config-guide/memcache/memcache.html We had experiment this issue with Redis and we change session_save to db. The second, is located here : Mage_Core_Model_Resource_Session::gc. Randomly Magento clean session. ...


1

Check https://github.com/magento/magento2/issues/5319. This may resolve your issue.


1

exec or shell_exec should be able to help you in this. So you could set up a php script like this: <?php shell_exec(nc -U /var/tmp/path_to_cache.sock); As long as this can not be put into a Magento custom module you should place that script at least in a sub directory and set up some .htaccess protection. Making a custom module giving the backend user ...


1

Check if you have the memcached extension installed and enabled for the php version that you're using. Also if it is correctly configured in the php.ini file (it could be looking in the wrong directory). $ php -m | grep memcached


1

It looks like these patches tackle this session handler issue in PHP 7 core: https://github.com/php/php-src/blob/PHP-7.0/NEWS#L46


1

Hi this is a php / memcached bug related: https://bugs.php.net/bug.php?id=71187 Work around: class MemcachedSession extends SessionHandler { public function read($session_id) { return (string)parent::read($session_id); } } $sess = new MemcachedSession(); session_set_save_handler($sess, true); session_start(); $_SESSION['...


1

The Magento Compilation is a feature that allows you to compile all Magento installation files in order to create a single include path. This feature is designed to improve the performance of your online store and is supposed to give between 25% and 50% increase in your page load speed. Note that before making any changes to your Magento Installation files, ...


1

If you have access via SSH, try doing telnet localhost 11211 stats and you should see some stats about the service.


1

I think you miss the 'cache' tag <session_save><![CDATA[memcache]]></session_save> <session_save_path><![CDATA[tcp://localhost:11213?persistent=0&amp;weight=2&amp;timeout=10&amp;retry_interval=10]]></session_save_path> <cache> <backend><![CDATA[memcached]]></backend> <...


1

i know now that it won't work as described. due to the way magento uses the cache it must be one coherent/consistent cache. why: magento uses the cache for keeping states (like config_global_lock) magento calls remove on the cache after it detects a miss, right before it stores, this could lead to ping-pong of invalidations between nodes i am now ...


1

Memcached over TCP/IP is always going to be slower, especially over a network, but it's a tradeoff between performance and scalability (Alan Kent made a recent quick blog post about this actually). I found an article comparing the speeds of various caches, although somewhat old, it's quite an interesting read - essentially the findings relevant to you is ...


1

This is not an answer but a push in the right direction. Take a look at the method Mage_Core_Model_Config_Options::getVarDir() public function getVarDir() { //$dir = $this->getDataSetDefault('var_dir', $this->getBaseDir().DS.'var'); $dir = isset($this->_data['var_dir']) ? $this->_data['var_dir'] : $this->_data['base_dir'] . DS ...


1

Pages became really static That's the purpose of a cache. Load on the server and CPU consumption is exactly the same That's because you tried a quick fix of installing a cache rather than addressing the actual issue. Fix whatever is actually the performance bottleneck on your store. Ie. Profile your code, review the server and application stats and ...


1

As you're not using a file based caching mechanism, Magento has no need to store files within the /var/cache/ folder - these are stored in Memcached and Database given you're configuration. If the solution previously gave you output in the /var/cache/ folder, then it's likely the configuration was cached from the previous set up.


Only top voted, non community-wiki answers of a minimum length are eligible