magento的NGINX-FPM配置设置 [英] NGINX-FPM configuration settings for magento

查看:84
本文介绍了magento的NGINX-FPM配置设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个用magento开发的电子商务网站.我在服务器上有512mb RAM和2.6 core2duo.当我一次在我的网站上发送50个请求时,除少数请求外,它没有任何响应.我也安装了清漆.我想知道我要为我的网站进行的最佳设置.我已经看到PHP-FPM占用了过多的内存和cpu使用率.

I am running a ecommerce website developed in magento. I have 512mb RAM and 2.6 core2duo on the server. When I send 50 requests at a time on my website it does not respond except for a few requests. I have installed varnish too. I want to know the optimal settings that i want to do for my website. I have seen that PHP-FPM is taking too much memory and cpu usage.

推荐答案

背景

我们在生产计算机(VCenter虚拟机,4核,8 GB内存)的ubuntu 12上使用nginx和php5-fpm.我们的magento安装是主题化和扩展性很强的.前几天我只是为了踢一下而已,将所有内容从头安装在VMWare盒中,并默认安装了Magento 1.12 EE(我需要在bug上对其进行标注).我只是这么说,所以您知道我们已经在生产环境中使用了nginx和php5-fpm.

Background

We use nginx and php5-fpm on ubuntu 12 on our production machine (VCenter Virtual Machine, 4 cores, 8 GB ram). Our magento installation is heavily themed and extended. Just for kicks the other day I installed everything from scratch on a VMWare box with a default installation of Magento 1.12 EE (I needed to call them out on a bug). I just say this so you know that we've got nginx and php5-fpm in a production environment.

您要问的是我认为每个人都在使用nginx和php fpm时遇到的麻烦...从中获得更多性能.我的意思是,如果我们不想使网站性能提高的话,我们可以只使用apache和php?有很多答案,意见和基于案例的解决方案,但我将为您提供我用来配置系统的指南...

What you are asking is something I think everyone struggles with using nginx and php fpm... Squeezing more performance from it. I mean, we could just use apache and php if we weren't trying to get the site performance increase right? There are a lot answers, opinions, and case base solutions, but I'll point you to the guide I used to configure my system...

http://www.if-not-true-then-false.com/2011/nginx-and-php-fpm-configuration-and-optimizing-tips-and-tricks/

来自博客评论:

...但是,问题确实是Magento,而不是配置 服务器. Magento太大而又太重 环境. Magento托管确实是乏味且令人不愉快的任务.

...However, the problem is indeed Magento, rather than the configuration of the server. Magento is just too large and too heavy to any environment. Magento hosting is really tedious and unpleasant task.

它可能不会回答您遇到的每个问题,但是有很多好的事情可以确保您做得到...就像设置worker_processes =您拥有多少个内核等等.

It may not answer every question you have, but there are a lot of good things to make sure you do... Like setting worker_processes = how many cores you have etc.

个人而言,我仍然遇到麻烦的一件事是,如果服务器负载真的过高(每秒超过5-10次命中),处理器就会受到重创.我还没有完全解决这个问题,但是增加一个芯子并撞到撞锤会造成很大的凹痕.我可能会进一步增加ram,但是目前我们的用户群看不到任何网站性能问题.

Personally one thing I still have trouble with is if server load gets really high (more than 5 - 10 hits per seconds) the processors are hammered. I haven't fully nailed down the problem, but adding a core and bumping the ram made a significant dent. I may increase the ram more, but at this time our user base is not seeing any site performance problems.

(从另一个站点博客文章中找到:)

(Found from another site blog post:)

Magento大量使用磁盘子系统 操作.磁盘I/O是仅次于CPU的最大瓶颈 (核心),以达到最佳的Magento性能.

Magento makes heavy use of the disk subsystem for many of its operations. Disk I/O is the biggest bottleneck, next to CPU’s (cores), to optimal Magento performance.

这就是为什么Magento在云环境中表现如此差的原因, 存储位于与无数其他用户共享的SAN上,并且处于压力之下 在随机时间导致性能不一致.

This is why Magento performs so poorly in cloud environments where the storage is on a SAN shared with countless other users and under stress at random times causing inconsistent performance.

SSD(固态驱动器) 在相同的RAID配置中,性能优于15.5K SAS驱动器.

SSD’s (Solid State Drives) configured in a RAID1+0 disk array locally outperforms 15.5K SAS drives in the same RAID configuration.

本地数据库也是Magento达到最佳性能的关键

A local Database is also the key to peak performance with Magento

远程数据库引入了由于系统调用和网络引起的延迟 饱和.如果必须使用远程数据库,则应确保 您在专用VLAN上,并且不共享过多的饱和网络 连接,即使最大的托管服务提供商也很常见. 在最佳的网络环境中,远程数据库将不会像 出于多种原因,它可以像本地数据库一样快.

A remote database introduces latency due system calls and network saturation. If you must use a remote database you should make sure you are on a private VLAN and not sharing an over saturated network connection, which is common for even the largest hosting providers. In the best of network environments, remote database will NOT be as fast as local database for a variety of reasons.

CPU速度和CPU数量对于 最佳的Magento性能.您可以了解 您在以下URL上使用的高端CPU-如果CPU是 此处未列出,基准未将其视为高端" "PassMark软件";

CPU speed and the number of CPU’s is also incredibly important to optimal Magento performance. You can get an idea of the power of the high end CPU that you are using at the following URL - if the CPU is not listed here it is not considered ‘high end‘ by the benchmark "PassMark Software";

http://www.cpubenchmark.net/high_end_cpus.html

基于性能的Web服务器(例如LiteSpeed)利用多个 CPU(核心)与MySQL服务器一样(具有正确的配置). 使用基于性能的Web服务器可以显着改善您的 应用程序相对于Apache Web服务器软件的性能.

Performance based web servers, such as LiteSpeed, make use of multiple CPU’s (cores) as does the MySQL server, with a proper configuration. Using a performance based web server can significantly improve your applications performance against the Apache web server software.

尝试重写或转换/编译Magento不是解决方案-它是 最好是创可贴.您将无法再进行任何升级 (无需花费大量的开发时间来重写和测试 您的更改),每次升级我们都会继续看到速度 改进.绝对不应该对Magento进行核心更改,核心 切勿对Magento进行更改-这会使OOP失败 Magento雇用的模型.

Trying to rewrite or convert/compile Magento is not a solution - it’s a bandaid at best. You will be locked out of any future upgrades (without a significant amount of development time to rewrite and test your changes) and with each upgrade we continue to see speed improvements. Core changes to Magento should NEVER be performed, core changes to Magento should NEVER be performed - this defeats the OOP model that Magento employs.

最后,正如我们之前所说,Magento无法实现最佳 性能,而无需在基础架构上进行大量投资 该应用程序将运行.如果您正在考虑运行Magento 并希望在预算托管服务提供商处这样做, 您根本无法,也不会因此而达到最佳性能 应用.

In the end, as we have said before, Magento can not achieve optimal performance without a significant investment in the infrastructure on which the application runs. If you are considering running Magento and are wanting to do so on a budget hosting provider understand that you simply can not and will not achieve peak performance with this application.

Magento由于其复杂性而需要资源-您不能 在预算托管服务提供商上提供必要的资源,例如 这种硬件系统的成本并不便宜.

Magento requires resources due to it’s complex nature - you can not provide the necessary resources on a budget hosting provider as the costs for this type of hardware system is not inexpensive.

这篇关于magento的NGINX-FPM配置设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆