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

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

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


…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 =您有多少个内核等.



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.

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’s (Solid State Drives) configured in a RAID1+0 disk array locally
outperforms 15.5K SAS drives in the same RAID configuration.

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

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 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“;


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.

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.

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

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配置设置 - 代码日志