[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: MirrorMode VS load balancing



Hello Howard,

Thanks for you reply.

On Sat, 27 Jun 2009 07:50:15 -0700
Howard Chu <hyc@symas.com> wrote:

> Hideo NAKAMITSU wrote:
> > My question is, MirrorMode document says "writes have to go to just one of the mirror nodes at a time."
> > but if the writes don't happen very often, I think "writes can be done on every nodes at a time."
> >
> > When I did some tests, it could be done. but I'm not sure developer's thoughts.
> > How do you think guys ?
> 
> If the period between updates is always longer than the propagation delay 
> between servers, then it will make no difference.

The point is this "period". sec, microsec, less ?

I wrote following 2 simple scripts to update 2 notes at the same time to know data corruption.
both of them will add LDAP 10,000 entries but the difference is,

add_many1.sh will add 10,000 entries with one ldapadd command(LDAP tcp session) and in my environment, throughput was 47 entries/sec
add_many2.sh will run 10,000 times of ldapadd command. obviously this is slower than add_many1.sh. throughput was 33 entries/sec

when I run add_many1.sh, database wasn't synchronized correctly,
but in case of add_many2.sh, it could be synchronized perfectly every time.

from my test, the result was this.
--------------------------------------------------------
If the adding throughput was 47 entries/sec, couldn't write both nodes at the same time.
but if it was 33 entries/sec, it could be written at the same time.

you know adding 33 entries/sec is much heavier than normal ldap server.
which means, if the ldap servers don't have too much add/modify operation in a day,
both of then can be written at the same time.
--------------------------------------------------------

thoughts ?


add_many1.sh
--------------------------------------------------------
#!/bin/sh 
i=0 
host=`hostname --short` 
while [ $i -lt 10000 ]; do 
  echo "dn: cn=${host}_${i},ou=people,dc=example,dc=com" 
  echo "objectClass: person" 
  echo "cn: ${host}_${i}" 
  echo "sn: ${host}_${i}" 
  echo "" 
  i=`expr $i + 1` 
done 
--------------------------------------------------------

how to run add_many1.sh
--------------------------------------------------------
# on one host
./add_many1.sh | ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret
# on the other host
./add_many1.sh | ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret
--------------------------------------------------------

add_many2.sh
--------------------------------------------------------
#!/bin/sh 
i=0 
host=`hostname --short` 
while [ $i -lt 10000 ]; do 
  ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret <<EOF 
dn: cn=${host}${i},ou=people,dc=example,dc=com 
objectClass: person 
cn: ${host}${i} 
sn: ${host}${i} 
EOF 
  i=`expr $i + 1` 
done 
--------------------------------------------------------

how to run add_many2.sh
--------------------------------------------------------
# on one host
./add_many2.sh
# on the other host
./add_many2.sh
--------------------------------------------------------