Skip to content

Instantly share code, notes, and snippets.

@johanrhodin
Last active September 13, 2021 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanrhodin/87a54361ddebc2c09c015d991385e329 to your computer and use it in GitHub Desktop.
Save johanrhodin/87a54361ddebc2c09c015d991385e329 to your computer and use it in GitHub Desktop.
Shovel issue were memory accumulates in connection writer and binaries.
# 1. On serverA Create a queue with 1M messages
bin/runjava com.rabbitmq.perf.PerfTest -y0 -p -u "q1" \
-s 1000 --id "q1" -ad false -f persistent \
-h $serverA \
-pmessages 1000000
# 2. On server B trigger the memory alarm.
sudo rabbitmqctl set_vm_memory_high_watermark 0
# 3. Shovel messages between Server A and B
curl -v -XPUT https://username:passwd@$serverA/api/parameters/shovel/czasrvyx/my-shovel \
-H "content-type: application/json" \
-d @- <<EOF
{
"value": {
"src-protocol": "amqp091",
"src-uri": "amqp:///czasrvyx",
"src-queue": "q1",
"dest-protocol": "amqp091",
"dest-uri": "amqps://username:passwd@server-2.rmq2.cloudamqp.com/zwgtwixg",
"dest-queue": "q2",
"ack-mode": "on-publish",
"src-prefetch-count": 1
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment