Re: performance modifications
From: Sten Spans (sten_at_blinkenlights.nl)
Date: 03/14/05
- Previous message: ray_at_redshift.com: "Re: performance modifications"
- In reply to: ray_at_redshift.com: "Re: performance modifications"
- Next in thread: Erich Dollansky: "Re: performance modifications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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"
- Previous message: ray_at_redshift.com: "Re: performance modifications"
- In reply to: ray_at_redshift.com: "Re: performance modifications"
- Next in thread: Erich Dollansky: "Re: performance modifications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|