Xmg of melatonin is hard to measure, because there's apparently not great accuracy in most OTC pills. And... it may take you days to confirm if a specific pill is 'working' well or not. If/when you find a combination, buy a bunch to have on hand.
I recently received the book "why we sleep" and it discussed melatonin's process. If "1 hour before bed" works for you, that's good, but it never did for me. ~3 hrs did. Or... at least 2-3 hours at this time of the year. My routine has been taking a melatonin between 6 and 7ish, and by 10 I'm typically quite 'ready' for sleep, and it's usually a fast process. It doesn't seem like it in the moment, but my wife has noticed I'm "out like a light" (which I think is more just in comparison to months ago).
Apparently insulin regulation plays a big part in sleep quality, hence the effect of sugar. Another nice side effect is I've lost about 7kg without counting any calories or making any real effort to.