MySQL, RAM disk for tmpdir - how to figure out what size it should be?
This is a really interesting question. 

You could check the 

SHOW GLOBAL STATUS like 'Created_tmp_disk_tables';


But that only gives you the overall number of tables created (or the delta, if you subtract that value between two points of time), but not the actual size needed.

You could go the "logical" wayin MySQL 5.6, configuring performance_schema in order to log a certain amount of queries, enough to check how many temporary tables are being created. You can find those on 

performance_schema.events_statements_history/events_statements_history_long


On the CREATED_TMP_DISK_TABLES and CREATED_TMP_TABLES. That will give you more information about the type of temporary tables created, but still no information on the actual number or rows written or the size at a moment in time.

I would probably check it the physical way (assuming a UNIX-like OS), by something like this:

sudo lsof -s | awk '{if ($1 == "mysqld" &amp;&amp; $9 ~ /\/tmp/) size+=$7} END {print size}'


Checking the total size of files that the mysqld process has open on /tmp along time may give you a better indication, assuming you monitor that at your peak time, or a significant amount of time.