Upgrade to 4.6.6 : how to configure mysql server?
A lot depends on how much data you maintain in terms of contacts, participants, members, etc.  

I have seldom seen any recent install of CiviCRM (on Drupal 7) running well on anything less than 1 gig, and I always recommend at least 1.5 gig; usually 2 gig.

Sorry, but I suspect no amount of MySQL tuning is going to give you what you need with only 512M.