Repair by Sort not working
The tmp tables won't be in /mysql/data, but rather in the subdirectory corresponding to the database.  Or maybe in the tmpdir directory.

key_buffer_size = 2344M -- that is just for indexes.  In a 4GB machine, that does not leave enough room for data.  Change it to 700M.

thread_cache_size -- 0 is better for Windows.

query_cache_size=132M -- too big; drop to 50M

max_allowed_packet=156M -- Probably too high.  Suggest 32M.

None of those necessarily explain the symptoms you have.  Can you tell if mysql is "swapping"?  If it is, that would be deadly, and my suggestions would probably prevent swapping.

Is the "repair" because of a crash?  If so, you should seriously consider switching to InnoDB.  At least put it on your roadmap.  But be aware that the disk footprint with be 2-3 times as big.

"Repair by sorting" would, I think, proceed as follows:


Load all the data into the #sql...MYD file.  Meanwhile the .MYI file would be 1K or empty.
Read the data, sort it, and load it into the .MYI for one index.
Ditto for second index.


I do not know if having two unique index complicates things, and necessitates use of the key_buffer.