[Yazlist] Yazproxy | PHP / YAZ

Adam Dickmeiss adam at indexdata.dk
Thu Sep 18 21:49:55 CEST 2008


Richard MAHONEY wrote:
> Readers,
>
> I've been having trouble with the performance of Zebra while under load
> so I want to try running two instances and to load balance between
> them.
>
> Yazproxy is sitting in front of the Zebra instances receiving requests
> from a PHP / YAZ search interface. Yazproxy's config.xml file contains:
>
> ...
>    <target name="localhost" default="1">
>     <url>localhost:9998</url>
>     <url>localhost:9999</url>
> ...
>
> Currently the PHP / YAZ search interface contains:
>
> ...
> yaz_connect('localhost:9999/sch1', array('charset' => 'UTF-8', \
>  'proxy' => 'localhost:9000', 'cookie' => 'ScholiaCookie', 'piggyback' => 'true'));
> ...
>
>   
I suggest you do not specify a proxy or cookie in PHP/YAZ. Just pass the 
address of the yazproxy as if it was a Z39.50 server itself. IIRC 
yazproxy just assigns to you the server that currently has the lowest 
number of existing sessions.

/ Adam
> What I was wondering was if the `yaz_connect' function currently
> supports -- or can be made to support -- load balancing. At present it
> seems that the function can only take one destination string, in this
> case `localhost:9999/zebradb'. Is this right, or can
> `localhost:9998/zebradb' somehow also be incorporated? All suggestions
> most welcome ...
>
>
>
> Kind regards,
>
>  Richard
>
>
>
>   




More information about the Yazlist mailing list