ActiveEbiz

E-commerce and Responsive Web Design

  • Services
    • Magento Development
    • OpenCart Development
    • osCommerce Development
  • Contact
  • Support
  • News

January 6, 2015

Magento Server Optimization

How to optimize hosting for running Magento?

Basic guide on how to optimize a VPS or dedicated server for running Magento.

Use PHP5.4 or newer.

Example of some php.ini settings:

realpath_cache_size = 32k
realpath_cache_ttl = 7200
max_execution_time = 90
max_input_time = 90
memory_limit = 256M
default_socket_timeout = 90
pdo_mysql.cache_size = 2000
output_buffering = 4096

Use the latest stable MySQL version, or alternatively use Percona or MariaDB.

Percona offer a MySQL configuration wizard , use that to get your initial configuration values for MySQL.

Then install MySQLTuner and use it to monitor and adjust the configuration settings over time.

Add APC (PHP accelerator/OpCode Cache).

Step 1. Install APC and enable it in php.ini.

Example php.ini settings:

apc.enabled=1
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=0
apc.optimization=0
apc.shm_segments=1
apc.enable_cli=1
apc.cache_by_default=1
apc.include_once_override=1

Step 2. Use APC as Magentos fast backend.
In your Magento install in the file ./app/etc/local.xml add the following just before the closing tag.

<cache>
<backend>apc</backend>
<prefix>mystore_</prefix>
</cache>

Optional: Use a Content Delivery Network (CDN) for delivering static files like js, css and images.
Sign Up for a CDN account, for instance at Amazon CloudFront and get your cdn url(s).
These can be added in the Magento admin under System > Configuration > General > Web > Unsecure change the urls for Base Skin URL and Base Media Url and optionally also the JavaScript Url.

Optional: Disable Apache AllowOverrides
This will eliminating directory structure scans for .htaccess files and as such the htaccess will not be used anymore, so you will have to add the wanted rules to the configuration for this virtual host instead.

For optimization of your Magento shop read our Magento Speed Optimization Guide.

Using whats described above should give you a clear improvement in speed, but there are possible further advantages to be had using more advanced optimization as well as adding Nginx, Redis, Memcahed, OPcache, Varnish +++.

Share on FacebookShare on TwitterShare on Linkedin

Article by aebiz / Magento Tips & Tricks Leave a Comment

Do you need professional web services?

Contact us to discuss an idea/project or for a free, no-obligation quote.

Contact Us

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get a Free, No-obligation Quote

Do you want to know what we can do for you and if we fit into your budget?

Get a quote

Search

Latests News

  • Magento 1.x PHP 7.2 Support
  • Magento and GDPR Compliance
  • GDPR Compliance for Ecommerce
  • osCommerce Online Merchant Community Bootstrap Edition Final
  • Running Magento 1.9.x on PHP 7

Ecommerce

  • Magento
  • osCommerce
  • OpenCart

About Us

  • About
  • Partners
  • Client Testimonials

Support

  • Support
  • Contact

Blog

  • News
  • Tips & tricks

© Copyright 2025 ActiveEbiz · All Rights Reserved · All Logos & Trademark Belongs To Their Respective Owners