From: Eric Hodel Date: 2003-01-31T14:04:13+09:00 Subject: Re: drb experts --vk/v8fjDPiDepTtA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ahoward (ahoward@fsl.noaa.gov) wrote: > On Fri, 31 Jan 2003, Eric Hodel wrote: >=20 > > Here I meant client and server processes. >=20 > me too. >=20 > 'well, the client and server will be the same in my case'.gsub > /will be the same/, 'will be on the same host/' >=20 >=20 > > Anything you write to should have a mutex around it, unless you don't c= are > > about lost updates. >=20 > you mean anthing outside the local scope of the method called? >=20 > eg. @var, @@var, $var, etc. >=20 > > Let me clear this up with a little code: > [code very helpfull - thanks!!!] >=20 > > When you use Undumped, DRb passes a proxy of the object across to > > the client, so everything done through the object takes place on > > the server side, not the client side. The client only needs to load > > DRb. >=20 > ahhh. i wondered if this were the case. can anyone explain the 'un' in > UnDumped? 'un' becaues it is not actually dumped, but proxies are return= ed > instead? If you watch the transactions with tcpdump, you can see the actual object coming across without undumped. Normally, DRb use Marshall and dump to send the object across. > > If you don't use Undumped, you need to load all the libraries used by t= he > > class on the client side. >=20 > in my case - the cgi process would need postgres.so, etc. >=20 > > For a DB driver, this would be the postgres drives, and you'd get the w= hole > > driver on each Apache process. The more Apache processes you have, the= more > > overhead this takes up. >=20 > as i mention above, the client and server side would be the same in my ca= se, > since the cgi (client) would be using a pool (server) running on my web/db > server machine(s). i wonder though, if in this case the cost would actua= lly > be that high as you think since postgres.so would be shared for all proce= sses > - surely 'require' does a shared mapping and not a private one? >=20 > in fact, it seems like in the case of using the client and server on the = same > machine - at least where *.so's are concerned - there would be little > differnce in overhead since the one image would be in memory regardless. = have > you done any performance tests of this situation? Well, if they are separate Apache processes, then it would fall to your OS's ld.so to do a shared mapping (which I'm sure is smart). The overhead would be for anything you'd do in ruby before it hits the DB, the code for querying, quoting, etc. I would expect that DRb would be slower, because each Apache process can have its own DB connection, and one process won't block the others during I/O. DRb adds the overhead of marshalling and dumping objects across a TCP/IP socket. How much slower that will be though, I don't know. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --vk/v8fjDPiDepTtA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE+OgPKMypVHHlsnwQRAo8MAKC6HQY0FBdbB4/2FEWBNfUTPuIt9QCfSXuI ZZH3ECmEbqMfl+hafwXQHTs= =PylW -----END PGP SIGNATURE----- --vk/v8fjDPiDepTtA--