Script to "safely" clean up the core_session table without causing lock wait timeouts.
Not thoroughly vetted but met the client's needs.
Requires disabling Mage_Core_Model_Resource_Session:gc()
, e.g.
--- a/app/code/core/Mage/Core/Model/Resource/Session.php
+++ b/app/code/core/Mage/Core/Model/Resource/Session.php
@@ -74,7 +74,7 @@ class Mage_Core_Model_Resource_Session implements Zend_Session_SaveHandler_Inter
*
* @var int
*/
- protected $_automaticCleaningFactor = 50;
+ protected $_automaticCleaningFactor = 0;
/**
* Constructor
local codepool override, etc.
Presented as a standalone script for usability but you get bonus points if wrapped in a shell (e.g. php shell/sessionGc.php
).