nebmods API

Andreas Ericsson ae at op5.se
Thu Feb 10 10:31:00 CET 2005


Ian Holsman wrote:
> On Wed, 09 Feb 2005 21:55:28 +0100, Andreas Ericsson <ae at op5.se> wrote:
> 
>>So...
>>
>>I've taken up hacking on a redundancy/loadbalancing module (old news)
>>and it's starting to come together quite nicely. Unfortunately, I've run
>>into a couple of very irritating problems which had to be worked around
>>in sometimes less than optimal ways.
> 
>  
> 
>>3) (I've posted about this before) Most string variables are stored in
>>flexible-length pointers, making it seriously difficult to handle as
>>network data. It also adds a necessity for deep memory management and an
>>unseemly amount of malloc()'s and free()'s. It also makes it completely
>>impossible to store objects.cache in a binary file for ultrafast parsing
>>by the CGI's. 
>>
>>#3 requires rather careful thought and planning. What's a reasonable
>>maximum length for host_name variables? I've never seen one that
>>approaches 30 chars, while the alias field could well go up to 40 chars
>>or so.
> 
> 
>>Thoughts? Comments?
>>
> 
> 
> please don't consider this. whatever length you choose will never be
> enough for everyone who
> has special cases, and changing the length will break binary
> compabitility of whatever you store on disk.
> 

Every database in the world does it, to great benefit. I see no reason 
why an arbitrary length shouldn't be made large enough to hold all 
conceivable strings. But you're right. It's probably for the best to 
convert it to static length before sending it and leaving the core 
tables intact.

> have you thought of just storing the length and  then character
> string? or for a more radical approach store the strings in a seperate
> file, and store the offsets in the main file.
> 

Nopes. I believe a better idea would be to use a module to send status 
and such to the CGI's through a socket, using the conversion routines 
I'd have to write for networking anyway.

> while #4's solution would handle the directive side of things, you
> would also need to be able store data somewhere (ie.. a config option
> which holds the MAC-address of each host would need a spot on the host
> record somewhere).
> 

Truly. But such tables could easily be stored inside the module. I was 
thinking something along the lines of the module reacting to events and 
using its own data to handle the transaction.

> Have a look at how apache handle's its per-directory directives. I can
> dig up the code if you need.
> 

Will do, thanks. I've got the sources myself though.

> regards
> ian
> 
> 
>>--
>>Andreas Ericsson                   andreas.ericsson at op5.se
>>OP5 AB                             www.op5.se
>>Lead Developer
>>
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click




More information about the Developers mailing list