[SAC] [OSGeo] #89: Improve caching of website

#89: Improve caching of website
-------------------------------------+--------------------------------------
Reporter: tmitchell | Owner: sac@lists.osgeo.org
    Type: enhancement | Status: new
Priority: minor | Component: SAC
Keywords: drupal cache performance |
-------------------------------------+--------------------------------------
A few different people, in a few different contexts, have been asking
about caching on the foundation website.
For the record, here is what I've done:
  * enabled Drupal's internal caching, with a 5 minute minimum lifetime
  * enabled mysql caching, by setting in /etc/my.cnf, with 64MB RAM

Others have asked about squid caching, but I'm ignorant of this, so
passing to SAC for others to comment. Setting this to minor now that
these two methods are both working.

----

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
--------------------------+-------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Component: SAC
Resolution: | Keywords: drupal cache performance
--------------------------+-------------------------------------------------
Comment (by tmitchell):

Other comments received include:
  * Call the cron.php script regularly - this clears up some stuff, and
also rebuilds search result database
  * Include some cleanup queries in the db, including some optimisation
queries:
{{{
  DELETE FROM sessions where uid=0;
  OPTIMIZE TABLE sessions;
  OPTIMIZE TABLE cache;
  OPTIMIZE TABLE watchdog;
}}}

Can someone please '''set up a cron job''' that calls
http://oursite.com/cron.php and also that runs above script against db?

----

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:1&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
--------------------------+-------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Component: SAC
Resolution: | Keywords: drupal cache performance
--------------------------+-------------------------------------------------
Comment (by tmitchell):

It is also noted that Drupal may not be handling 404 requests nicely...
since there are many dead links from old site structure, it is recommended
we modify .htaccess to handle things better:
  * as per http://drupal.org/node/56773

and as clousau on IRC mentions:
{{{
clouseau: also, this was added to .htaccess in Drupal 5, but will work
with 4.7:
[08:44am] clouseau: # Requires mod_expires to be enabled.
[08:44am] clouseau: <IfModule mod_expires.c>
[08:44am] clouseau: # Enable expirations.
[08:44am] clouseau: ExpiresActive On
[08:44am] clouseau: # Cache all files for 2 weeks after access (A).
[08:44am] clouseau: ExpiresDefault A1209600
[08:44am] clouseau: # Do not cache dynamically generated pages.
[08:44am] clouseau: ExpiresByType text/html A1
[08:44am] clouseau: </IfModule>
[08:44am] clouseau: that helps graphically-heavy sites more
}}}
  * Upgrading to Drupal 5 will help in some areas too

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:2&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
--------------------------+-------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Component: SAC
Resolution: | Keywords: drupal cache performance
--------------------------+-------------------------------------------------
Comment (by jbirch):

Both of those changes to htaccess make a lot of sense. I'd even extend
caching of text/html content, but I'd be surprised if content generated
dynamically by PHP was covered by mod_expires anyway.

I could be wrong though; all of my experience thus far has been with
Apache 1.x, and some of the module call orders seem to have changed
considerably in 2.x

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:3&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
------------------------+---------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: task | Status: new
  Priority: critical | Component: SAC
Resolution: | Keywords: drupal cache performance
------------------------+---------------------------------------------------
Changes (by warmerdam):

  * owner: warmerdam => sac@lists.osgeo.org

Comment:

I have added a job in /etc/cron.d/backup.cron to invoke
/root/scripts/drupal_cron.sh which does a quiet wget against
http://www.osgeo.org/cron.php and then cleans up.

I doubt I'll be doing the rest of the stuff myself, so I'm reassigning
back to sac.

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:5&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
------------------------+---------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: task | Status: new
  Priority: critical | Component: SAC
Resolution: | Keywords: drupal cache performance
------------------------+---------------------------------------------------
Comment (by tmitchell):

Anyone have more ideas on implementing a squid-like layer for caching?

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:6&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
------------------------+---------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: task | Status: new
  Priority: critical | Component: SAC
Resolution: | Keywords: drupal cache performance
------------------------+---------------------------------------------------
Comment (by warmerdam):

Tyler,

In my opinion, load on the peer1 system is tiny now, and there is no real
need to push further on cashing. As we learned, it wasn't Drupal that was
our performance bottleneck.

I'd encourage closing this ticket.

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:7&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
------------------------+---------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: task | Status: closed
  Priority: critical | Component: SAC
Resolution: fixed | Keywords: drupal cache performance
------------------------+---------------------------------------------------
Changes (by warmerdam):

  * status: new => closed
  * resolution: => fixed

Comment:

Closing as there is no longer any real need to improve performance. Load
is very modest.

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:8&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#89: Improve caching of website
------------------------+---------------------------------------------------
  Reporter: tmitchell | Owner: sac@lists.osgeo.org
      Type: task | Status: closed
  Priority: critical | Component: SAC
Resolution: fixed | Keywords: drupal cache performance
------------------------+---------------------------------------------------
Comment (by tmitchell):

I found the cron.php has been failing. I fixed it by increasing memory to
32MB in php.ini. I was sure I increased it before, but it was back to the
default 16MB. I also "repaired" the search index tables.

See wiki for more info:
http://wiki.osgeo.org/index.php/OSGeo_Portal_Site#Troubleshooting

--
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/89#comment:9&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.