Loading ...
Sorry, an error occurred while loading the content.
 

Caching Apache::ASP-generated pages

Expand Messages
  • Philip Mak
    One of my servers is getting a load average of over 6.00, because of a very popular Apache::ASP-powered database driven website. I m thinking about getting the
    Message 1 of 2 , Jan 17, 2004
      One of my servers is getting a load average of over 6.00, because of a
      very popular Apache::ASP-powered database driven website.

      I'm thinking about getting the front-end httpd to cache the pages
      generated by Apache::ASP by adding something like this:

      $Response->AddHeader('Last-Modified', time2str(time));
      $Response->{CacheControl} = 'public';
      $Response->{Expires} = 3600;

      But then I realized that the backend, while it always generates the
      same content for a given URL (unless the administrator updates the
      database), generates different advertising depending on the country of
      the remote user (determined via Geo::IP) and how many pages they have
      viewed so far!

      So, I don't think front-end caching would work here, since it would
      break the advertising rotation.

      Any ideas on what to do? Off the top of my head, I can think of the
      following options:

      * Buy a separate database server.
      * Break up the Apache::ASP pages into components that are cached via
      $Response->Include; not as good as caching the whole page via the
      frontend, but should help.
      * Have the backend generate a placeholder for the advertisements,
      allow the frontend to cache the backend's responses, but write a
      module in C on the frontend that inserts the advertisements. (Sounds
      efficient from a technical standpoint, but painful to do considering
      I have no experience writing Apache modules. I'm also not sure how
      to make a filtering module work together with the cache, or if it's
      even possible.)
      * Benchmark performance of the ASP scripts to see if there's any easy
      optimizations I can perform.

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... Right. ... and/or upgrade your current server. This is usually the easiest step though, adding a database server. It may be that much of your load is
      Message 2 of 2 , Jan 17, 2004
        Philip Mak wrote:
        >
        > But then I realized that the backend, while it always generates the
        > same content for a given URL (unless the administrator updates the
        > database), generates different advertising depending on the country of
        > the remote user (determined via Geo::IP) and how many pages they have
        > viewed so far!
        >
        > So, I don't think front-end caching would work here, since it would
        > break the advertising rotation.
        >

        Right.

        > Any ideas on what to do? Off the top of my head, I can think of the
        > following options:
        >
        > * Buy a separate database server.

        and/or upgrade your current server. This is usually the easiest step though,
        adding a database server. It may be that much of your load is generated by
        your database, in which case you might need to do some database optimization.

        > * Break up the Apache::ASP pages into components that are cached via
        > $Response->Include; not as good as caching the whole page via the
        > frontend, but should help.

        Yep, smart caching here can go a long way.

        > * Have the backend generate a placeholder for the advertisements,
        > allow the frontend to cache the backend's responses, but write a
        > module in C on the frontend that inserts the advertisements. (Sounds
        > efficient from a technical standpoint, but painful to do considering
        > I have no experience writing Apache modules. I'm also not sure how
        > to make a filtering module work together with the cache, or if it's
        > even possible.)

        I would not even go there. :-)

        > * Benchmark performance of the ASP scripts to see if there's any easy
        > optimizations I can perform.
        >

        Yes!

        Regards,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checker http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.