Re: PerlTransHandler question
[prev]
[thread]
[next]
[Date index for 2005/03/09]
Quoting shawn <shawn@xxxxx.xxx>:
> So far this working on my development environment, but what I am really
> wondering about is if this will actually take the load off mod_perl?
> (it's a little hard for me to tell without significant traffic) Will the
> mod_perl server execute the page and release the connection and not care
> how long the images server is taking? If anyone has a better solution or
> an idea I would love to hear it.
OK, this is a little confusing... it's hard to tell what you are doing here.
First, I'm not sure I'd assume that a CPU usage spike can be blamed on apache
serving up images. That should be mostly disk reads and I wouldn't expect it
to effect CPU much. Good monitoring, logging, and load-testing might be in
order.
Second, I'm going to assert a few assumptions on what you are doing:
1) you are running (at least) two apache/mod_perl webservers... one for
serving
static content and one for serving mod_perl requests
2) You have installed this TransHandler on both web servers, for whatever
reason, which is why you have the if statement
3) You are therefore NOT running images.webserver.com and webserver.com
from the
same apache server instance, as you realize that this doesn't solve
your problem
4) You also realize that the TransHandler doesn't make much sense (AFAICT) if
assertion #2 is not true.
If any of these assertions are false, we may need to back up a bit.
If these assertions are all true, then I see what you are trying to do (and in
theory it could work), but it's worth mentioning the following:
- you could send images.webserver.com in the original content, thus
avoiding the
browser redirect and eliminating the need for the TransHandler
- I'm not sure why you would need/want mod_perl on the static content server
- you could alternatively use mod_rewrite
Note also that if you are on an OS with copy-on-write memory pages (ie: linux)
then you can keep the apache children thin and light by preloading your
mod_perl modules in the parent. If children are thin and light, you can run
more of them for the same bang/buck. If you are really diligent at preloading
things, then you may find that the original apache/mod_perl is light enough.
You might want to consider running two apaches together:
1) apache/mod_ssl/mod_proxy/mod_gzip/mod_mmap_static server as a front-end
2) proxying to the apache/mod_perl backend
See also:
http://perl.apache.org/docs/1.0/guide/performance.html
If your primary concern is slow clients, then you might consider mod_gzip.
And the obvious of course... keep your images as small as possible, or provide
smaller, clickable thumbnails.
 |
 |
Re: PerlTransHandler question
Tony Clayton 03:15 on 09 Mar 2005
|