Speeding up magento backend (now slow)

Admin is slower than frontend for a few reasons:

  • does not make use of too much caching (e.g. no block caching)
  • it will not use the "flat" tables to get product and category data
  • it has a lot of operations with the potential of being slow

Now, it depends what you mean by slow. If you think 1s-5s response time is too slow, there is not much you can do. But if your response time gets into the tens of seconds range, something is wrong.

As others commented, the catalog size is an important factor. The bigger it is, the longer a product save operation will take. This is not because of the product save itself but because of the fact that the indexes need to be updated. A quick way to speed the site is to set the indexers on manual. This will make the save operations reasonably fast, but it has the downside of not showing the changes in the front-end real time (this is the whole point of "on save" indexes). We have setups where we have part of the indexers set on manual (the first suspect being always catalog url rewrite) and a "reindex all" cron scheduled daily. While the site admins would be happier not having to wait ~1 day for some changes to appear on the site, it is a compromise that usually works.

Another, less common reason I have seen to slow down save operations is Enterprise Full Page Cache. Magento will try to smartly remove the cached parts related to the item you change/delete so that changes are visible instantly. This is never an issue with block caching as there cannot be too many cached entries anyway, but the full page cache, caching on url, can try to delete millions of entries at once which will be slow no matter the cache backend. We changed the code to queue the cache delete operation and execute it at cron time.

As a last reason for slow admins, maybe this is just a byproduct of the server being overloaded? While a few cached pages may appear fast, maybe all the others are slow. How is the checkout page? Faster or as slow as admin pages? You should be looking at the server load, it is cheaper and faster to increase hardware capacity than doing code changes if it makes sense.


Remember it's not enough to just use APC as an object of opcode cache. It needs to be configured properly as well to handle what you throw at it. We do performance reviews of environments for clients and many times APC is basically setup with default settings. The defaults simply do not cut it for Magento. With the defaults there is not enough memory allocated to store the codebase let along used as an object cache. You end up with really high miss rates vs a near 0 miss rate. In most cases we have found you need at least 256M allocated to APC.

Here is a sample of what we generally use as a baseline:

extension=apc.so
apc.shm_size=256M
apc.mmap_file_mask=/apc.shm.XXXXXX

apc.include_once_override=0

apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=10000
apc.user_entries_hint=10000

apc.stat=0
apc.enable_cli=1
apc.max_file_size=5M
apc.slam_defense=0

Also you maybe running into scalability problems with the default File cache backend. When using the APC backend it really uses APC+File since APC doesn't support tags which is needed when flushing the cache by type.

Redis may fix the problem for you as it is much better at scaling. But Magento 1.8 also includes an improved File backend that doesn't have the same issues scaling, it's basically a renamed version of Colin Mollenhour's work, https://github.com/colinmollenhour/Cm_Cache_Backend_File. It maybe a better option than Redis if you are on a single server or can not install redis for whatever reason.


The best thing we did to speed up the backend significantly is to install REDIS as a cache handler. It is now also supported in core from Magento 1.8 and up.

Nothing compares ... now it is click click clickerdy click

http://www.magentocommerce.com/knowledge-base/entry/redis-magento-ce-ee

In addition you could consider adding Redis Session extension to also add sessions to the redis memory server ...

The best way to date to speed up backend operations is to use one and or preferably all of the following

  • enable cache in Magento
  • minify css and js
  • enable some kind of php opcode caching
  • enable cache and gzip at server level through htaccess or ngunx
  • enable Redis for cache in Magento (best!)
  • enable redis session management
  • check Out mirasvit asynchronous indexing (products now save in ms)

Good luck!

Tags:

Backend