Think Floyd
Think Floyd

Reputation: 359

Tips on speeding up Drupal site

We just implemented a drupal site. Performance of the site seems to be an issue. We enabled drupal caching, set up apache caching derivates. Repeated page visits are fast enough (coz CSS and JS are cached), but initial page visits are still a problem.

Drupal experts, could you offer us some pointers, on different techniques used to speed up drupal sites. (like DOs and DONOTs). Are there any other low hanging fruits?

(BTW, DB is not a problem here. That layer is fast enough. Problem seems to be in PHP/Drupal layer)

Upvotes: 7

Views: 4583

Answers (8)

JTHouseCat
JTHouseCat

Reputation: 445

I found some ways to speed up Drupal. I was using Godaddy which is slower than an already slow system but it helped me uncover some issues. Also, I was using Commerce Kickstart which is even slower than Drupal 7.

Drupal is a bit slow so making these things as fast as possible is a necessity.

  1. You need a fast database connection (no slow network database connections).

  2. There are some configuration settings you can modify in php.ini/.user.ini. (see link below)

  3. If Drupal is hosted at a hosting company you need to choose the hosting company with the fastest possible response time.(see link below)

  4. Enable Drupal caching.

  5. Don't enable more than 50 modules.

  6. Also do query caching with MySQL if you are using MySQL.

After that a lot having to do with performance is programmatic. Look at how Drupal 7 breaks apart Profile entities if you want to see another database problem that will grow with scale meaning Drupal 7 may not ever scale. You may have to write modules yourself to speed up parts that are already slow in the core. Maybe Drupal 8 will take care of some of the issues.

Upvotes: 1

Jauder Ho
Jauder Ho

Reputation: 1365

Do you have a url to your site?

Couple of quick pointers:

  1. Use YSlow
  2. Use tools.pingdom.com to see if there is anything obviously slow
  3. Compress js and css using YUI compressor
  4. Only use cookies where necessary
  5. Use APC/Xcache
  6. Tune PHP params
  7. Use separate server for static. Use nginx
  8. Use varnish to cache

HTH.

Upvotes: 4

Wim Leers
Wim Leers

Reputation: 1631

I wrote an article about page loading performance in Drupal. You'll find references to almost everything you need to know about that subject over there. And as others have noted already, you definitely should install an opcode cache such as eAccelerator or APC. They're easy to setup and give you a free performance boost!

Upvotes: 3

elcuco
elcuco

Reputation: 9208

Try installing apc - http://il.php.net/apc or eccelerator - http://eaccelerator.net/

Both improve the run PHP performance. On some sites I tested, the time it takes to load the front page went from from ~750msec to ~300msec.

I have bad experience with PHP/MySQL/Drupal on Windows, finding LAMP duds is sometimes easier. So I would recommend - run away from Windows based setups.

Not really a stackoverflow.com answer... but the syster site is not available yet :)

Upvotes: 0

Randy Burgess
Randy Burgess

Reputation: 5005

I recently launched a Drupal site and it runs quite fast. The biggest bottleneck (according to Y!Slow), is a ShareThis app that we added. Also, the external download of Google Analytics adds a little bit of time.

Also, make sure you have all developer modules turned off (they can add jscript and styling overhead), that you are NOT signed in as the administrator when testing, and use a browser that had minimal add-ons (such as Chrome) that might be doing processing on the side.

Upvotes: 0

Eaton
Eaton

Reputation: 7415

Have you used any tools like YSlow or Firebug to determine what portions of the page load are actually taking up the most time? Also, consider using the Devel module's query monitoring to determine how much time is being taken running queries versus executing PHP code.

As others have noted, an opcode cache like APC can have a dramatic impact. The fact that second visits to the site are faster, though, hints at an issue with secondary files (images, JS, external JS that calls remote sites, etc).

Upvotes: 5

Sean McSomething
Sean McSomething

Reputation: 6507

You mention CSS/JS being slow - have you turned on the 'bandwidth optimizations' for CSS and JS in /admin/settings/performance? It bundles all the CSS (or JS) into a single file - which can make a sizable difference if you have a large number of separate files (latency is a killer).

Using an opcode cache, like APC, can make a big difference in page performance as well, especially once you start piling on the modules. I can't imagine going back to developing PHP without using it.

Upvotes: 4

thedz
thedz

Reputation: 5572

If you're certain the DB is not a bottleneck, then it points to either execution time or server response.

Are you doing any sort of PHP opcode caching?

Also check your Apache config. Does it perform slowly only under concurrent usage or is it slow off the bat with only a single visitor?

There's also a page on Drupal that goes over some common steps: Server tuning considerations

You can ignore the ones related to the database, of course.

Upvotes: 0

Related Questions