Loripetal, what type of magnesium are you taking? The most bioavailable is magnesium bisglycinate. The dosage is 1000 mg daily, split over 3 doses of 133 mg. I sleep well on this, taking the final capsule about one hour before bedtime.
Could you clarify which B vitamin you are taking, as your heading says B3 but the post says B6. (B3 is niacin, B6 is pyridoxine.) Actually I don't take either of these, so wouldn't be able to help anyway! But I'm sure someone on the forum will have the answer.
JP x