Best approach to increase page load in OP

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
leob's picture

This is nothing new but I am just curious is somebody could suggest how to make the default OP installation speed up. In my default installation all the pages take too long to load. I am just working in a local server so I am afraid what is going to happen when i will go live.

Any tips?

Thanks,

Leo

Comments

Do you have APC installed

irakli's picture

Do you have APC installed locally?

.............................................
http://twitter.com/inadarei

APC not installed

leob's picture

I don't have it installed.
I didn't use it before.
What it is your experience using it?

Thanks.

Look into increasing your PHP

narcissus921's picture

Look into increasing your PHP memory limit for your local environment. Is it a *nix server, or localhost WAMP/MAMP setup?

You'll probably want to increase your SQL limit as well.

Look at your settings on example.com/admin/reports/status, and look for your PHP limit. I set my PHP to be at least 96B, and that seems to work, depending on what you're serving.

On my WAMP, PHP is set to 256MB and SQL is set to 1GB.

I've never set up APC though, and have found this to work so far.

Also - if you have an inkling of what the live server will be running, try replicating those configurations and see if it crashes =)

Thanks

leob's picture

Thanks a lot for the advise.
I am working on Wamp server.
I have increased the memory limit in php.ini but I am not sure where to change the default
value for SQL. Where is located this file?

Thanks,

Leo

I'll look when I get home, as

narcissus921's picture

I'll look when I get home, as I'm at work, but I'll take a look. It wasn't in an obvious place for me, and it's been a couple months, but I'll hunt it down for ya if you haven't found it already.

Should reply by late tonight.

You have been really helpful

leob's picture

Thanks a lot for your help.

You're welcome!

narcissus921's picture

Most definitely. If you're ever interested in trying something new, sign up at www.webenabled.net. I use that for quick site deployment, make a backup, pull it down, and then work on my WAMP with it - pretty cool if you're into Fusion/Skinr.

You could also just launch a new fresh Drupal app on there and then SCP in and upload OP, clear out the db, and relaunch the profile from there and work on it. Defaults to 96MB for PHP!

Back to your question though - It might be located in my.ini within the sql folder, but that's going off memory.

Nice tip

leob's picture

I will tried this approach it looks really smart idea.
I tried to find where exactly is the code that I have to change in my.ini but i couldn't.
Any tips?

Yeah. Path will end up being

narcissus921's picture

Yeah. Path will end up being \bin\mysql\mysql[versionyou'rerunning]\wampserver.conf

There's a line in there where it'll look like:

$mysqlConf['mysqlConfDir'] = '.';
$mysqlConf['mysqlConfFile'] = 'my.ini';
$mysqlConf['mysqlExeDir'] = 'bin';
$mysqlConf['mysqlExeFile'] = 'mysqld.exe';
$mysqlConf['mysqlServiceInstallParams'] = '--install-manual wampmysqld';
$mysqlConf['mysqlServiceRemoveParams'] = '--remove wampmysqld';
$mysqlConf['libMysqlFile'] = 'bin/libmySQL.dll';

You can always do a search for wampserver.conf and just edit that =)

Anyway, change the second line with my.ini to reflect the my-medium.ini or my-small.ini you'll use. Restart WAMP.

Let me know if that helps much.

Didn't help much

leob's picture

Sorry but didn't help much. It takes about 20 seconds to load any page which I think is too much.
Maybe there is something to do with modules with OP and if I turn off some of them could help but I don't want
to do that at this point.
Do you have any other suggestions?

hm. Are you running anything

narcissus921's picture

hm. Are you running anything extra in OP? Extra modules or anything? What I'll do in a bit is try this out - get OP on my WAMP, check my config, and see about load time. I've never had it take more than a couple seconds, which makes me wonder what's going on.

What did you up your PHP memory to?

I wil try this out

leob's picture

Not any extra modules in OP. I changed the memory in the php.ini to 256M in both version 5.2 and 5.3.
I will keep trying.

PHP memory

yelvington's picture

Keep in mind that the PHP memory limit is a LIMIT and not an ALLOCATION. It will not make your site faster.

yelvington's picture

There are probably some things you can do to speed up your WAMP dev setup, but you should start NOW to think about real-world performance on a real server, and get going NOW on performance-tuning your production environment.

When your're analyzing performance, you have to separate Drupal performance from all the other cruft that's on your pages. The resource tracking tool in Chrome (tools->developer tools, then select the proper tab) will tell you from the client's perspective how long it's taking to fetch various components.

Your Drupal page generation shouldn't take more than one-eighth to one-quarter of a second on a properly configured server. Properly configuring includes:

  • Tuning MySQL, especially query cache. Google for tons of advice on that.
  • Installing APC and giving it enough memory.
  • Installing Cacherouter, or equivalent, and moving your Drupal cache tables into RAM. You can use APC storage or install Memcache.

However much memory you think you need, you're probably being too conservative. A Linux server will make good use of extra RAM to "float" the filesystem, so all your static files should wind up in RAM. All your cache should be in RAM. All your PHP should be compiled and in RAM. If you hit disk for any reason, you're slowing things down. Pay attention to APC's RAM utilization graph.

Once you've addressed performance, then you should look at scalability, which is not the same thing as performance. Scalability is about avoiding a slowdown as load increases, not about making it fast in the first place.

Begin by protecting Drupal from anonymous traffic. Boost is a good simple tool for a single-server site that writes complete pages to disk, allowing Apache to serve them without running Drupal at all. For a larger site, the typical approach is to front the webserver with a cache server running Varnish or Squid.

The last steps are moving the database to a separate server, then scaling horizontally with more boxes at each layer.

There are lots of other things you can do to improve performance, including tuning your Views, replacing Views code with hand-crafted SQL, etc., but you should get the big things right first.

Really helpful tips

leob's picture

Thanks yelvington for your approach. Defenitly I will use the Chrome tracking tool to make sure from the client's perspective how long take to fetch.
Another thing that I realized is that without login as admin the performance back to normal <2 seconds. I am trying to turn off some modules that i don't need at this point.
Some of other suggestions that you have explained are out of my knowledge but i really appreciate your detailed explanation.

Thanks problem solved

leob's picture

I folowed some of the tips in this link:

http://drupal.org/node/348202#comment-3349704

It helped me to solve some of the issues. Maybe this is not the best approach but for now I just want to speed up the design.

On Windows, setting

irakli's picture

On Windows, setting realpath_cache_size to a high number like 2M is very important.

APC is PHP OPCode optimizer and it makes the world of difference for any large PHP code-base (including OpenPublish).

.............................................
http://twitter.com/inadarei

APC don't run in drupal 6?

leob's picture

I am running drupal 6 and APC is only available for Drupal 7.
There is a soltuion for this?

Not APC the Drupal module,

irakli's picture

Not APC the Drupal module, but APC - the PHP extension: http://us3.php.net/manual/en/apc.installation.php

.............................................
http://twitter.com/inadarei

APC installation on wamp

leob's picture

Could you tell me how to install the extension?
I couldn't do it.

What flavor of wamp?

mikeytown2's picture

Xampp? ect... where did your php version come from?

php version 5.2.11

leob's picture

It wamp the one that I am using.

Guide

mikeytown2's picture

http://www.wampserver.com/phorum/read.php?2,52907

Quick guide:
Download php_apc.dll - http://downloads.php.net/pierre/php_apc-3.1.4-5.3-nts-VC9-x86.zip
Drop php_apc.dll into the ext dir. should be next to php.ini
Enable apc in php.ini - extension=php_apc.dll
Configure apc in php.ini (this is what i use)

[APC]
apc.cache_by_default = 1
apc.coredump_unmap = 0
apc.enable_cli = 0
apc.enabled = 1
apc.file_update_protection = 60
apc.filters =
apc.gc_ttl = 3600
apc.include_once_override = 0
apc.max_file_size = 1M
apc.mmap_file_mask = /tmp/apc.Rx2Yyy
apc.num_files_hint = 1024
apc.report_autofilter = 0
apc.rfc1867 = 0
apc.rfc1867_freq = 0
apc.rfc1867_name = APC_UPLOAD_PROGRESS
apc.rfc1867_prefix = upload_
apc.shm_segments = 1
apc.shm_size = 128
apc.slam_defense = 0
apc.stat = 1
apc.stat_ctime = 1
apc.ttl = 7200
apc.user_entries_hint = 4096
apc.user_ttl = 7200
apc.write_lock = 1

Restart apache/php
Get apc.php from here and view it to verify apc is installed - http://pecl.php.net/get/APC-3.1.4.tgz

DLL

Newspapers on Drupal

Group organizers

Group categories

Topics - Newspaper on Drupal

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: