[
https://issues.apache.org/jira/browse/QPID-7677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15881513#comment-15881513
]
ASF subversion and git services commented on QPID-7677:
-------------------------------------------------------
Commit 4e393bdfaba0b52cf5d9ee9b254b7814ee43e4ba in qpid-cpp's branch
refs/heads/master from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-cpp.git;h=4e393bd ]
QPID-7677: C++ broker AMQP 1.0 subscription uses more memory than 0-10
AMQP 1.0 allocates a per-session buffer for unacknowledged message
deliveries. By default it holds up to 5000 deliveries. This commit adds the
qpidd option --session-max-unacked so the buffer can be made smaller if the
broker has a large number of sessions and the memory overhead is a problem.
The following values (in Kb) give an idea of the overhead per session, the
actual values will vary by platform and build type:
RSS per client for AMQP 0.10: 142
RSS per client for AMQP 1.0
qpidd --session-max-unacked=100: 227 (diff 85)
qpidd --session-max-unacked=1000: 349 (diff 207)
qpidd --session-max-unacked=5000: 846 (diff 704)
The broker sending messages on a session without waiting for acknowledgement up
to the session-max-unacked limit (it may stop sending before the limit if the
aggregate link credit for the session is lower.) Once it reaches the limit it
will wait for acknowledgement from the client before sending more messages.
> [C++ broker] broker requires much more memory for AMQP1.0 subscription than
> for 0-10 one
> ----------------------------------------------------------------------------------------
>
> Key: QPID-7677
> URL: https://issues.apache.org/jira/browse/QPID-7677
> Project: Qpid
> Issue Type: Improvement
> Components: C++ Broker
> Affects Versions: 0.32
> Reporter: Pavel Moravec
> Labels: memory
> Attachments: memdiff.sh
>
>
> Having an AMQP 1.0 consumer of a queue increases memory usage of qpidd by
> much more than having an AMQP 0-10 consumer - the difference is approx. 0.5MB.
> This affects scalable usage of the broker, where having thousands of 1.0
> consumers require gigabytes of memory.
> Trivial test:
> {code}
> qpid-config add queue qqq
> for i in $(seq 1 10); do qpid-receive -a qqq -f & sleep 0.1; done
> # this added small 26kB VSZ and 75kB RSS per one consumer/receiver
> for i in $(seq 1 10); do qpid-receive -a qqq -f --connection-options
> "{protocol:'amqp1.0'}" & sleep 0.1; done
> # this added 640kB VSZ and 805kB RSS per one consumer/receiver
> {code}
> Better test: have multiple consumers on the same AMQP connection (I can
> provide such program in case of interest).
> Running such scenario under valgrind/massif showed the extra memory is
> consumed by:
> ->91.90% (143,361,792B) 0x5D544F1:
> qpid::broker::amqp::OutgoingFromQueue::OutgoingFromQueue(qpid::broker::Broker&,
> std::string const&, std::string const&,
> boost::shared_ptr<qpid::broker::Queue>, pn_link_t*,
> qpid::broker::amqp::Session&, qpid::sys::OutputControl&,
> qpid::broker::SubscriptionType, bool, bool) (Outgoing.h:57)
> And really, when I changed in:
> https://github.com/apache/qpid-cpp/blob/master/src/qpid/broker/amqp/Outgoing.cpp#L68
> the "deliveries(5000)" to "deliveries(50)", memory consumption dramatically
> decreased.
> I don't understand this part of code, but please make the
> "CircularArray<Record> deliveries(5000)" more memory efficient.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]