Re: performance modifications

From: Sten Spans (sten_at_blinkenlights.nl)
Date: 03/14/05

  • Next message: Claus Guttesen: "postgresql, max_fsm_pages on FreeBSD 5.3"
    Date: Mon, 14 Mar 2005 08:47:43 +0100 (CET)
    To: ray@redshift.com
    
    

    On Sun, 13 Mar 2005 ray@redshift.com wrote:

    > Hi Erich,
    >
    > I wrote a small test program in C that just printed a single <html>test</html>
    > line and it was very slow when called as a cgi via apache. Much slower than
    > PHP. Is there something that needs to be done in order for Apache to run C
    > without having to shell out to the OS (?) or something.

    The main overhead should be fork/exec, this can
    be solved by running persistent cgi's through fastcgi,
    cgisock, etc.

    The main trick with tuning anything is to search for
    the bottlenecks, switching an entire site to another language
    solves nothing if the database server is the bottleneck.

    There are however a few easy tricks to speed things up a bit:

    1- Move static content to a lightweight webserver,
        Apache with mod_php uses quite a bit of memory,
        which is wasted on static content.
        run thttpd/lighthttpd/etc for pictures.yourdomain.com

    2- Database queries are another common bottleneck
        changing database layout, caching queries in sessions, etc
        usually helps quite a lot.

    3- A simple brute-force solution is to cache generated content
        for short periods in squid/mod_proxy/etc or even cache it in
        the site code itself.

    Good luck.

    -- 
    Sten Spans
    "There is a crack in everything, that's how the light gets in."
    Leonard Cohen - Anthem
    _______________________________________________
    freebsd-performance@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-performance
    To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"
    

  • Next message: Claus Guttesen: "postgresql, max_fsm_pages on FreeBSD 5.3"

    Relevant Pages

    • Apache as application server
      ... I'm totally new to web programming but - well, ... Now, those clients all open sessions to the database ... is the above scenario possible at all with apache? ...
      (comp.infosystems.www.servers.unix)
    • oscommerce issue
      ... I'm running FreeBSD 5.4 with Apache 1.3, ... "1046 - No database selected ... Mail has the best spam protection around ...
      (freebsd-questions)
    • Re: OT: MySQL And Native File Writes Versus Ports and TCP/IP
      ... as it didn't come from a TimeWarner email address. ... Is there a native database environment built into PHP, ... I think this is an Apache question though. ...
      (comp.lang.php)
    • Re: [PHP] PHP Template Trouble
      ... The issue you describe is more related to Apache and URL rewriting than to PHP. ... These sites are identical apart from the database they call to, one will call to a database called example1 and the other example2. ... I want another site to read what url has been entered and to pull in the database for that site (either example1 or example2) and show that information. ...
      (php.general)
    • Re: Database Security Issues
      ... The only solution I have think of is to encrypt the database password ... as session files are accessible through Apache). ... > database.php which is readable only by the Apache web server. ... > function database() { ...
      (comp.lang.php)