Ok, I believe to have zero-in the issue.

As I mentioned the key for the memcached object is a rule (a sequence of
words with a non-space delimiter) in my case. For example the key could be
"Monsieur-%-le-%-President", where the string '-%-' is used as a delimiter
instead of space, which is not accepted in for a memcached key.

I need to store three values for every key, first being the rule count
(float represented as a string) and the other two being some strings. To
store additional values, I add two different prefixes to the key and use the
prefixed string as key. Thus my keys and values are as below,

                keys                              values
"Monsieur-%-le-%-President"   -   <rule count>
"F|||Monsieur-%-le-%-President"   -  <str-1>
"R|||Monsieur-%-le-%-President"   -  <str-2>

I now experimented by just storing the original key with the rule-count
value, without storing the other two keys. And yeah, I could extract the
values of all the keys and so # of key misses were '0' (yes, this is what I
want). I also tried storing some other value instead of rule-count and this
time also it worked.

The key miss problem occurs, when I store all the three keys and their
values for the rules. I guess that the problem is due to the fact that the
every key is similar to two other keys except for the suffix part, though I
don't understand why this is a problem.
I would greatly appreciate any help.

Thanks
- B


On Wed, Mar 18, 2009 at 9:15 PM, Dustin <[email protected]> wrote:

>
>
> On Mar 18, 8:29 pm, Baskaran Sankaran <[email protected]> wrote:
> ...
>
> > Before proceeding, let me explain my requirement clearly. I want to
> maintain
> > a huge hash table to store some rules (keys) and their counts (values).
> The
> > hash table has to be accessed over the network by multiple processes
> running
> > parallely, which would update the count (add the incremental count to the
> > existing value) for the rules, if they are already present in the hash
> > table. The first time a rule is seen, it would be 'set' to the hash with
> the
> > initial count as value. Once, I finish the process, I would want to write
> > down the final counts for the individual rules in a file.
>
>  ...

Reply via email to