1

Cross-posted from StackOverflow:

I wrote a little toy script to solve this type of game, and put it on my new micro EC2 instance. It works perfectly, but while it takes around 0.5 seconds to run a local version, and takes under 0.5 seconds to run both the local and the bottle.py version on my home computer, running the bottle.py version on the EC2 instance takes over 2 minutes.

Python has the cpu pegged at 99% the entire time. Only 7.4% memory usage, consistently, and no swapping. The only guess I have is initialization time for bottle.py on EC2, but if it were that, why would it be ~200x faster on my own computer with bottle.py?

user61633
  • 136
  • 5
  • Out of curiosity, which `pybloomfilter` are you using? I'm getting "TypeError: too many initializers" on the `scrambled =` line. Or is there something else that's causing that error? – Dennis Williamson Dec 20 '10 at 18:44
  • Instead of pybloom, I went with [pybloomfiltermmap](http://github.com/axiak/pybloomfiltermmap) from [this post](http://stackoverflow.com/questions/311202/modern-high-performance-bloom-filter-in-python). It works fantastically well in every use case except when called by bottle.py on EC2. – user61633 Dec 20 '10 at 20:11

1 Answers1

1

Amazon micro instances only guarantee a small amount of CPU, but will occasionally burst additional CPU resources. If you have a CPU intensive script, it will run slowly on a micro instance most of the time by design. More information is in the Amazon announcement here:

http://aws.amazon.com/about-aws/whats-new/2010/09/09/announcing-micro-instances-for-amazon-ec2/