Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Only generate the cache once, locking for all other processes while it's being generated

License

Notifications You must be signed in to change notification settings

meanbee/magento-config-cache-lock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configuration Cache Lock

This modification for Magento 1.x prevents multiple processes from generating the configuration cache on cold cache, reducing CPU load on frontend web servers.

Installation

Add the following settings to your local.xml inside the <global> node:

	<global>
		...
		<cache_lock>
			<enable>1</enable> <!-- If cache locking is enabled or not -->
			<server>127.0.0.1</server> <!-- The Redis database IP -->
			<port>6379</port> <!-- The Redis port -->
			<database>0</database> <!-- The Redis Database to use -->
			<password></password> <!-- The password of the Redis server -->
			<timeout>2.5</timeout> <!-- The Redis timeout -->
			<key>cache_lock</key> <!-- The name of lock in the Redis Database -->
			<max_attempts>10</max_attempts> <!-- The maximum amount of times to retry the connection. Defaults to 10. -->
			<retry_time>10000000</retry_time> <!-- The amount of microseconds to wait between checking the cache has generated. Defaults to 10000000 -->
		</cache_lock>
	</global>

Credits

I first heard about this project at Mage Titans 2015 during a talk by Paul Partington, the slides can be found here.

Thanks to ctidigital for their work on this project. You can find the original repository here.

About

Only generate the cache once, locking for all other processes while it's being generated

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%