Saturday, February 18, 2006

Up All Night with AFP

No, I didn't pull an all nighter and stay up writing AFP code. :) I can't remember the last time I pulled an all nighter coding. 3:00 AM is my limit nowadays and that's pretty rare.

Anyway, my Waking Up AFP blog entry got an immediate rise out of Chrisof at Prolib, the author of AFP. I kind of figured it would. :)

AFP has a lot of configuration options and of course, how long it stays up and running on the server is one of the things you can configure.

So, here's what Christof had to say about it:

The default configuration is to shut down an engine when it's been idle for 15 minutes or has processed 2000 hits (to avoid memory problems). You can change that in the afp.config file (or in the ControlCenter):

max-idle="900" max-uptime="0" max-hits="0"

max-uptime defines that an AFP engine stops when it has been running for the specified number of seconds, no matter how many hits it processed or how long it has been idle. These settings define how AFP shuts down engines.

A second set of parameter specifies how AFP deals with starting engines:

threads="4" min-threads="0" max-threads="4"

The default configuration tells AFP to start 4 engines when it starts up. On demand AFP launches up to a total of four engines (it starts with the maximum number), AFP monitors that the number of engines never goes down below zero (that is, all engines can terminate). If you change the min-threads value to "1", AFP always keeps one instance running. Together with the max-idle setting, this would cause AFP to restart the egine every 15 minutes, but always keep one available for fast response times. You can increase the max-threads value to increase reaction time for higher request rates. The recommended value is four times the number of processors on your machine. The best value depends on a number of factors and is best determined by experimenting.

There's a whole multi-threading infrastructure in AFP.

Thanks for setting me straight Christof!

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home