![]() ![]() PHP needs to load the entire string into memory while creating the object, and then the object itself needs to store that data for the lifetime of the request. ![]() $xml = simplexml_load_string($xmlString, $this->_elementClass) $xmlString = $this->_loadCache($this->getCacheId()) When the configuration is loaded from cache #File: lib/Varien/Simplexml/Config.php However, because PHP is a poor environment for serializing objects directly to memory, this means the global configuration is serialized as an XML string. Caching the global configuration saves at least 60 disk reads per request. Disk is always the second thing to bottleneck after database throughput. It’s unavoidable that a modular web system will end up using a cache, as loading every module’s configuration from disk on each page load would quickly fail under load. While this may seem like a trivial amount of data (it fits on a floppy), because of certain implementation details this trivial amount of data can start to create problems under load.įirst off, there’s caching. Each new website created will (presumably) need the same three store views, and suddenly you’re adding between 150KB – 225KB of data to the configuration tree. It uses a store view for english, french, and german versions of the store. ![]() The problem’s even greater when you’re adding new websites to the system. This means each individual node at websites/ has a full copy of every configuration value in the system.Įvery time you create a new store view in Magento, you’re adding anywhere between 50KB – 75KB (depending on the modules you have installed) of data to the full global configuration tree. If you were following along with the previous article, you may have noticed a significant compromise/problem/trade-off in the loading of Magento’s system XML configuration variables. Please Note: The specifics of this article assume a Magento 1.6.1 CE system, although the concepts apply to all versions of Magento. While this article contains useful stand-alone information, you’ll want to read part 1, part 2, and part 3 of the series to fully understand what’s going on. This article is part of a longer series exploring the Magento global configuration object.
0 Comments
Leave a Reply. |