On Thu, Mar 27, 2014 at 08:48:17PM +0000, MV wrote: > > It is a program! Not a fixed mapping. It receives a sender address, > > and replies (with a possibly cached per-sender) answer which is > > computed on a mostly-round-robin basis. > > If that's not asking too much, could you please provide me with a > practical example or point me to where I could to find one?
A small socketmap or tcp table service that ignores the lookup key and returns the next element of a circular list of values with each lookup is surely just a few lines of custom code. As for how to write a socketmap or tcp table driver in general, your Google skills are likely not too dissimilar from mine. In perl the core lookup function boils down to: @choices = ( ... ); my $count = @choices; my $next = 0; sub lookup { return $choices[$next++ % $count]; } which ignores the lookup key and returns the next choice. You have many choices of languages to choose from, and ways to run this as a network or unix-domain socket service. > > Don't know what overhead you have in mind. > > The overhead caused by my crappy perl script and its IO ops... but > this is irrelevant right now. A tcp or unix-domain socket request-reply round-trip should be quite fast. > > Do you send a flood of separate messages each from the same sender? > > By sender, do you mean email address or just $mydomain ? Full envelope sender address. > If you mean sender=f...@mydomain.tld, then yes, most of the mail sent > comes from a single email account and is sent to a great number of > individual recipients. If you have the same sender for many concurrent messages (not just multiple recipients of a single message), then you would not use the proposed cache, making the code simpler. -- Viktor.