我在带有4 GB内存的新服务器上安装Drupal 7。我想在如何正确配置它的情况下，给出一些提示，给mysql提供多少内存，以及给PHP多少内存。我发现的一件事是，在Zend服务器上运行Drupal 7比在正常的Apache服务器上运行它的速度快三倍。 （我认为它与Opcode缓存有关。我注意到Devel模块它使用的三分之一的内存。
I'm installing Drupal 7 on a new server with 4 GB of memory. I'd like to get some hints on how to configure it properly, how much memory to give to MySQL, and how much memory to give to PHP. One thing I found out is that running Drupal 7 on Zend server is three times faster than running it on a normal Apache server. (I think it has to do with opcode caching. I noticed with devel module it uses one-third of the memory.
Can you share your configurations with me?
If you already have Drupal7 Data, you should load it into a staging environment and perform some buffer sizing based on the amount of data you have.
Step 1) You must first compute the buffer sizes for your dataset.
Step 2) If the recommended sizes exceed 75% of your installed RAM (in you case 3GB) then cap the needed buffers at 3GB.
Step 3) If you have InnoDB data and you did not enable innodb_file_per_table, you need to cleanup InnoDB by segmenting each table into its own physical tablespace (this only needs to be done once).
Once you have done this, you should plan to perform this configuration audit (Steps 1 and 2) every 6 months to make sure you have the proper MySQL caching in place.
Interestingly, I addressed a question similar to this and answered it on April 15th, 2011.
Some things to look at:
An article to read:
Rackspace's: Deploying Drupal in the cloud with nginx and boost should give you lots of ideas.
Small quote on opcode caching:
We use APC as an opcode cache. This saves the server from recompiling the PHP code on every page load. Moreover, the whole thing fits easily in RAM (we typically give APC 128MB of RAM). This drastically decreases the CPU usage. Logged in users can now browse the site much faster. But we can still only handle a limited number of them. We can do a bit better. Instead of querying MySQL every time we go to the cache, we can store these tables in memory. Here come memcached and the cacherouter module.
I started out with my_huge conf from the mysql directory; I also added Varnish cache to the mix. As you already found out, Zend improves performance lots.
After running for a few days, I ran the mysqltuner script and acted on some of the recommendations, mainly about the temp-table cache.
Depending on the size of the site you may want to look at memcached as well. This will compete for resources with mysql but can reduce the load on it.