Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message rates stop at 25 msg/s #7

Closed
sliver opened this issue Oct 6, 2011 · 6 comments
Closed

Message rates stop at 25 msg/s #7

sliver opened this issue Oct 6, 2011 · 6 comments

Comments

@sliver
Copy link
Contributor

sliver commented Oct 6, 2011

I have a simple command

config.yml:

producers:
    my-producer':
        connection: default
        exchange_options: {name: 'my-producer', type: direct}

SimpleCommand.php

    ...
    $producer = $this->getContainer()
            ->get('old_sound_rabbit_mq.my-producer');

    for($i = 0; $i < 10000; $i++) {
        $producer->publish('for_test');
    }
    ...

It runs correctly but the message rates display on the RabbitMq management is alway 25 msg/s.
Run 2 process at the same time can get 50 msg/s.

At the same machine, I can get about 2000 msg/s using node-amqp.
Do I miss something?

debian 6
symfony 2.0.3
rabbitmq-server version 2.6.1 / R14A

@videlalvaro
Copy link
Collaborator

I'll have to look into more details into this… but as a quick answer I've had a latency of 1 message taking 2ms for an RPC request. So something must be missconfigured

@sliver
Copy link
Contributor Author

sliver commented Oct 13, 2011

I find exchange_declare() may be the key. (RabbitMq/Producer.php, line:11)
When move it out of the publish() method, I can get about 1500 msg/s.

@videlalvaro
Copy link
Collaborator

You are right… that line shouldn't be there. I will try to understand why I put it there in the first place.

@infernojaxon
Copy link

maybe this willl helpful

public function exchangeDeclare()
{
    $this->ch->exchange_declare($this->exchangeOptions['name'], $this->exchangeOptions['type'], false, true, false);
}

public function publish($msgBody, $routingKey = '')
{
    $msg = new \AMQPMessage($msgBody, array('content_type' => 'text/plain', 'delivery_mode' => 2));
    $this->ch->basic_publish($msg, $this->exchangeOptions['name'], $routingKey);
}

videlalvaro added a commit that referenced this issue Nov 24, 2011
The code also addressed issues #7 and #11
@videlalvaro
Copy link
Collaborator

Fixed. Please confirm. Later I will add my benchmark code.

@sliver
Copy link
Contributor Author

sliver commented Nov 28, 2011

Got 1700+ msg/s. Event performance is better.

mihaileu added a commit to mihaileu/RabbitMqBundle that referenced this issue Feb 28, 2020
improve documentation for v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants