简体   繁体   English

Magento表现问题

[英]Magento performance question

I have an installation of 1.3.2.4 running two Store Views and 2,734 products. 我安装了1.3.2.4运行两个商店视图和2,734个产品。 The site sees around 15,000 visits a month. 该网站每月访问量约为15,000次。

Apache and MySQL (mostly Apache) hovers at around 1.5 GB RAM usage most of the time and peaks over 3 GB. Apache和MySQL(主要是Apache)在大多数时间内占用大约1.5 GB RAM,并且峰值超过3 GB。 My questions is, considering the stats, is this normal? 我的问题是,考虑到统计数据,这是正常的吗? Seems like a lot. 好像很多。

If that memory usage is in fact abnormal, would an upgrade to 1.4.1.1 help? 如果内存使用情况实际上是异常的,升级到1.4.1.1会有帮助吗?

If you consider your stores, then you are doing just fine. 如果你考虑你的商店,那你就做得很好。 But regarding the traffic you're getting, it seems that you need to provide some extra features to Magento to let it fire up. 但是对于你所获得的流量,似乎你需要为Magento提供一些额外的功能才能启动它。 For this, you can have some of the following:- 为此,您可以拥有以下某些功能: -

  • Install APC (Alternative PHP Cache) or XCache (or any other alternative) and configure the use of it in your Magento back-end. 安装APC(备用PHP缓存)XCache (或任何其他替代方案)并在Magento后端配置它的使用。 It dramatically increases the speed of Magento. 它大大提高了Magento的速度。
  • You can have Magento's cache stored in memory (tmpfs in Linux). 您可以将Magento的缓存存储在内存中(Linux中的tmpfs)。
  • You can also tell Magento to save sessions into Memcache so that your sessions are in memory & distributed. 您还可以告诉Magento将会话保存到Memcache中,以便您的会话在内存中并分发。
  • Check your Magento's Index Management section for any requirement of indexes, every month or bi-monthly. 检查您的Magento指数管理部分是否有任何索引要求,每月或每两个月。 If you do find any indexing required, then do it immediately & clear the cache from your Cache Management. 如果确实找到了所需的索引,请立即执行此操作并从缓存管理中清除缓存。
  • Check your database every week or bi-monthly for any overhead in any of your database's tables. 每周检查一次数据库,或每两个月检查一次数据库表中的任何开销。 If you do find any overhead, then "optimize" those tables immediately. 如果确实发现任何开销,则立即“优化”这些表。

Try reading some of these articles , to know more about these. 尝试阅读一些这些 文章 ,更多地了解这些。

Also, upgrading to 1.4.1.1 will help you out in terms of features provided by Magento. 此外,升级到1.4.1.1将帮助您了解Magento提供的功能。 But for performance, I think it will be best to wait for some more time, until Magento releases its version 2 in the market, in which some performance issues may be taken care of by Magento. 但是为了性能,我认为最好等待一段时间,直到Magento在市场上发布第2版,其中Magento可能会解决一些性能问题。

Hope it helps. 希望能帮助到你。

1.3.2.4 is a good stable release, upgrading to 1.4.0.1 is very painless and will give you the added benefit of split index management and much faster administration area (mass attribute update is fixed). 1.3.2.4是一个很好的稳定版本,升级到1.4.0.1是非常轻松的,它将为您提供拆分索引管理和更快的管理区域(质量属性更新是固定的)的额外好处。

Don't be overly concerned about memory usage, depending on the number of Apache modules you have loaded, you should expect to see about 30MB per child. 不要过分担心内存使用情况,根据您加载的Apache模块的数量,您应该会看到每个孩子大约30MB。 As long as your not swapping or encroaching your limits, you shouldn't have any real concerns over how much is being consumed. 只要你没有交换或侵犯你的限制,你就不应该对消耗多少有任何真正的担忧。 Disabling unused modules will help cut down memory - but to be honest, not by any noticeable margin. 禁用未使用的模块将有助于减少内存 - 但说实话,并没有任何显着的余量。

You could always throw Nginx in front as a reverse proxy to serve static content requests and pipe PHP/dynamic reqs. 您总是可以将Nginx作为反向代理放在前面,以提供静态内容请求和管道PHP /动态请求。 back to Apache. 回到Apache。 That way you can keep the modular Apache build with .htaccess support and cut down your memory overheads significantly. 这样,您可以使用.htaccess支持保持模块化Apache构建,并显着降低内存开销。

However, this could do with more information, such as the output from 但是,这可以用更多信息来做,例如输出

free -m 免费-m

To see how some of the memory is being allocated. 要了解如何分配一些内存。

I'd probably suggest downloading tuning-primer.sh to run on your MySQL config. 我可能建议下载tuning-primer.sh来运行你的MySQL配置。 It will give a good (entry-level) indication of how efficient your memory allocation is. 它将为您的内存分配效率提供良好的(入门级)指示。

Those stats look quite typical for Magento, if you consider a single hit/page load can use upwards of 64MB RAM. 对于Magento来说,这些统计数据看起来非常典型,如果您认为单次点击/页面加载可以使用超过64MB RAM。

Your Apache settings can also drastically effect the amount of RAM your system uses. 您的Apache设置也会极大地影响系统使用的RAM量。 Upgrading your Magento installation may give some small performance boost, but don't expect it to do much for memory consumption etc. 升级Magento安装可能会带来一些小的性能提升,但不要指望它会对内存消耗等做很多事情。

If your memory consumption is a real issue for you then you have several possible routes to reduce resource usage, such as: 如果您的内存消耗对您来说是一个真正的问题,那么您有几种可能的路由来减少资源使用,例如:

  1. Install Nginx as a reverse caching proxy to apache (apache is a hog and is poor serving static content). 安装Nginx作为apache的反向缓存代理(apache是​​一种生猪,服务静态内容很差)。

  2. Use Nginx + PHP Fast CGI and remove apache 使用Nginx + PHP Fast CGI并删除apache

  3. Try using worker MPM module for apache, or Fast CGI. 尝试使用worker MPM模块进行apache或Fast CGI。

  4. Install caching proxy such as Varnish/Squid. 安装缓存代理,如Varnish / Squid。

  5. If you are stuck with apache you can tweek KeepAlive and other settings to allow you to reduce memory usage 如果您遇到apache,可以调整KeepAlive和其他设置以减少内存使用量

  6. Tweek MySQL settings, such as query caching to imporove resource usage / performance Tweek MySQL设置,例如查询缓存,以提高资源使用/性能

I have found 1. to work very well in reducing cpu/memory usage as it will allow Nginx to serve static images etc without requiring apache to hog RAM trying to serve them. 我发现1.在减少CPU /内存使用方面工作得非常好,因为它可以让Nginx提供静态图像等,而不需要apache来占用RAM来尝试服务它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM