This post is a follow-up to “Process to Optimize Magento under AWS”, to explain more details of enhancing the diamond search in JewelsBoutique.com, via summary table.
Posts Tagged ‘performance’
Magento performance optimization: build our own “summary table” for diamond search
Monday, July 26th, 2010Process to Optimize Magento under AWS
Friday, March 26th, 2010As we have been using AWS for nearly 2 years to run JewelsBoutique.com, I’ve summarized a general process to optimize Magento under AWS (or other cloud-based LAMP stack) as below:
1. Capacity planning, be clear about how many items will be loaded into the system as well as the expected traffic volume (rough) in a certain period, this can help you choose the proper hardware resource (EC instance for AWS) at the beginning.
2. Apply commonly used ways to each separate component/sub-system of your system, e.g:
> Apache/Web Server: compile/configure the right mode & module, set proper parameters such as MaxClients, process threads, enable compressing module and set a never-expire header for static files if possible
> MySQL: set proper cache size, buffer and FS mode; apply the high-performance patch provided by Percona
> PHP: compile all needed extensions to be static, use at least one OP cache extension (eAccelerator/APC/xCache/ZO) and set the right parameters (caching mode, compressing level, etc.), set proper memory limitation
> OS: tune the FS/network related parameters, shutdown all unnecessary backend services (e.g. cups, portmap, etc.)
3. Once all of these are in place, let’s dig something more with Magento’s native support:
> Enable cache for all
> Configure backend cache type to be memory based (either shm FS or OP cache’s shm function)
> Use memory FS or database to save sessions
> Enable flat category/catalog, use Magento compiler if possible
> Use separate host (even a lighter web server on same server, but different port) to serve static files (/media/*, /skin/*)
4. Now, the system should be performing reasonably well, I believe the site should be OK to launch! Actually, my post was written at that point after we finished all items listed above - step by step - we experimented using different approaches to bring better browsing experience to those who shop for diamonds and engagement ring mountings on Jewelsboutique.com.
The next step will be much more interesting… also more challenging: monitor and detect the ‘performance optimizable area’ proactively, that could be either the slowest area of the system, or the place frequently called which could be bottleneck as traffic grows, here is a list that we have done/are doing based on our experience:
- Use separate server for database, web app and static files if needed
- Optimize Magento indexing strategy (we cannot easily upgrade to Magento 1.4, so need do something by ourselves with 1.3…)
- Build our own ’summary table’ for diamond search. As we have ~40,000 items, I can not imagine how slow Magento would be if using its own schema (even using flat-catalog)
There might be more specific cases when we were building JB, but that’s all what I remember and summarize at this point, I think we can go deeper for some specific problem if you guys have specifics you can share.
At last, I can share you the main stages that we have experienced since we started to run JB on AWS:
- Starting point - EC2 + S3: one small instance to host everything, write a script to backup data from EC2 to S3 everyday
- Soon after AWS brought out EBS, we moved to use EBS, all our ‘variable data’ (htdocs/database/logs) were stored on EBS, and we started to scale out — allocated more instances to run database and web server separately
- As backend/infrastructure-level performance are not big concern to us, we started to focus more on front-end/UX area, that what we are doing now — to improve our page look and feel, optimize the page structure to bring the web user convenient and useful information when shopping for diamonds and jewelry.
Angus
Performance Blitz
Thursday, September 17th, 2009- page load time from browser (seconds)
- page processing time at backend (milliseconds)
- resource utilization (memory, cpu, network, disk)
Each of these metrics were measured at the beginning of the project to establish baseline values. Next the team worked to identify, diagnose, and fix areas of our site that contributed to less than desirable performance.
The JewelsBoutique.com Production Environment
The JewelsBoutique.com online store manages more than 40,000 individual online luxury items including diamonds, pave engagement ring mountings, necklaces, earrings, and bracelets. Our goal is to never make our customers wait longer than 2 seconds for pages from our site.
The production environment is deployed and managed via cloud computing, using a small instance (1.7GB memory) Elastic Compute Cloud (EC2) from Amazon. Data storage is managed via Amazon Elastic Block Service (EBS); EBS provides highly available, highly reliable storage volumes for EC2.
We noticed that disk reads/writes were sometimes quite slow. So, we made a couple of changes to improve EBS I/O:
- Reduce contention by creating separate disks for reads and writes
- Added eAccelerator cache to both reduce PHP disk I/O and boost run-time performance
Our Web Server
Next we found that our Apache configuration included several modules that JewelsBoutique.com does not use. We removed the unused modules and recompiled Apache and mod_php statically to not only reduce memory consumption, but to also improve both startup and execution time performance.
The Database
As is often the case, database bottlenecks creep in and affect web site performance. We found that some simple tuning of our MySQL database yielded significant performance gains. We adjusted our MySQL configuration based on several tips from the Tuning Primer. We also adjusted MySQL innodb_flush_log_at_trx_commit to balance the I/O ratio.
Don’t Forget the Network
Page load time is dictated by the time required to download and present all page content. To boost download performance, we added a sub-domain for skin and media files which permits the browser to download content, media files, and skins in parallel. We also used gzip to reduce size of certain “large” pages (in some cases page size was reduced to ~40% of original) which in turn lowers network load.
Finish Line
The effort and changes described above have been implemented. We compared the original baseline values against the current values and here are the results:
- average page load time is now less than 2 seconds; baseline value was more than 6 seconds
- page processing time is now around 400ms; baseline value was 635ms
- resource utilization is down more than 50% from baseline levels
We are quite happy that all gains from this “Performance Blitz” were achieved without adding or upgrading hardware! In the future, when we do add computing resources, we can be confident that will be used efficiently.
Site performance and uptime monitoring
Monday, August 31st, 2009JewelsBoutique.com has recently added third party site performance and uptime monitoring. The service checks specific JewelsBoutique pages for both accessibility as well as page load time from multiple locations in the US.
Online shoppers expect sites to be responsive and have quick page load times. Quick and accurate searches for diamonds and pave engagement rings on our site is critical to customer satisfaction and the success of our business.
The monitoring is being handled by ServiceUptime.com and the site performance data is publicly available via the JewelsBoutique.com About Us page.
Our goal is to provide you with quality diamonds, pave engagement ring mountings, and an exceptional shopping experience. We do this with our team of special designers, expert gemologists, skilled jewelers, and thoughtfully designed web site. Explore JewelsBoutique.com and give our concierge service a try, we are here to exceed your expectations!


