These are chat archives for arnaud-lb/php-rdkafka

Dec 2016
Aaron Gong
Dec 21 2016 12:38
Does it work on php5.6, 64bit linux?

is there any code that can handle high volume on PHP? I tried ab -n 20000 -c 500 producer seems to choke on PHP, but nodejs is fine...

the broker and consumer are all ok, on the producer... the code is...

$my_topic = "test0";
$conf = new RdKafka\Conf();
$rk = new RdKafka\Producer($conf);
$topic = $rk->newTopic($my_topic);
$topic->produce(RD_KAFKA_PARTITION_UA, 0, "$i Record Has Been Entered Here");
while ($rk->getOutQLen() > 0) {
$conf->set('internal.termination.signal', SIGIO);
Magnus Edenhill
Dec 21 2016 15:38
@ais-one you typically want to persist the producer and reuse it across multiple produce() calls. otherwise things become really slow.
also use a proper timeout rather than zero in $rk->poll(0) or it'll busy-loop