1

today I dealt with a task to load a module's configuration into running Magento site under heavy load. I copied config.xml file of new module and everything to fix some issue.

Our Magento runs with memcached caching backend.

To have a module running I had to clear cache completly and that had an impack on performance of the site, we had 500 of concurent users . So I'm looking for solution how to deploy changes in of configuration without clearing cache.

Is there any?

Thanks for any thoughts and ideas.

Jaro.

Jaro
  • 3,799
  • 5
  • 31
  • 47

4 Answers4

3

Here is a method of updating the config cache rather than clearing it, thus avoiding race-conditions.

https://gist.github.com/2715268

Kijewski
  • 25,517
  • 12
  • 101
  • 143
ColinM
  • 13,367
  • 3
  • 42
  • 49
  • It looks great! Thank you, I'm going to try it and let you know. – Jaro May 17 '12 at 09:08
  • It saved my life after upgrading to 1.8.0.0 and downgrading to 1.7.0.2 (with Git branches), when Magento cached new resource adapter's name (Magento_Db_Adapter_Pdo_Mysql) and was throwing fatal error in `app\code\core\Mage\Core\Model\Resource.php` in `_newConnection()` on line `$connection = new $className($config);`. Clearing the cache was not helpful. I don't know why it was running that way, but I was driving me mad. After running code from Gist my instance again is running correctly, thanks! – Wirone Sep 30 '13 at 15:08
1

it's probably best practice to put the system in maintenance mode, make sure all admin sessions are logged out, check that everyone's out and then manually delete var/cache/mage--? folders. You then log back in on one admin session, let it run till you see an admin session has started, log back out and then back into Admin to start checking the site for full function of the freshly installed module.

Kijewski
  • 25,517
  • 12
  • 101
  • 143
dieterwulf
  • 11
  • 1
1

You don't have to clear the entire cache to load a module's configuration. You can install the module by using the Flush Magento Cache* option. Eventually you'll need to clear the cache to see your front-end changes if any were made. The best thing to do to minimize performance impact is to clear it during off-peak or low-usage times.

*edited - Thanks Fiasco Labs

seanbreeden
  • 6,104
  • 5
  • 36
  • 45
  • **Flush Cache Storage** is the nuclear option of **Flush Magento Cache** as is explained here... http://stackoverflow.com/questions/5955365/what-is-the-difference-between-flush-magento-cache-and-flush-cache-storage-i Clearing cache only affects Magento, flush cache storage also wipes it for other php applications on the server. So they both flush cache, only one is more thorough. – Fiasco Labs Feb 07 '12 at 22:10
  • I think there has to be another way how to install a module without clearing of whole cache. I would prefere any approach which check all modules and force installation process if necesary. In the end if you're an author then know what it will do :) – Jaro Feb 10 '12 at 13:37
0

You will always have to flush cache when installing a module or changing its configurations. This is necessary to force rereading of configurations, to empty out incompatible opcode and force Magento to re-read application code and templates for the changes you have just made.

Yes, it has a momentary impact on your site's performance, but can cause some really interesting issues if you don't.

I've had situations where using the button in Admin wasn't enough, for module installs, it's probably best practice to put the system in maintenance mode, make sure all admin sessions are logged out, check that everyone's out and then manually delete var/cache/mage--? folders. You then log back in on one admin session, let it run till you see an admin session has started, log back out and then back into Admin to start checking the site for full function of the freshly installed module.

This is of course overkill for simple config changes where a cache flush is sufficient.

More info on clearing the cache in Magento

Fiasco Labs
  • 6,457
  • 3
  • 32
  • 43
  • I would say that's overkill approach :-) – Jaro Feb 10 '12 at 13:35
  • Yes, it is. How do we make a scripted language program fast like a compiled program? We cache stuff instead of creating object files and linking them into an executable. Wayback when, this was tried with interpreted Pascal. You had all these p-code files than needed to be refreshed when the source got changed. Same thing applies to any caching done with PHP. Change junk, gotta refresh cache. The only other way to approach this is to clear specific cache tags and hope you hit what was changed. In the above, possibly just clearing CONFIG would have worked. – Fiasco Labs Feb 12 '12 at 07:53
  • I've tried this limited cache tag deletion, only to have something every so often, get stuck in APC. In the end it was just a whole lot less hassle to clear by direct file deletion as this seems to force APC to completely refresh without missing a beat and saves the customers seeing weird chaotic junk on the frontend, the whole admin disappearing on the backend. The cache rebuilds pretty quickly on a busy site. – Fiasco Labs Feb 12 '12 at 07:56