`
chinacode
  • 浏览: 28429 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
阅读更多

前言:
Magento 是一个开源电子商务系统,尤其以扩展性高著称,但是很高的扩展性往往是牺牲了速度为代价的,虽然现在magento为速度提升做了很多工作,但是还是没能 达到人们对速度的要求。既然如此还是有很多企业选择了它,速度问题还是让很多客户无法接受,最近忙碌于magento性能优化。
同时速度也上了几个台阶,据本人目测最少快了(7-8倍)。

参考了合同前辈的经验总结了如下几点:
1) Magento Caching. Magento 自身cache
Goto Magento Admin -> System -> Cache Management
- Tick the following items:
– Configuration
– Layouts
– Block HTML output
– Translations

2) MySQL Cache Size 设置
query_cache_size=128M
innodb_buffer_pool_size=64M
innodb_additional_mem_pool=16M

4) Enabling Gzipping 启用gzip压缩
.htaccess
php_flag zlib.output_compression on
AddHandler application/x-httpd-php5 .css

修改 .htaccess mod_deflate 配置
本人配置如下:

# Insert filter on all content
SetOutputFilter DEFLATE
# Insert filter on selected content types only
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

5) Install Fooman Speedster 安装该插件

6) Install APC or Xcache 安装apc机器码缓存

<cache>
<backend>apc</backend>
<prefix>alphanumeric</prefix>
</cache>
添加到 app/etc/local.xml <global></global> 之间.

7) 设置apache 开启 KeepAlive

KeepAlive = On

LoadModule deflate_module     modules/mod_deflate.so #开启mod_deflate

参考地址:

http://www.magentocommerce.com/wiki/groups/168/optimising_your_web_stack_performance_for_magento

http://www.magentocommerce.com/boards/viewthread/36225/

出处: 马丁博客http://www.blags.org/

本文链接地址: http://www.blags.org/magento-performance-optimization/

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics