Reading Time: 2 minutes

Magento runs more data and objects from its database when a customer visits and buys something from the store. Magento core objects, defined within PHP calls and various page blocks, can negatively impact your store’s performance.

If you want to optimize the speed of your Magento e-commerce store, one of the recommended solutions is to configure and use the Magento Memcached support.

What is Memcached?

Memcached is a distributed memory cache that accelerates large-scale web applications with dynamic databases. It reduces the load of database requests on a server and displays data through the cache whenever an external data source requests it.

Configure Magento to use Memcached

To configure your Magento with MemCached, open <your Magento install dir> /app/etc/env.php in a text editor

Identify the following:

'session' =>

    array (

    'save' => 'files',

),

Change it to this:

'session' =>

    array (

      'save' => 'memcached',

      'save_path' => '<memcache ip or host>:<memcache port>'

),

Memcached has optional startup parameters that are beyond the scope of this guide. You can find more information about them in the Memcached documentation, source code, and change logs.

Verify that Memcached works with Magento

To verify that Memcached works with Magento:

    1. Delete the contents of the following directories in the Magento installation directory: rm -rf var / cache / * var / page_cache / * var / session / *
    2. Go to any showcase page.
    3. Log in to Magento admin and go to different pages.If no errors appear, congratulations! memcached works! For optional review, consider memcached storage as detailed in the next step. If errors appear (like an HTTP 500 internal server error), enable developer mode to diagnose the issue. Make sure memcached is running, and configured correctly, and that env.php has no syntax errors
    4. (Optional) Use Telnet to examine memcached storage.

The results are displayed similar to the following:

“STAT elements of the terminal: 3: number 1 elements STAT: 3: age 7714 elements STAT: 3: evicted 0 elements STAT: 3: evicted_nonzero 0 STAT elements: 3: evicted_time 0 STAT elements: 3: outofmemory 0 STAT elements: 3: tail repairs 0

That’s it, folks! Check out our blog for more information.

pattern-lines

Free 30-days trial Hosting magento Fast, Secure and Optimized

Switch to Bhoost with 30 days free and migration included

Free 30-days trial
macbook