context: If migraines are a regular part of your life, you may want to tweak your sleep schedule. Quality shut-eye is one of the keys to preventing a headache attack. Most folks with migraines also have sleep problems, such as trouble falling or staying asleep. Sometimes headaches are the cause of your sleep problems. But there's also evidence it works the other way: Too little or too much sleep can trigger migraines. Sleep, mood, and headaches are all controlled by common regions in your brain. They all use similar chemical brain messengers, so it's no coincidence that sleep problems can trigger migraines. Also, when you don't get enough sleep, your pain threshold gets lower. That means you're more sensitive to things that hurt, including a migraine attack. Anything that keeps you from getting 7 or 8 hours of uninterrupted sleep each night could be a migraine trigger. These sleep problems include: Obstructive sleep apnea (interrupted breathing during sleep) Insomnia (trouble falling or staying asleep) Restless legs syndrome ("pins and needles" feeling in legs, especially at night) Jaw clenching during sleep Snoring Narcolepsy (too much daytime sleepiness) Sleepwalking Circadian rhythm or "body clock" disorders Less than 6 hours of sleep a night or more than 8.5 hours Shift work or jet lag Night terrors (in children) If an altered sleep schedule or sleep problems are behind your migraines, you might notice that you always get headaches at the same time every day, most often in the morning. Your migraine may also wake you up, or you may feel it coming on shortly after you get out of bed. More than half of migraines happen between 4 and 9 a.m., and this may be because they're linked to sleep. Even if you don't notice this pattern, your migraines could still be linked to a sleep disorder, lack of sleep, or changes in your sleep schedule. To help pinpoint whether patterns in your sleep make you more likely to get migraines, keep a migraine diary. Write down things like: When your headache begins, where the pain is, how long it lasts, and whether treatment works How much sleep you get each night and when you go to bed Your bedtime routine Whether you wake up during the night How you feel when you get up in the morning Whether you take naps or feel sleepy during the day Besides revealing patterns in your migraine attacks, a diary may help you and your doctor figure out if you have a sleep disorder. If you have signs of obstructive sleep apnea, see your doctor to get the right treatment. It may help prevent migraines. Symptoms of the sleep disorder include: Snoring Pauses in breathing while sleeping Waking up during the night Sleepiness during the day If you can't sleep more than 6 hours a night, talk to your doctor about whether you may have insomnia that can be treated. Treatments, including medications, diet changes, and behavioral sleep therapy, can also help prevent migraines if they're triggered by poor sleep. Try to get 7 to 8 hours of uninterrupted sleep every night at a consistent time. It's a key to preventing migraine headaches. To help improve your sleep, try these tips: Go to bed and wake up at the same times every day. Get 7 to 8 hours of sleep. Make the room you sleep in dark and quiet. Avoid caffeine, nicotine, and alcohol. Try not to watch TV, use the computer, or text on your cellphone in bed just before you go to sleep. Do relaxing activities at bedtime. Exercise regularly, but not right before bed. Spend some time outside in natural light during the day.