I worte this python script that acts as an RPC server by modifying the default RPC example in the RabbitMQ tutorial found here . It works great on my laptop. But when I run it in amazon ec2 High CPU Medium Instance with these specifications:
1.7 GB of memory
5 EC2 computing units (2 virtual cores with 2.5 EC2 computing units)
350 GB instance storage
It occupies a 100% processor. Although my laptop with almost the same configuration works with less than 4% of CPU usage. I run this on Ubuntu-12.04 on both my laptop and Amazon.
Here is my code
#!/usr/bin/env python import pika import commands import socket import base64 connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.queue_declare(queue='rpc_queue') def on_request(ch, method, props, body):
How can i fix this?
source share