If you are an AWS user with EC2 instances running, you may have already gotten an email from AWS informing you that your instance(s) will be rebooted in the near future. I'm not exactly sure what is prompting this massive rebooting binge but the good folks at AWS have actually provided a new EC2 API request just so you can find out about upcoming maintenance events planned for your instances.
We just committed code to boto that adds support for the new DescribeInstanceStatus request. Using this, you can programmatically query the status of any or all of your EC2 instances and find out if there is a reboot in their future and, if so, when to expect it.
Here's an example of using the new method and accessing the data returned by it.
Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
Wednesday, December 7, 2011
Friday, October 14, 2011
Does Python Scale?
I wonder how many times I've been asked that question over the years. Often, it's not even in the form of a question (Sorry, Mr. Trebek) but rather stated emphatically; "Python doesn't scale". This can be the start of long, heated discussions involving Global Interpreter Locks, interpreters vs. compilers, dynamic vs. static typing, etc. These discussions rarely end satisfactorily for any of the parties involved. And rarely are any opinions changed as a result.
So, does Python scale?
Well, YouTube is written mostly in Python. DropBox is written almost entirely in Python. Reddit. Quora. Disqus. FriendFeed. These are huge sites, handling gazillions of hits a day. They are written in Python. Therefore, Python scales.
Yeah, but what about that web app I wrote that one time. Hosted on a cheapo, oversubscribed VPS, running straight CGI talking to a remote MySQL database running in a virtual machine on my Macbook Air. That thing fell over like a drunken sailor when I invited a few of my friends to go check it out. So, yeah. Forget what I said before. Obviously Python doesn't scale.
The truth is, it's the wrong question. The stuff that allows Dropbox to store a million files every 15 minutes has little to do with Python just as the things that caused my feeble web app to fail had little to do with Python. It has to do with the overall architecture of the application. How databases are sharded, how loosely or tightly components have been coupled, how you monitor, and how you react to the data your monitoring is providing you. And lots of other stuff. But you have to deal with those issues no matter what language you write the system in.
No reasonable choice of computer language is going to guarantee your success or your failure. So pick the one you are most productive in and focus on properly architecting your app. That scales.
So, does Python scale?
Well, YouTube is written mostly in Python. DropBox is written almost entirely in Python. Reddit. Quora. Disqus. FriendFeed. These are huge sites, handling gazillions of hits a day. They are written in Python. Therefore, Python scales.
Yeah, but what about that web app I wrote that one time. Hosted on a cheapo, oversubscribed VPS, running straight CGI talking to a remote MySQL database running in a virtual machine on my Macbook Air. That thing fell over like a drunken sailor when I invited a few of my friends to go check it out. So, yeah. Forget what I said before. Obviously Python doesn't scale.
The truth is, it's the wrong question. The stuff that allows Dropbox to store a million files every 15 minutes has little to do with Python just as the things that caused my feeble web app to fail had little to do with Python. It has to do with the overall architecture of the application. How databases are sharded, how loosely or tightly components have been coupled, how you monitor, and how you react to the data your monitoring is providing you. And lots of other stuff. But you have to deal with those issues no matter what language you write the system in.
No reasonable choice of computer language is going to guarantee your success or your failure. So pick the one you are most productive in and focus on properly architecting your app. That scales.
Tuesday, February 22, 2011
Accessing the Internet Archive with boto
A recent tweet from Pete Skomoroch twigged me to the fact that the Internet Archive provides an S3-like API. Cool! The Internet Archive is a great resource which provides, in their words:
Once you have your credentials, the easiest thing to do is to add the credentials to your boto config file. They need to go in the Credentials section like this:
Then, you can create a connection to the Internet Archive like this:
I've only tested this a bit so if you run into any problems with it, post a message to boto-users or create an issue.
...a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, and the general public.Since boto supports S3 I wondered if it would be possible to access the Internet Archive's API with boto. Turns out, it's quite simple. To make it even simpler, I've added a new "connect_ia" method. Before you can use this, you need to get API credentials from the Internet Archive but fortunately that's really easy. Just sign up for an account (if you don't already have one) and then go to this link to generate the API keys.
Once you have your credentials, the easiest thing to do is to add the credentials to your boto config file. They need to go in the Credentials section like this:
Then, you can create a connection to the Internet Archive like this:
I've only tested this a bit so if you run into any problems with it, post a message to boto-users or create an issue.
Subscribe to:
Posts (Atom)