phpize
, ./configure
, make all
, make install
. All good, extesnsion enabled successfully (checked in phpinfo). But still segfault on $rk = new RdKafka\Producer()
.
php -n -d extension="/usr/local/Cellar/php70/7.0.13_6/lib/php/extensions/no-debug-non-zts-20151012/rdkafka.so" cli-producer.php
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";
$brokers="192.168.48.79,192.168.48.80,192.168.48.86";
$conf = new RdKafka\Conf();
$rk = new RdKafka\Producer($conf);
$rk->addBrokers($brokers);
$topic = $rk->newTopic($my_topic);
$topic->produce(RD_KAFKA_PARTITION_UA, 0, "$i Record Has Been Entered Here");
while ($rk->getOutQLen() > 0) {
$rk->poll(0);
}
$conf->set('internal.termination.signal', SIGIO);