开发者

Optimizing Drupal via PHP Apache and Mysql optimization

开发者 https://www.devze.com 2023-02-07 17:56 出处:网络
I installed Drupal common from acquia and using it for my college Intranet Website. I configured it on Ubuntu lucid lynx Desktop edition running latest XAMPP. I want to increase the performance of the

I installed Drupal common from acquia and using it for my college Intranet Website. I configured it on Ubuntu lucid lynx Desktop edition running latest XAMPP. I want to increase the performance of the website. My databse server and webserver is on same machine.

Can any one suggest methos to increase the performance on follo开发者_如何学JAVAwing point

  1. What should be the ideal hardware configuration
  2. What parameters should i change in PHP to run it for best performance?
  3. How can I optimize apache and My SQL to get best performance out of both??
  4. are there tweaks in drupal which can make it more faster?
  5. Are there any additional packages for caching etc which can improve the speed??


Also, try Varnish if you're using PressFlow, as suggested by berkes. It helps a lot if you have to serve content for anonymous users.

Varnish can cache in memory all the content that Drupal produces, reducing hits to your web server and database.

Here a good start point for configuring Varnish with Pressflow:

https://wiki.fourkitchens.com/display/PF/Configure+Varnish+for+Pressflow

Google some for more details.

And don't forget about non Drupal related optimization, like reducing the number of http requests, serving web page elements from different domains to reduce browser pipelining, etc. Use YSlow and follow Yahoo's excellent rules. Google for "yahoo Best Practices for Speeding Up Your Web Site" (can't include link due to SO limitation for new users).


  1. Is not specific for Drupal, but for every PHP setup. More general: for each web-app. I advise you to start with O'Reilly's Building Scalable Websites.
  2. See above. For Drupal, note the memory limit; many people just crank it up to rediculous values; after logic: Drupal needs more then 38MB, I'll just give it 250MB, to be safe.
  3. Again, see above. For Drupal, pay extra attention to the amount of queries. If you focus on Slow Queries only, you may miss that single tiny query hammering your DB 100+ times per request.
  4. Lots. My advice is to start looking at pressflow, an optimised Drupal. It has all the tweaks you are looking for built in. And more.
  5. Yes. Many-, but start with memcached. And if you rely on search a lot, consider moving search to SOLR search.

Many more tips for starters can be found at Drupal performance Blog


The question you ask is very broad, so it is hard to give any specifics in answers. A good place to start is drupal's own handbook on performance tuning.

I would also highly recommend the boost module if your site serves largely anonymous users, as this allows requests to not even go to drupal and be served entirely from a static cache.


Drupal's Devel module has a Performance module that will log memory usage and access times to the Reports section of your site.

Use this to determine which pages on your site are slow.

Load xdebug (a PHP extension) and turn on the profiling feature. Make requests to your performance-intensive pages and it will create (very large) dumps of the entire request. Open up the cache file in a program like KCacheGrind or WinCacheGrind and you will be able to see every function call that Drupal made when building the page. From here you can see which parts are slowest and optimize them.

This should get you a good 30-80% improvement in performance if you have a slow site. In my experience, there's usually a few blocks or views that account for a huge part of any performance issues.


Pro Drupal 7 Development has a whole section regarding fine-tuning called "optimizing drupal".
I think you will find it quite interesting. It also discusses hardware architectures which is of your interest.

Regarding the 4th question, you can for a start checkout the boost module and disable modules you are not using. Additionally, for improving page-performance you can enable page caching from Configuration -> Performance. In the same page you can use the aggregate and compress CSS(JS) files into one", in this way you reduce the number of HTTP requests per page and the overall size of the downloaded page. You should also consider if CRON is setup. Not running cron can fill up the db with log , stale cache and other "garbage".

A last suggestion is to convert your db from MyIsam to InnoDB, but I think this requires some investigation because it not always the case that InnoDB is faster. With InnoDb there is less time lost from table locking while MyISAM is faster in table readings.

0

精彩评论

暂无评论...
验证码 换一张
取 消