It may not be a good idea to host your WordPress blog on Amazon EC2 micro instance without properly configuring Apache and Mysql. Based on my experience in the past week, Apache had been eating 300M+ memory and Mysql kept shutting down once a day.
A piece of Mysql error messge at /var/log/mysql.log
is:
130507 12:30:52 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(135987200 bytes) failed; errno 12
130507 12:30:52 InnoDB: Completed initialization of buffer pool
130507 12:30:52 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130507 12:30:52 [ERROR] Plugin ‘InnoDB’ init function returned error.
130507 12:30:52 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
130507 12:30:52 [ERROR] Unknown/unsupported storage engine: InnoDB
130507 12:30:52 [ERROR] Aborting
130507 12:30:52 [Note] /usr/libexec/mysqld: Shutdown compete
If your blog is just a personal one (not a news center with hundreds of thousands of PV), to avoid the issues I was having you may need to configure Apache and Mysql in this way:
Apache:
Edit /etc/httpd/conf/http.conf
, search for section “Server-Pool Size Regulation” and change the default setting to:
StartServers 3
MinSpareServers 2
MaxSpareServers 5
MaxClients 10
MaxRequestsPerChild 1000
then run sudo service httpd restart
, restarting Apache to apply the change.
Apache memory usage was reduced from 750M to around 200M.
Mysql
Simply copy the one of sample setting files to etc by
cp /usr/share/mysql/my-small.cnf /etc/my.cnf
my-small.cnf
is optmized for small server as its name suggests. If this configuration cannot satisfy your need, perhaps what you really need is a EC2 small instance or even bigger.
Additionally I recommend some cool tools/services for optimizing/monitoring your blog: