5 Ways To Optimize Magento Admin Panel for Maximum Speed And Performance

Knowledge Center March 17, 2014 3 Comments
45 Flares 45 Flares ×

Even the most experienced web developers might miss the not-so-obvious settings to increase the speed. Slow admin performance is a terrible thing to have. It makes the backend unbearable and sometimes doing something as simple as saving a single product gives an irritating experience. At such times, many are left scratching their heads as they are completely clueless about the reasons which cause slow performance.

In this blog post, we will tell you five ways through which you can improve the performance of your Magento admin. Please note that it is essential that you take a back-up before you begin working on your Magento website. Nothing is more frustrating than a broken website.

Delete unused extensions

It is best to remove unused extensions rather than just disabling them. If you disable an extension, it will still exist in the database. It would not only increase the size of your database (DB) but it also adds to the reading time for DB. So, keep your approach clear: If you don’t need it, DELETE it.

Keep your store clean by deleting unused and outdated products

“Once a year I will clean my room, just because I feel I should.” —Usain Bolt

One should keep in mind that a clean store is a fast store. We can operationalize the front-end faster by caching and displaying only a limited set of products even if we have more than 10,000 items in the back-end, but we cannot escape their wrath. If the number of products keeps on increasing at the backend, it may get slower, so it is best to remove unused products. Repeat this activity every few months in order to keep the store fast.

Reindexing

One of the basic reasons why website administrators experience slow performance while saving a product is because of reindexing. Whenever you save a product, the Magento backend starts to reindex, and since you have a lot of products, it will take some time to complete. This causes unnecessary delays.

Now, we can’t disable reindexing as it is very important to keep all products aligned but we can always disable auto updates from the admin. Instead, you can schedule reindexing via shell. Magento provides very strong CLI tools, so why not use them.

$ [magento/cli] > php indexer.php reindexall

This can be setup via CRON to run somewhere during the off-peak times, so the load caused by it does not affect the visitors.

Tune up the database

Database tuning plays an important role when it comes to fine-tuning Magento performance. For this, you may require a little bit of expertise. However, it is not that hard either. One can simply use a tuner script. I personally suggest MySQLTuner.pl. You can download it from here.

Once you have downloaded it, you can just execute. It will guide you about the things that you need to do.

Clear the Cache

Cache is very important as far as any web application is concerned, so that  a web server does not have to process same request again and again. By using cache, a fair amount of memory and execution time can be saved. However, this gets a little out of control if you do not properly clean your cache containers. Magento has unique caching techniques which use disk as well as database to keep everything smooth. It is important to prevent the cache folder from getting overloaded.

$ [magento/var] > rm -rf cache/*

Along with cache, there is another folder, i.e. session, which needs to be cleared as well. Just like cache, you need to prevent it from growing too much.

$ [magento/var] > rm -rf session/*

In some cases, sessions are stored in database (DB). So, you need to truncate the core_session table from DB.

Cache tables in the database can also be problematic. So, it is a good idea to keep core_cache_% tables empty. These tables can grow very rapidly. As a  result, the database gets bloated and the performance slows down.

To make it easier, here is the PHP script that can perform these aforementioned actions for you.

 <?php
switch($_GET['clean']) {
case 'log':
clean_log_tables();
break;
case 'var':
clean_var_directory();
break;
}

function clean_log_tables() {
$xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA);

if(is_object($xml)) {
$db['host'] = $xml->global->resources->default_setup->connection->host;
$db['name'] = $xml->global->resources->default_setup->connection->dbname;
$db['user'] = $xml->global->resources->default_setup->connection->username;
$db['pass'] = $xml->global->resources->default_setup->connection->password;
$db['pref'] = $xml->global->resources->db->table_prefix;

$tables = array(
'adminnotification_inbox',
'aw_core_logger',
'dataflow_batch_export',
'dataflow_batch_import',
'log_customer',
'log_quote',
'log_summary',
'log_summary_type',
'log_url',
'log_url_info',
'log_visitor',
'log_visitor_info',
'log_visitor_online',
'index_event',
'report_event',
'report_viewed_product_index',
'report_compared_product_index',
'catalog_compare_item',
'catalogindex_aggregation',
'catalogindex_aggregation_tag',
'catalogindex_aggregation_to_tag'
);

mysql_connect($db['host'], $db['user'], $db['pass']) or die(mysql_error());
mysql_select_db($db['name']) or die(mysql_error());

foreach($tables as $table) {
@mysql_query('TRUNCATE `'.$db['pref'].$table.'`');
}
} else {
exit('Unable to load local.xml file');
}
}

function clean_var_directory() {
$dirs = array(
'downloader/.cache/',
'downloader/pearlib/cache/*',
'downloader/pearlib/download/*',
'var/cache/',
'var/locks/',
'var/log/',
'var/report/',
'var/session/',
'var/tmp/'
);

foreach($dirs as $dir) {
exec('rm -rf '.$dir);
}
}

Save the file in the Magento root directory. Run the following query-based URL (replace domain.com with your Magento domain name) for log clearing: http://www.domain.com/cleanup.php?clean=log

For cache clearing, you should run the query-based URL given below: http://www.domain.com/cleanup.php?clean=var

Magento Is Super Fast On Click&Go

Yes, it is fast. Thanks to our unique combination of Apache+Varnish+Nginx+Memcached, all Magento deployments have blazing fast speeds. So, give it a try by starting your 3-day (no strings attached) free trial when you click on the banner below.

Introducing Cloudways Click&Go 

45 Flares Twitter 17 Facebook 13 Google+ 11 LinkedIn 4 Buffer 0 Reddit 0 StumbleUpon 0 45 Flares ×
 

About Maaz Shah

Maaz Shah works as System Engineer for Cloudways. His days are spent in tackling technical troubles.
Stay Connected: Follow me on Google+ , Linkedin or contact me at syed.maaz(at)cloudways.com

« Previous
Next »
  • Elena Leonova

    Great article. Would be interested to hear your thoughts on Frontend Performance topic.

  • Maaz Shah

    Thanks Elena. I am working on an article on Magento’s Frontend performance, will publish it soon.

  • Henry

    I have read about OpCache, does your server use OpCache, or is Varnish the replacement for this? I read your servers are on DigitalOcean, how will we acces DNS manager etc. Via your hosting srevices, or via digitalocean? Btw, maybe interesting for you article, we had good experience with tigermin catalog manager http://www.emvee-solutions.com/tigermin-tour/