I was prescribed melatonin by a doctor, and the dose went up little by little from 3mg to 10mg before we decided it didn't work for me. Sure it helped me fall asleep, but then I woke up a few hours later and couldn't sleep again. Years later I have started taking 0.5mg (1mg is the smallest pill I could find, and I split them in two) and it's much better that way.
Low-dose doxepin (3mg) has also helped, but I find that I have to take breaks from it, because it stops working after a while. This dose is much lower than the usual dose for depression, but a local pharmacy manufactures the pills based on a doctor's prescription.