TCP_NODELAY landed in php 7.1
mente opened this issue · 5 comments
Being curious i've written a benchmark comparing php-amqplib vs amqp extension vs bunny.
The winner was amqp extension with socket connection being a bit behind, then bunny, then stream connection. Apparently such amazing results of socket connection in php-amqplib were due to using TCP_NODELAY
. Digging further into stream connection looks like the same has landed for stream connections in 7.1.
Would be nice if you could add TCP_NODELAY
to greatly improve performance of 1st message send/consume
Setting tcp_nodelay
option when creating Bunny\Client
(or Bunny\Async\Client
) should set this option on underlying socket - https://github.com/jakubkulhan/bunny/blob/master/src/Bunny/AbstractClient.php#L245-L248
That's awesome. Where can I find a list of all available options?
E.g. I see persistent
option that requires path
. What is it? Is it same as vhost
?
Unfortunately, docs for Bunny are mostly missing. persistent
connections are PHP feature - http://php.net/manual/en/function.stream-socket-client.php#105393 when you could reuse single TCP connection shared among multiple requests. It doesn't make sense implemented like this for AMQP, I really don't know, why I implemented this option at all 😇
Hm, is bunny actively maintained? Would be nice to have documentation (your cap)