A historic astronomical phenomenon is bearing down on the United States, and towns in its path are hustling to get ready. For a few hours on Aug. 21, 2017, the moon will move in front of the sun and cast its shadow over the United States. It’s the first coast-to-coast solar eclipse since 1918. Technically, it will be visible across the entire country, but in most areas, the moon won’t block enough of the sun to really dim its light, and you’ll need special equipment to watch the moon’s march across the disc. “The sun is so bright, you’d have to be really observant to notice that something was happening,” said Charles Fulco, who does educational outreach for the American Astronomical Society’s eclipse task force. “If you really want to see the eclipse, you’ve got to get on the path.”

He means the path of totality: a 60- to 70-mile-wide ribbon of territory from Oregon through South Carolina where the moon will completely cover the sun in a total solar eclipse. Eclipse-chasing astronomers, amateur and professional alike, have been scoping out viewing spots on the path for years. But much of the public is just finding out about it, sparking a steady increase in Google searches on solar eclipses. No one knows exactly how many people will decide to hop in the car at the last minute and speed down the interstate to the path of totality. But for much of the country, a prime observing spot is no more than a day’s drive away.

That’s creating huge logistical challenges for towns along that several-thousand-mile route. Hundreds of small municipalities will be in the crosshairs of what could be an enormous one-day population boom, creating significant challenges for traffic management, sanitation and emergency services.

According to Michael Zeiler, a geographic information systems expert who operates the website GreatAmericanEclipse.com, about 75 million people live within a 200-mile drive of the path of totality (about 12 million live on the path). Even if only a fraction of the outsiders decide to see the eclipse, their travel could have outsized effects. “Only 4 percent of the population of the U.S. has to travel to the path of totality to double the population there,” said Angela Speck, a professor of astronomy at the University of Missouri. That kind of population spike would probably barely be noticeable if eclipse seekers were to spread evenly across the path. But where you are on the path matters — the closer you get to the central strip of that ribbon of land, the longer the sky show will be. It’s the difference between a few seconds of darkness at the edge of the path and a full two minutes at its center. Because visitors get the longest show on the path’s centerline, they’re likely to converge on the towns there.

Zeiler’s estimates for path-of-totality visitors on eclipse day range between 1.9 million and 7.4 million people. So, many communities near the center of the path are planning for huge crowds, leaning on ad hoc networks that can include town officials, volunteers, emergency response agencies, astronomers, local law enforcement and state tourism divisions, among others.

The 200-person town of Glendo, Wyoming, about 200 miles north of Denver, expects to host at least 20,000 people at its viewing area on a grass airstrip — and at least an additional 30,000 are expected at the neighboring state park. “We’ve actually been planning for this for three years,” Town Clerk Brenda Hagen said. “It’s a once-in-a-lifetime event for us.”

That once-in-a-lifetime event could mean traffic jams at choke points where major roads converge on the path of totality. But Zeiler has analyzed the relationship between U.S. population centers and the country’s road network to predict these points, and you can see the likely problem spots in the map above. “People can plan around them, travel early or avoid places where they know the traffic could be bad,” Zeiler said.

Traffic snarls are also expected after the eclipse, as drivers return home through those same choke points. Transportation engineer Patrick Son recommends that eclipse viewers wait at their viewing site to give traffic a chance to dissipate before driving back.

Getting people to arrive early and leave late may help prevent traffic congestion, but it means that visitors will be hanging around town far longer than the time it takes for the moon to move across the sun on Aug. 21. They’ll get hungry and thirsty, and small towns sometimes have limited options for buying food and drinks.

Town planners across the path are recruiting food vendors to help feed the crowds at viewing sites. Still, some officials worry that demand for meals will be overwhelming and are asking visitors to bring food and water instead of relying on local infrastructure. “We hope people will bring supplies with them, because they might be kind of hard to get in town, and our nearest grocery is a 50-mile round trip,” Hagen said. But there’s one necessity that most visitors can’t stash in their vehicle. “The biggest shortage on the day of the eclipse will probably be port-a-potties,” Zeiler said.

No one likes an overflowing toilet. But figuring out how many port-a-potties to rent for a once-in-a-lifetime event is challenging. Patti Carter is chair of the solar eclipse task force for Chester, Illinois, a town of 8,500 that’s about 50 miles south of St. Louis. She said her town started with an estimate of 10,000 visitors but after meetings with the county emergency management agency is now planning for 25,000 people to show up at its viewing areas. More people will obviously need more toilets, and the number required rises still further the longer visitors stay at an event site. Local infrastructure can make a difference: Towns like Chester that put their eclipse viewing areas in municipal parks which already contain public flush toilets can supplement their facilities with far fewer portable toilets than tiny towns with fewer amenities like Glendo, which has rented a couple of hundred portable toilets and made plans to pump them regularly over the weekend leading up to the eclipse. Fortunately, there are formulas to help them plan their orders, such as the estimates in this table.

Potty planning For lines no longer than 15 people TOILETS NEEDED FOR … PEOPLE ONE HOUR (VIEWING) FIVE HOURS (FESTIVAL) 5,000 12 31 25,000 38 160 50,000 76 320 Assumes 200 uses per portable toilet and four hours between bathroom breaks for an average person Sources: Portable Sanitation Association International

In each case, organizers hope that planning for larger crowds will improve their odds of success. “If we prepare for 20,000 but only get five [thousand], then we’re ahead of the game, and we can really make those people happy,” Carter said.

But with big crowds, there’s always the possibility of unexpected emergencies, which could strain emergency response teams in small towns. Glendo and Chester are doing their best to prepare for whatever could go wrong. Hagen and Carter said portable cell towers were being brought in to dedicate to emergency coordination in case the influx of visitors overwhelms normal cellphone service. Some hospitals are planning to set up mobile units and recruiting extra staff for the weekend. And residents of some areas have been cautioned to stock up on food, water and gas. Areas that are at risk of summer wildfires are imposing burn bans. Some communities are shifting their school schedules to keep school buses off the roads that day.

There’s also one very specific safety concern: eye protection. It’s only safe to look directly at an eclipse during the two-odd minutes of totality, when the moon completely covers the sun. At all other points of the eclipse, part of the sun is exposed, and looking directly at it can damage the eyes. But viewers can still watch the moon move across the sun indirectly by projecting its image through a pinhole onto a wall, the ground or a sheet of paper, or they can look directly through solar filters that meet the standards set by the International Organization for Standardization for blocking sunlight.

Many towns in the path of totality have been ordering thousands of eclipse glasses fitted with those filters: Some are handing them out for free, while others have plans to sell them to recoup some of the costs of renting toilets and hiring emergency workers. Organizers expect the glasses to be in high demand, but Speck noted that even if a viewing site sells out, the changes that occur before and after totality are slow enough that groups will have plenty of time to share pairs for peeks at the sun. “You don’t need to be looking at it the whole time,” Speck said. “If you can get one set between every three to four people, that’s enough.”

We’ll know if all the planning pays off in a few more weeks. More visitors than anyone ever expected could show up at communities across the path. Bad weather may make crowds evaporate. Towns are trying to plan for unknowable numbers of people — and to pull it off without a dress rehearsal. It’s stressful. “I’m going to be in the fetal position in one of our park complexes by the time this is over,” Carter said with a laugh.

Tips if you want to see the eclipse but haven’t made plans yet: