tag:blogger.com,1999:blog-7774229.post5270198575839374119..comments2008-11-30T09:04:47.363-08:00Comments on Space Program Blog: Third App Migrated to Amazon EC2Travis Reedernoreply@blogger.comBlogger20125tag:blogger.com,1999:blog-7774229.post-48596907459960076292008-11-30T09:04:00.000-08:002008-11-30T09:04:00.000-08:002008-11-30T09:04:00.000-08:00The space program is a complete of tax dollars. A...The space program is a complete of tax dollars. All those engineers should be secretaries. That's all I have to say.Controversy23http://www.blogger.com/profile/07760247928196876450noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-14601862267804179312007-11-28T22:25:00.000-08:002007-11-28T22:25:00.000-08:002007-11-28T22:25:00.000-08:00Hi - I'm an EC2 user and I have two Amazon EC2 ins...Hi - I'm an EC2 user and I have two Amazon EC2 instances to call Facebook's API. The problem I have is with the network latency between apps.facebook.com and EC2, it's about 78ms per ping. Have you experienced latency problems too? - MarkSpoontastichttp://www.blogger.com/profile/08869713675021213537noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-12783847498834570962007-08-10T18:53:00.000-07:002007-08-10T18:53:00.000-07:002007-08-10T18:53:00.000-07:00taylor: If you get Prevayler working, I'd like to ...taylor: If you get Prevayler working, I'd like to hear about it. An interesting idea, but I'd imagine that you'd have to be pretty sure that your database would never get big.<BR/><BR/>As for getting java on an instance, check out <A HREF="http://blog.spaceprogram.com/2007/08/downloading-jdk-to-your-linux-server.html" REL="nofollow">this step by step on how to get the JDK onto your server</A>.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-31874025361530578052007-08-10T14:09:00.000-07:002007-08-10T14:09:00.000-07:002007-08-10T14:09:00.000-07:00Great advice, I'm considering using Prevayler (jav...Great advice, I'm considering using Prevayler (java in memory persistence) mapped to s3...although I must confess, I'm still stuck on the task of just getting an instance with a JDK on it.<BR/><BR/>I tried mget to sun, but that's not workable...I guessing I'm going to have to upload the jdk rpm to my s3, and get it from there.<BR/><BR/>How did you do it?Taylorhttp://www.blogger.com/profile/12814369929329235023noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-34906592100992006252007-07-20T08:20:00.000-07:002007-07-20T08:20:00.000-07:002007-07-20T08:20:00.000-07:00Have you had a chance to look at RightScale, www.r...Have you had a chance to look at RightScale, www.rightscale.com. Their interface will help you address most all of these items.Richard Shadehttp://www.blogger.com/profile/17658769180953626692noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-7048153707565314812007-06-25T09:02:00.000-07:002007-06-25T09:02:00.000-07:002007-06-25T09:02:00.000-07:00Travis,Not bandwidth, latency. The profile of web...Travis,<BR/><BR/>Not bandwidth, latency. The profile of web app access to databases is lots of connections with small payloads. Moving a large file around EC2 or from S3 to EC2 doesn't really simulate access speed.<BR/><BR/>What I'm especially interested in is whether the latency between EC2 nodes is such that database clustering (where there has to be some synchronization between nodes) won't work.<BR/><BR/>Thanks.Matthttp://www.blogger.com/profile/14952749740494430159noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-2418290326192972102007-06-25T08:58:00.000-07:002007-06-25T08:58:00.000-07:002007-06-25T08:58:00.000-07:00rahsun, I am not using MySQL S3 Storage Engine. I ...rahsun, I am not using MySQL S3 Storage Engine. I am doing regular backups of the database (check out MySQL binlogging to make this efficient, other db's should have it too).<BR/><BR/>Truthfully, I don't think S3 Storage Engine will ever fly, there is just too much performance loss using http for every database hit.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-89795944556283029962007-06-25T08:54:00.000-07:002007-06-25T08:54:00.000-07:002007-06-25T08:54:00.000-07:00raghus, I meant on a separate EC2 server. I would ...raghus, I meant on a separate EC2 server. I would NOT recommend hosting the database with a different provider, the latency will kill your performance.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-63401308310674428552007-06-22T13:20:00.000-07:002007-06-22T13:20:00.000-07:002007-06-22T13:20:00.000-07:00I am running a Rails/MySQL application and I wante...I am running a Rails/MySQL application and I wanted to see if I could run the DB on a separate server with everything else on EC2. In your point #2, you said "Need performance, put your database on a separate server from app." - did you mean on a separate server within EC2 or a separate server altogether?raghushttp://www.blogger.com/profile/13255950121271408036noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-70023177475215377352007-06-21T11:44:00.000-07:002007-06-21T11:44:00.000-07:002007-06-21T11:44:00.000-07:00travis,That's very interesting. I'll investigate t...travis,<BR/><BR/>That's very interesting. I'll investigate that approach further. It's sounds really cool - IF - I can get that to work. <BR/><BR/>Are you using something like MySQL S3 Storage Engine to do this. Or, are you creating your own custom method to accomplish this?Rahsun McAfeehttp://www.blogger.com/profile/02131620925484487103noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-32573333021075349342007-06-21T09:52:00.000-07:002007-06-21T09:52:00.000-07:002007-06-21T09:52:00.000-07:00"I've got the whole long term, persistent storage ..."I've got the whole long term, persistent storage thing nailed and can do quick recoveries so I am no longer worried about servers crashing... and boy that's a good feeling"....<BR/><BR/>Is it possible to share how you 'nailed' it...the specifics? Many of us would like to know.Jeffhttp://www.blogger.com/profile/01445601668352610941noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-52293681520597953872007-06-20T16:16:00.000-07:002007-06-20T16:16:00.000-07:002007-06-20T16:16:00.000-07:00Rahsun,As an example off the top of my head, lets ...Rahsun,<BR/><BR/>As an example off the top of my head, lets use a webmail scenario with the following table:<BR/><BR/>MailMessage<BR/>- bigint id<BR/>- from varchar (255)<BR/>- to varchar (255)<BR/>- sentDate datetime<BR/>- subject varchar (255)<BR/>- body text <BR/><BR/>The body column will generally be taking up most of the space in this table, and possibly probably also taking up a huge percentage of your entire database. If you have a lot of users, this may soon get out of control. Lets say the average message is 1kB and you have 100 million messages, you now have a 100GB+ database to deal with.<BR/><BR/>So instead of storing the "body" contents in the database, change the body field to a key to the contents in S3:<BR/><BR/>- body_key varchar (64)<BR/><BR/>Or better yet, just use the MailMessage id as the key for S3 then you can drop the body column altogether.<BR/><BR/>Now in your application when the MailMessage is requested, you get the "body" content from S3 on demand. A helper method can make this easy:<BR/><BR/>String body = MyS3Util.get(body_key);<BR/><BR/>So now we've reduced the size of the database big time, 100GB going by the numbers above. Not only that, but the growth rate (and therefore the stress rate) has also been substantially reduced.<BR/><BR/>There are other ways of dealing with this such as partitioning, etc, but the S3 option is very simple and very scalable. <BR/><BR/>Try to find the 10% of your tables that take up 90% of your space and see if this approach can be applied. I'd love to hear your stories.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-10610515486904664622007-06-19T06:12:00.000-07:002007-06-19T06:12:00.000-07:002007-06-19T06:12:00.000-07:00"Keep your database as small as possible. Store as...<I>"Keep your database as small as possible. Store as much data as possible on Amazon Simple Storage System (S3), NOT in your database and just store the S3 key to the data in your database. Consider putting any blob or large text fields in S3. This will make it much easier and faster to manage database backups, plus your database will perform better."</I><BR/><BR/>How exactly does that work?Rahsun McAfeehttp://www.blogger.com/profile/02131620925484487103noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-53191708536476546742007-06-18T23:54:00.000-07:002007-06-18T23:54:00.000-07:002007-06-18T23:54:00.000-07:00Thanks for the tips, Travis. Soooo much to learn, ...Thanks for the tips, Travis. Soooo much to learn, so much!James D Kirkhttp://www.blogger.com/profile/10020936758821484168noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-81404809548927248922007-06-18T19:46:00.000-07:002007-06-18T19:46:00.000-07:002007-06-18T19:46:00.000-07:00Matt, The network between instances and S3 is very...Matt, <BR/><BR/>The network between instances and S3 is very fast. I just pushed a ~2.2 GB file to S3 and it took 3 minutes, 27 seconds. So that's ~10 MB/sec. <BR/><BR/>That being said, if it's data that is accessed and modified a lot, it's kept in a database on an EC2 instance. And I do a lot of caching to reduce the hits on the db and S3.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-70076271787254679052007-06-18T19:30:00.000-07:002007-06-18T19:30:00.000-07:002007-06-18T19:30:00.000-07:00James, I should have also mentioned the forums: ht...James, I should have also mentioned the forums: http://developer.amazonwebservices.com/connect/forum.jspa?forumID=30 , they are your best friend. The Amazon staff are usually very quick to respond on the forums as well.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-22757201438210268912007-06-18T17:59:00.000-07:002007-06-18T17:59:00.000-07:002007-06-18T17:59:00.000-07:00Have you had any issues with latency either betwee...Have you had any issues with latency either between EC2 instances (particularly database and application assuming they're on different machines) or between EC2 and S3?<BR/><BR/>Do you always get the performance you hope for storing data in S3 and accessing it from an EC2 node?<BR/><BR/>Thanks.Matthttp://www.blogger.com/profile/14952749740494430159noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-24879875174385209172007-06-18T17:49:00.000-07:002007-06-18T17:49:00.000-07:002007-06-18T17:49:00.000-07:00James D Kirk, the Getting Started docs in the Reso...James D Kirk, the Getting Started docs in the Resources section will get you up and running, but from then on, it's a lot of trial and error since everyone has different needs and requirements.Travis Reederhttp://www.blogger.com/profile/01398330633165910535noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-68817219499981707062007-06-18T16:42:00.000-07:002007-06-18T16:42:00.000-07:002007-06-18T16:42:00.000-07:00Yes Yes and Yes.Caching is a big deal. The key to...Yes Yes and Yes.<BR/><BR/>Caching is a big deal. The key to scaling EC2 apps is figuring out how to cache as much as possible, and how to chop up and distribute anything CPU intensive.<BR/><BR/>The standard approach to depending on database query caching and master-slave database relationships doesn't scale well in a "horizontal" environment like EC2. The more you can do to avoid real-time database dependencies the happier you'll be!<BR/><BR/>Similarly, you may have to stripe your data across different servers. Think of it like RAID 1, as applied to servers instead of disks.<BR/><BR/>It's a different way of thinking about things that doesn't fit how most web application frameworks interact with databases. So, if you're going to deploy on EC2 and you're expecting a lot of traffic ... a little planning up front will save you a LOT of headaches down the road.<BR/><BR/>Good article!Peathttp://www.blogger.com/profile/13195558907536546015noreply@blogger.comtag:blogger.com,1999:blog-7774229.post-73716321918331598012007-06-18T16:35:00.000-07:002007-06-18T16:35:00.000-07:002007-06-18T16:35:00.000-07:00Not an EC2 user (yet!). Are there some resources y...Not an EC2 user (yet!). Are there some resources you'd recommend to get inundated with the knowledge necessary to become effective with the AWS systems? Thanks.James D Kirkhttp://www.blogger.com/profile/10020936758821484168noreply@blogger.com