hosting drupal on amazon ec2
TRANSCRIPT
About me
Kornel Lugosi (Coornail)
Student at University of Szeged
Drupal developer @ Pronovix
Linux enthusiastic
How to use Amazon EC2 for Drupal
My idea about Why this #$%$@&^% thing is not working?
Time
Hosting solutions
WebhostingInitial cost is cheap
Monthly cost is cheap
Is it reliable?
No customization
No server maintenance
Hosting solutions
Virtual Private ServerInitial cost is moderate
Monthly cost is moderate
Is it reliable?
Is it fast?
Full customization
You have to maintain the software
Usually the memory is quite limited
Hosting solutions
Dedicated ServerInitial cost is very high
Monthly cost is cheap
Is it reliable?
It's fast
Full customization
You have to maintain the software and the hardware
Hosting solutions
Amazon cloudInitial cost is moderate
Monthly cost is moderate
Is it reliable?
Full customization (even in the hardware in minutes)
You have to maintain the software (and that's harder here)
About amazon ec2
Virtualised Hardwares (Instances)
Distributed
Dynamically scalable
Some terms
My server is fast and strong, why would I need that?
Maybe you'll need more servers... like tomorrow
Hardware will eventually break down
You don't have to worry about those ^^
That's not true
Errors can be present at the software level in the AMI
Nothing guarantees that if you start a server instance it will run 'til the end of time
The AMIs storage is not permanent!
What happens if an instance gets terminated?
Your data is lost
Permanent storage
S3 (Simple Storage Service)Doesn't store files
Stores objects, buckets and keys
You have to design the application to use it
There is a module for that: project/amazon_s3
EBS (Elastic Block Store)Provides traditional block devices
It can store any filesystem (and any file)
Permanent storage
S3 (Simple Storage Service)Backing up EBS-s
Upload bundled AMIs
EBS (Elastic Block Store)Mount it (in a specific region)
Store your drupal files and database on it! (/var, and /home propably)
Tools
Command line toolsTo create new AMIs
You can automatize things!
(Write aliases for the keys)
Browsing images not working in the eu? Seriously?
Command line
Tools
Web consoleLimted features
What works, works great
You cannot boundle images
Web console
Tools
ElasticfoxLaggy responsiveness
No feedback that it's doing anything
It has a lot of options (and almost everything is working)
(Install it in a different profile)
Elasticfox
Other tools
S3 firefox organizer (still, those are not files)
Performance is money
Bandwidthmod_gzip (check Drupals js/css mime types!)
mod_expire
ssh -C (I mean we're talking about linux, right?)
(net.ipv4.tcp_tw_reuse = 1)
(net.ipv4.tcp_tw_recycle =1)
Memorypecl install apc
Apache mod_fastcgi / nginx + *fcgi
The legend of disk IO
It's not legendary slow, but slow
Bandwidth is okay, latency is slow
Stop whining, there's a workaround
Save on memory faster disc ioapc.ini: apc.shm_size="[bignumber]"
Start using fastcgi (it has almost constant memory consumption filecache lives longer)
Optimize disk ioUse noop scheduler (echo noop > /sys/block/sda/queue/scheduler)
Use noatime, nodiratime (/etc/fstab)
(Use ext4, data=writeback)
Stop whining, there's a workaround
php.ini: realpath_cache_size=1M
Use multisite (apc cache)
(Consider using nginx?)
Relational Database Service
You can outsource mysql! (costs a lot)
Full mysql 5.1 compilance (they said)
More instances can use it!
Still want to use it?
We do =)
Not fitting for everybody
ec2Elastic Cloud Computing
s3Simple Storage Service
AMIAmazon Machine Image
EBSElastic Block Store
RDSRelational Database Service
OMG ec2 is 1337!!11I like amazon's cloud computing solution
???Page ??? (???)11/01/2009, 13:56:28Page /