Insomnia can wreak havoc on your health. Most people fail to recognize the importance of sleep.

When you don’t get enough sleep, your cognitive functioning is impaired . (Although there’s a minority of people that whose cognitive performance is unaffected by sleep restriction).

Inadequate sleep also boosts hunger and biases you to eat junk food. Thus it’s not surprising that poor sleep sets the stage for insulin resistance, obesity, and hypertension.

But if you’re reading this article I don’t have to convince you of the value of a good night’s rest.

The Path to Sleep Optimization

So what’s the best way to optimize sleep quality? The best approach depends on your current sleep hygiene.

If you have clinical grade insomnia then positive lifestyle changes may only take you so far. You may want to skip to the section on somnogens (sleep drugs) and sleep-promoting supplements.

Many people are against drugs for sleep but the truth is that some people are biologically unable to get restorative sleep without them. A friend of mine sleeps 8 hours every other day. His insomnia is so severe that he needs a cocktail of drugs, including a benzodiazepine and Xylem. He only takes the cocktail every other day to prevent tolerance to the effects of the drugs.

Though I’m not a physician, I’ve published papers on sleep neurobiology and personally struggled with insomnia. The following tips had the largest impact on my efforts to cultivate more restorative sleep.

Sleep-Healthy Habits

If you want to enhance sleep quality, the first thing you should do is optimize your habits. This is the low-hanging fruit because you don’t need to buy anything, take a supplement or make any radical changes. Daily, seemingly inconsequential choices – like whether you use a laptop in bed – can have a big net effect on sleep quality over time.

When I researched sleep-healthy habits, here’s what I learned:

  • Respect the Clock Ensure that your bedroom is pitch-black at night. Get some black electrical tape to cover up any blinking electronics. Believe it or not, light in you bedroom can disrupt your circadian rhythm. The suprachiasmatic nuclei is a 20,000-neuron brain structure in the hypothalamus that regulates your biological clock. Light exposure at night confuses the clock.
  • Turn down the thermostat A slightly chilly environment facilitates sleep. Most animals (humans included) are entrained to temperature cues. A drop in ambient temperature along with darkness helps with sleep onset.
  • Stop with the video games Avoid overly stimulating activities 30 – 60 minutes before bed. It’s hard to abruptly transition from extremely engaging and stimulating activities like a video game to sleep. Give your brain time to adjust with something low-key. I read Chomsky’s Syntactic Structures before bed and I’m knocked out within 15 minutes.
  • Exercise vigorously. There’s no question that regular exercise enhances sleep quality, but you should avoid it right before bed. Exercise is net-beneficial for sleep quality on so many levels. It increases blood flow to the brain, upregulates neurogenesis, bolsters your antioxidant defense, and your brain responds to vigorous exercise by increasing restorative, slow-wave sleep. But sleep right before bed is activating and can keep you up.
  • The power of rituals. Develop a routine and stick to it. I’m a disorganized night-owl. Left to my own devices I would fall asleep every night at 4 am. But I’ve made a point of develop a routine because it can markedly improve sleep quality. I go to bed at the same time every day. At this point my biological clock is entrained to expect sleep at a very specific time.
  • Take a bath. Kids don’t baths these days. They’re helpful because being immersed in warm water dilates all your blood vessels. This vasodilatory action lowers your blood pressure and facilitates sleep. (Further reading: Influence of nighttime bathing on evening home blood pressure measurements).
  • White noise. White noise helps some people fall asleep, e.g., the sound made by a fan.
  • Know when to quit. If you’ve been tossing and turning for over 30 minutes, get out of bed and do something low-key like reading. Get back in bed when you feel tired again.
  • Drink caffeine-free tea. Sleepy-time tea that contains chamomile has a relaxing effect.
  • Respect the bedroom. Designate your bed for sleep and sex and nothing else. B.F. Skinner was onto something. You’re like a pavlovian dog that forms associations. If you check your email in bed, you won’t associate your bed with sleep. If you designate your bed for sleep you’ll instantly feel sleepy when your head hits the pillow because you’ve formed a behavioral association.
  • Bedtime is sacrosanct. Practice better stress management. I’m an anxious person. My anxiety levels tend to peak at night, which is unfortunate because lying in bed at night is precisely the time of day when you can’t do anything about your problems. Make the evening a sacred time when you’re forbidden from worrying.
  • Sunshine. When you first wake up in the morning, go outside and get some sun. You can also get one of those seasonal affective disorder lights that output a lot of lux. Why? Early morning light intensity is another cue that entrains your circadian rhythm to the environment.
  • Don’t bring your smartphone into bed. Avoid using technology in bed. Trust me. Using your laptop in bed actually violates several of the above suggestions. Your screen emits low-wavelength light that disrupts your biological clock. Computer use is also stimulating, which interferes powering your brain down. Finally, you start to associate your bed with something other than sleep.
  • Drugs. Avoid alcohol, caffeine, and nicotine before bed. I used to naively think that alcohol helps me sleep. Alcohol may decrease your sleep latency (the time it takes to fall asleep). But overall alcohol impairs sleep quality and disrupts your sleep architecture. Drinkers tend to sleep less overall, and their sleep is less restorative. Caffeine and nicotine are CNS stimulants so the rational for avoiding them is self-explanatory.
  • 80/20 Rule. Understand the 80/20 rule and apply it. The idea is that 80% of the effects come from 20% of the causes. The hackneyed example is: 80% of your sales come from 20% of your clients. 20% of the population in Italy own 80% of the land. Apply this principle by cutting out the fat in your life. Start saying no to things you don’t want to do and even some things you do want to do. Hang out with 20% of your friends because this 20% provides 80% of the intimacy and satisfaction in your life. How does this principle apply to sleep? Living the 80/20 will help you feel less overwhelmed, distracted, and pulled in different directors. By focusing on the vital important things in your life, you’ll be better equipped to prioritize sleep.

Bedroom Ambiance

Bedroom feng shui and ambiance affect my sleep quality. I’m disorganized. Naturally I’d try to ignore the mess and sleep in a pile of laundry I procrastinated folding. Here’s what you can do to set the mood:

  • Clean your bedroom and unfuck your habitat.
  • Get anything work-related out of your bedroom (understandably, this may be impossible if you live in NYC or are a college student).
  • Put on some relaxing music.
  • Get a small fountain or white noise machine. Putting on white noise before going to bed is admittedly counterintuitive. Want to sleep better? Simply make a bunch of noise. Sweet dreams.

Recording Sleep Data With Trackers and Apps

Have you ever noticed that once you start tracking an activity by recording data that it’s easier to make it a priority?

Activity tracking is kind of like the gamification of daily chores. It attaches benchmarks – a progress bar – to mundane activities. Here’s a recent publication that explores the gamification of fitness: Gamification of Exercise and Fitness using Wearable Activity Trackers – Springer

A Mundane Example

When I’m wearing a FitBit (one of those devices that records your steps), I’m more likely to take the stairs purely because it’s being tracked. Leverage life analytics because it tricks your brain by making a pedestrian activity feel more rewarding.

How can we apply this concept to sleep optimization?

Many devices track your sleep/wake cycle. These are called actigraphy devices. In this section we’ll compare the currently available sleep trackers.

Here are some other sleep trackers worth investigating: – Fitbit Charge HR – Jawbone UP3 – Beddit Smart 2.0 Sleep Monitor – Sense – Basis Peak – Sleepace Reston – Withings Aura Smart Sleep System

By tracking your sleep cycle, you’ll pay more attention to sleep quality and start to see how your choices affect sleep in aggregate. I’m certainly more motivated to adopt new habits if I can see a long-term upward trend.

In addition to actigraphy devices, check out some apps that can help get you on the right track.

Sleep Apps

You’d think that tracking and optimizing would be a relatively niche thing, right? Maybe I’m just naive. Or maybe the App space is just perversely saturated. But there are scores of Apps that promise to improve sleep quality and record sleep/wake analytics. I’m just skimming the surface here.


No discussion about sleep optimization is complete without mentioning f.lux.

F.lux (free) is my all-time favorite sleep app.

It gradually adjusts the color of your computer’s display according to the time of day.

Your computer’s eerie blue glow is a circadian rhythm disrupter. Blue light is high-frequency and induces a phase delay in your biological clock and inhibits melatonin release. Once you set your timezone, flux will change the output of your display to warmer light when the sun sets.

From the flux founders:

f.lux makes your computer screen look like the room you’re in, all the time. When the sun sets, it makes your computer look like your indoor lights. In the morning, it makes things look like sunlight again. accesses your sleep data by integrating with iPhone’s native Healthkit app.

Healthkit can be populated with sleep data from many different hardware and software sources, or even entered manually. The fact that is a layer on top of existing technology allows it to support many popular sleep trackers.

Some sleep tracking apps that people use are SleepCycle and Sleep++. They allow you to save the data to your phone’s Healthkit, which instantly syncs to Gyroscope.

For a more automatic and passive experience, you can get a sleep tracker for your bed. This can be pricey, but eliminates the need for opening an app every night. recommends the Hello Sense—which can save sleep data to Healthkit. Other sleep tracking devices that integrate with Healthkit, like Withings Aura, are also similarly supported by

SleepCycle Alarm Clock

Transitioning smoothly from sleep to wake is all about timing.

SleepCycle (0.99) alarm clock tracks your sleep patterns using the iPhone’s native accelerometer. You set a window of time (say 7:00 AM – 7:30 AM), and SleepCycle wakes you up when your sleep is lightest. Waking up during light sleep feels more natural than conventional alarm clocks that may jar you awake during deep sleep.

Sleep Time+

Sleep Time+ ($1.99) by Azumio is a rock solid combination of sleep tracking and smart alarm clock. Like other apps, Sleep Time+ uses your iPhone’s accelerometer to measure sleep quality. It alerts you at the optimal time in your cycle. In addition to a detailed analytics dashboard, Sleep Time+ integrates with HealthKit and comes with soundscapes to help you sleep.

Rule Out Diseases That Cause Insomnia

If you’re chronically unable to get restorative sleep, you might have a medical condition without even realizing it.

Insomnia is bedfellow to serious medical conditions, like:

  • Mental illness. Conditions like depression, anxiety, schizophrenia, bipolar disorder are often co-morbid with sleep woes.
  • Sleep apnea. You stop breathing at regular intervals during the night which wakes you up. The result is fragmented, low-quality sleep. Severe sleep apnea results in a state of constant sleep deprivation.
  • Thyroid disease. In hyperthyroidism, your basal metabolic rate is ramped up. Too much thyroid hormone increases your sympathetic, fight-or-flight response which hinders sleep.
  • Nutritional deficiencies. Poor nutrition can impair sleep quality. Here’s just one example: if your dietary intake of magnesium is insufficient, it can make your neurons hyperexcitable. Low magnesium is linked to both anxiety and insomnia.
  • Concussions. Concussions disrupt both wakefulness and sleep architecture.
  • Chronic pain. Why is there such a thing as chronic pain but no chronic pleasure? Clearly we live in a dystopian world. There’s no question that pain can keep you up at night. This is a tough topic to write about because there’s no magic bullet for chronic pain. The best you can do is talk to your pain specialist or GP about a sustainable pain management strategy.
  • Diabetes and obesity. Both diabetes and obesity are liked to reduced total time sleep and poor sleep quality. It’s unclear in which direction causality runs. Does too little sleep predispose to obesity, or vice-versa? It’s well-documented that insufficient sleep up increases your appetite. There may also be some genetic factors at play where a common set of genes predisposes to both obesity and inadequate sleep.
  • Narcolepsy. Paradoxical right? Narcoleptics can actually be sleep deprived because their sleep quality is poor. Some patients with narcolepsy don’t get sufficient slow wave sleep, which is the most restorative. “Narcoleptics are not able to experience the amount of restorative deep sleep that healthy people experience – they are not “over-sleeping”. In fact, narcoleptics live their entire lives in a constant state of extreme sleep deprivation.” [narcoleptics^]

Products Engineered For Sleep

If you’re willing make a major cash outlay to upgrade your sleep, there are entrepreneurs willing to take your money. I discuss sleep trackers above, but there are a number of other products devised to enhance sleep quality.

ZEEQ Smart Pillow

ZEEQ pitches their product as:

The super comfy pillow that plays your music, monitors and reacts to your snoring, analyzes your sleep and intelligently wakes you up.

Smart Bedding

This is pretty cool, but exorbitantly priced. If you’re affluent, go for it! It’s bedding engineered for comfort and durability that snaps into place. The idea is to prevent your sheet from getting tangled. I wish I could make the case that buying this product will improve your sleep quality, but I can’t in good faith.

Coop Home Goods Pillow

This is the best pillow I’ve ever used, hands down. The problem is that now I’m a huge diva when I sleep over at someone’s house because I’ve acclimated to its awe-inspiring comfort.

Over-The-Counter (OTC) Sleep Aids

I’ve benefited from sleep-promoting supplements.

There are so many snake oil salesmen that it can be challenging to figure out which sleep aids are legitimate.

Instead of focusing on particular products, these are the ingredients you should look for.


Your pineal gland naturally releases melatonin in the early evening.

Melatonin doesn’t make you sleepy per se, but it does entrain your biological clock. Melatonin release is a cue that tells your body nighttime is approaching.

There are three things I’ve learned from regularly taking melatonin:

  • Less is more. Many melatonin supplements deliver a dose of 3mg-6mg. This dose is way too high. It results in melatonin levels that are a much as 10-fold higher than endogenous melatonin production. A dose of 0.1mg – 1.5mg is more reasonable.
  • Extended release is where its at. Melatonin’s half-life is super short: 20-50 minutes. But if you look at natural melatonin levels at night, they gradually increase in the late afternoon, peak before bed and drop off while you sleep. The extended release formulation better mimics the normal melatonin wax and wane.
  • Stop taking melatonin right before bed. Most people misuse melatonin. Taking it right before bed will actually cause a phase-delay. That is, it will right-shift your circadian rhythm such that you’ll go to bed later. It’s ideal to take melatonin 2-3 hours before you plan to sleep.


Calm-Aid is among the best lavender supplements. It’s got a cheesy name, but the brand has actual double-blind, placebo-controlled studies to substantiate its claims.

I take lavender religiously, but to honest don’t know that much about it. I’ll defer to the experts here (Examine):

Lavender appears to be able to enhance sleep quality when used as aromatherapy (a plethora of less than desirable quality studies, as blinding is hard to do during aromatherapy), and these benefits should apply to oral supplementation as well. Oral supplementation is 80-160mg of a compound that is 25-46% linalool by weight, and usage of aromatherapy is to a level where you can smell it but it is not overpowering.

It should be noted that lavender appears to have remarkable synergism with lemon balm in regards to acting through the GABAA receptors, and the combination may lead to better sleep. This is currently unexplored in humans, and the potential withdrawal symptoms of the combination also unexplored.


I’m a big fan of supplemental magnesium. Under normal conditions the magnesium ion Mg2+ blocks these excitatory receptors called NMDA receptors.

Specifically, magnesium sits in a pore that prevents the receptor from becoming excessively activated. Magnesium helps regulate the signal-to-noise ratio and protects against excitotoxicity.

If your intake of magnesium is insufficient, it can lead to anxiety and insomnia. There’s very little downside to supplementing with magnesium. While it’s unlikely to be a magic bullet for intractable insomnia, it’s a start.

Combination Sleep Supplements

I’m wary of proprietary blends because most of the time you can buy the individual ingredients more cheaply. Moreover, you have more control over the dose. Some people understandably prefer blends since they’re more convenient.

Medications For Sleep

Sometimes, lifestyle improvements by themselves don’t cut it. You might have clinical-grade insomnia on your hands. It’s best to avoid self-diagnosis and get evaluated by a sleep specialist or psychiatrist.

I’m all to familiar with the sleep medications on the market. Here’s what I’ve learned through trial and error.

How to Evaluate Sleep Medicines

What are the key things to look for when researching sleep medicines:

  • Drug half-life. Shorter half-lives are better because it’s ideal for the drug to be mostly out of your system when you wake up. The half-life is defined as the time it takes for 50% of the drug to be eliminated from your body.
  • Anticholinergic effects. You want a sleep aid that lacks anticholinergic effects. Diphenhydramine (Benadryl) is a popular OTC sleep aid with pronounced anticholinergic effects and should be avoided. Anticholinergic drugs markedly impair cognitive function.
  • GABAergic effects. While necessary in some cases, drugs directly bind and activate the GABA receptor are not ideal. I’m thinking of benzodiazepines and z-drugs. These are powerful hypnotics with some deleterious long-term consequences.
  • Antipsychotic effects Atypical antipsychotics are increasingly prescribed off-label for sleep, particularly the drug Seroquel. Some people need them because they have bipolar disorder, treatment-resistant depression, and the like. But for pure insomnia, antipsychotics are your worst choice due to their diabetogenic effects.


These are drugs like rozerem. Rozerem binds to the melatonin receptors MT1 and MT2 with higher affinity than melatonin itself. Activating melatonin receptors helps with sleep initiation and can sooth out circadian rhythm irregularities. Verdict: these are relatively clean drugs with minimal side effects. The downside is that for many people they aren’t strong enough to move the needle.


I’m thinking of the relatively new drug Belsomra (suvorexant). Suvorexant is an orexin antagonist. Orexin is a neuropeptide that normally helps you stay awake. By blocking orexin receptors, suvorexant makes you sleepy. Narcoleptics have impaired orexinergic signaling which makes them constitutively sleepy.

Verdict: along the same lines as rozerem: favorable long-term solution for insomnia but ineffective for some.


Hydroxyzine is an old-school antihistamine first synthesized in the 1950’s. Here’s its receptor binding profile:

  • H1 receptor inverse agonist (Ki = 2 nM)
  • 5-HT2A antagonist (Ki = 50 nM)
  • D2 antagonist (Ki = 378 nM)
  • a1-adrenergic antagonist (Ki = 300 nM)

It’s usefulness as a sleep aid stems from its potent antihistamine effects. Hydroxyzine’s blockade of serotonin (5-HT2A) confers anxiolytic effects. Both hydroxyzine’s effect on D2 and a1-adrenergic receptors is worrying since this is the mode of action of antipsychotics. However, hydroxyzine’s affinity for histamine receptors is 189x as a strong as for the dopamine D2 receptor. This means that at low doses the effect on D2 and adrenergic receptors is negligible.

Verdict: this is a solid and often overlooked sleep medicine. The major downside is its long-half life (20–24 hours) which can result in next-day grogginess.


[narcoleptics] Narcolepsy – Wikipedia, the free encyclopedia