Hosting Drupal on Amazon EC2

12,013
-1

Published on

I spoke about how to host Drupal in the cloud at Drupalcamp Prague, 2009.

Published in: Technology
1 Comment
10 Likes
Statistics
Notes
  • I just finished setting up a Drupal 6 site on EC2 and it's awesome! No standard hosting service can touch it for performance vs. price. Drupal has a backup module that dumps database backups to my Amazon S3 bucket, making a site restore a single-click operation.

    As for getting Drupal on EC2, I used TurnKeyLinux.org, since they have free, pre-made Drupal 6 appliances that automatically deploy new machines via their TurnKey Hub for EC2. Very little Linux knowledge is necessary, and all administration is done via web interfaces for Apache, PHP, and MySQL. All OS updates are automatic, and the core appliance application can be updated via the Debian APT-GET command. TKL also had a backup solution that can completely restore your site from backup in a matter of seconds, in case your EC2 instance is terminated (usually, only possible by the admin or an Amazon failure).

    It's the fastest and easiest way to get a high-performance, secure Drupal site up and running and easily maintain it, but with full control over the OS.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
12,013
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
73
Comments
1
Likes
10
Embeds 0
No embeds

No notes for slide

Hosting Drupal on Amazon EC2

  1. 1. About me <ul><li>Kornel Lugosi (Coornail)
  2. 2. Student at University of Szeged
  3. 3. Drupal developer @ Pronovix
  4. 4. Linux enthusiastic </li></ul>
  5. 5. How to use Amazon EC2 for Drupal
  6. 6. My idea about “ Why this #$%$@&^% thing is not working? ” <ul><li>Time -> </li></ul>
  7. 7. Hosting solutions <ul><li>Webhosting </li><ul><li>Initial cost is cheap
  8. 8. Monthly cost is cheap
  9. 9. Is it reliable?
  10. 10. No customization
  11. 11. No server maintenance </li></ul></ul>
  12. 12. Hosting solutions <ul><li>Virtual Private Server </li><ul><li>Initial cost is moderate
  13. 13. Monthly cost is moderate
  14. 14. Is it reliable?
  15. 15. Is it fast?
  16. 16. Full customization
  17. 17. You have to maintain the software
  18. 18. Usually the memory is quite limited </li></ul></ul>
  19. 19. Hosting solutions <ul><li>Dedicated Server </li><ul><li>Initial cost is very high
  20. 20. Monthly cost is cheap
  21. 21. Is it reliable?
  22. 22. It's fast
  23. 23. Full customization
  24. 24. You have to maintain the software and the hardware </li></ul></ul>
  25. 25. Hosting solutions <ul><li>Amazon cloud </li><ul><li>Initial cost is moderate
  26. 26. Monthly cost is moderate
  27. 27. Is it reliable?
  28. 28. Full customization (even in the hardware in minutes)
  29. 29. You have to maintain the software (and that's harder here) </li></ul></ul>
  30. 30. About amazon ec2 <ul><li>Virtualised Hardwares (Instances)
  31. 31. Distributed
  32. 32. Dynamically scalable </li></ul>
  33. 33. Some terms
  34. 34. “ My server is fast and strong, why would I need that?”
  35. 35. Maybe you'll need more servers... like tomorrow
  36. 36. Hardware will eventually break down
  37. 37. You don't have to worry about those ^^
  38. 38. That's not true <ul><li>Errors can be present at the software level in the AMI
  39. 39. Nothing guarantees that if you start a server instance it will run 'til the end of time
  40. 40. The AMI s storage is not permanent! </li></ul>
  41. 41. What happens if an instance gets terminated? <ul><li>Your data is lost </li></ul>
  42. 42. Permanent storage <ul><li>S3 ( S imple S torage S ervice) </li><ul><li>Does n't store files
  43. 43. Stores “ objects ”, “ buckets ” and “ keys ”
  44. 44. You have to design the application to use it
  45. 45. “ There is a module for that” : project/amazon_s3 </li></ul></ul><ul><li>EBS ( E lastic B lock S tore ) </li><ul><li>Provides traditional block devices
  46. 46. It can store any filesystem (and any file ) </li></ul></ul>
  47. 47. Permanent storage <ul><li>S3 ( S imple S torage S ervice) </li><ul><li>Backing up EBS -s
  48. 48. Upload bundled AMIs </li></ul></ul><ul><li>EBS ( E lastic B lock S tore ) </li><ul><li>Mount it (in a specific region)
  49. 49. Store your drupal files and database on it! ( /var, and /home propably ) </li></ul></ul>
  50. 50. Tools <ul><li>Command line tools </li><ul><li>To create new AMI s
  51. 51. You can automatize things!
  52. 52. (Write aliases for the keys)
  53. 53. Browsing images not working in the eu? Seriously? </li></ul></ul>
  54. 54. Command line
  55. 55. Tools <ul><li>Web console </li><ul><li>Limted features
  56. 56. What works, works great
  57. 57. You cannot boundle images </li></ul></ul>
  58. 58. Web console
  59. 59. Tools <ul><li>Elasticfox </li><ul><li>Laggy responsiveness
  60. 60. No feedback that it's doing anything
  61. 61. It has a lot of options (and almost everything is working)
  62. 62. ( Install it in a different profile ) </li></ul></ul>
  63. 63. Elasticfox
  64. 64. Other tools <ul><li>S3 firefox organizer (still, those are not files) </li></ul>
  65. 65. Performance is money <ul><li>Bandwidth </li><ul><li>mod_gzip ( check Drupals js/css mime types! )
  66. 66. mod_expire
  67. 67. ssh -C ( I mean we're talking about linux, right? )
  68. 68. ( net.ipv4.tcp_tw_reuse = 1 )
  69. 69. ( net.ipv4.tcp_tw_recycle =1 ) </li></ul><li>Memory </li><ul><li>pecl install apc
  70. 70. Apache mod_fastcgi / nginx + *fcgi </li></ul></ul>
  71. 71. The legend of disk IO <ul><li>It's not legendary slow, but slow
  72. 72. Bandwidth is okay, latency is slow </li></ul>
  73. 73. Stop whining, there's a workaround <ul><li>Save on memory -> faster disc io </li><ul><li>apc.ini: apc.shm_size=&quot;[bignumber]&quot;
  74. 74. Start using fastcgi (it has almost constant memory consumption -> filecache lives longer) </li></ul><li>Optimize disk io </li><ul><li>Use noop scheduler ( echo noop > /sys/block/sda/queue/scheduler )
  75. 75. Use noatime , nodiratime ( /etc/fstab )
  76. 76. (Use ext4, data=writeback ) </li></ul></ul>
  77. 77. Stop whining, there's a workaround <ul><li>php.ini : realpath_cache_size=1M
  78. 78. Use multisite (apc cache)
  79. 79. (Consider using nginx ?) </li></ul>
  80. 80. Relational Database Service <ul><li>You can outsource mysql ! (costs a lot)
  81. 81. Full mysql 5.1 compilance (they said)
  82. 82. More instances can use it! </li></ul>
  83. 83. Still want to use it? <ul><li>We do =)
  84. 84. Not fitting for everybody </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×