Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ranguard (1858)

Ranguard
  (email not shown publicly)
http://leo.cuckoo.org/

Journal of Ranguard (1858)

Thursday January 10, 2002
12:18 PM

Apache, mod_perl and a few lessons

[ #2040 ]
Well, I launched the site, and supprisingly (considering the lack of testing time we had) it's all working rather well. I have had to learn some lessions very quickly though to make sure it stays working.

The site www.foxtons.co.uk Has front end apache servers serving images and static content which then proxy to a backend DB / CGI / Mod_perl machine.

Lesson 1
Expect double your highest estimate of traffic (it was all running off one box previously, so I assumed not too much even though it was over loaded) and then double it and add some more. - We are getting loads more traffic than I though, there were no usable stats on the old server.

Lesson 2
Set your Apache MaxClients to the highest you can, taking in to account the memory on the machine, it was embarising to realise that the site was slow, not because of the machine load or memory but because it was being hit harder than I thought and just couldn't open enough processes.

Lesson 3
See lesson 2 and apply to back end mod_perl server.

Lesson 4
The mod_perl guide on line http://perl.apache.org/ should be used in conjunctoin with the book "Writting Apache Modules with Perl and C". There were several thing in the online guide that I couldn't find in the book.

Lesson 5
There is NO lesson 5

The main script was written for Apache::Registry, the load on the machine is between 2 and 5 so I definatly need to make it a propper mod_perl handle so it can share global variables such as a TT object. I hadn't realised until recently that this can not be done with Apache::Registry, though thinking about it it make sence.

I did find it interesting that when asking about, it turns out that most people, like my self, haven't ventured into mod_perl handles and tend to use Apache::Registry instead. I got my first mod_perl handle working today, was a lot easier than I thought it would be, still looking into some apache config options, there are just soo many.

Lession 6
PerlInitHandler, the mod_perl book says it can be put anywhere, but then it's quick reference card says it has to be in a Directory block in the conf. Only just remembered this lession.

Well, as usual enough rambeling...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Lesson 5 (Score:2, Informative)

    Hmm. I take the inverse approach. I use mod_perl handlers wherever possible rather than Apache::Registry code.

    Except for actual content handlers, for which I use Mason =)
    --
      ---ict / Spoon
  • mod_perl handlers really require a paradigm shift, which is why I personally think many programmers don't get into them - Apache::Registry speeds up their CGI scripts and they are happy. Pulling out their authentication code and putting it into a handler just isn't intuitive at first.

    if you are really interested digging into the cooler aspects of mod_perl, well, you'll have a ready resource in only a few days :)
  • You killed my mozilla! You bastard! ;-)

    Not sure what's up with that. I get total freeze up when I go there.