It should have the same amount of RAM. In fact, it should have the same hardware configuration.
Here is why:
The MyISAM key cache, InnoDB Buffer Pool, and the query cache will not be filled with the same amount of data. Naturally, the Master will have more data loaded in its caches.
What if you have to fail over to the Slave to be the new Master? You would get what some call a CACHE STORM. It is a condition where you use a Slave with the expectation of running queries you ran on the Master to now run on the Slave. Here is the Storm Part: If the Slave does not have the needed cached data in its caches, it has to spend time reading it from disk. For a Slave, that's just plain brutal.
I would use mk-slave-prefetch on the Slave. Here is what it does: It will read all relay logs, convert INSERTs, UPDATEs, and DELETEs into SELECTs, and run the SELECTs. This will force mysqld on the Slave to populate the MyISAM key buffer and InnoDB Buffer Pool with the required pages of data and index info, making the caches on the Slave resemble the same caches on the Master as close as possible.
This tool you install on the Slave, and run it every minute. When you failover to the Slave, 95% of more of all caches in the Master will be on the Slave (barring Slave Lag).
You are probably wondering why I would look to MAATKIT and not the more advanced Percona Toolkit. Percona did not include mk-slave-prefetch in the Toolkit. Click here to download mk-slave-prefetch.
I have discussed this before
You have benefits to implementing
- Your slave would be ready for failover and would not suffer a cache storm in its initial use.
- You could also use it as a read Slave to reduce read I/O on the Master by using a Load Balanced Read VIP between Master and Slave.
- It could help speed up queries on the Slave for all other operations (reports, audits, etc)
High Availability Setups with Data Redundancy work well with balanced hardware. Users of MySQL Cluster, Percona XtraDB Cluster, Schooner, and Oracle RAC usually have identical configs for hardware on every server. Any server with less automatically makes that server the weakest link in the Cluster.
For MySQL Master/Slave, if the Slave is just for reporting and backups, there may not be an issue. Once you need the Slave for anything beyond reporting and backups, upgrading the hardware so that Master and Slave are identical is an absolute must.
GIVE IT A TRY !!!