Essaouira was designed on a drawing board, and it shows. In the 1760s Sultan Mohammed III wanted a trading port for foreign merchants on the Atlantic coast, and he had a French engineer, Théodore Cornut, help lay out a walled town on the site of an older Portuguese fort. Europeans knew the place as Mogador, and the name stuck until the 1960s. Today the medina is a UNESCO World Heritage Site (listed in 2001), and the old name survives mostly in the history books and on the odd shopfront.
It's nicknamed the windy city, and that's the whole character of the place. The wind keeps the beach too rough for lazy sunbathing, feeds the fishing harbor, and makes this one of Morocco's kitesurfing and windsurfing towns. It's also small: about 83,000 people, a medina you can cross in an hour, and a mood slower and less pushy than Marrakech. Three days is the right length: one for the medina and the port, one for the beach and the wind, one for the surf villages and argan country. Less and you're a day-tripper from Marrakech, more and you'd better want to surf.
Day one is the walled town and the harbor, day two the bay, the beach and Diabat, and day three a drive along the coast. Start on a Friday if you can: day one ends with the Friday couscous, and the Jewish museum, reportedly closed on Saturdays, is behind you. Getting here from Marrakech takes about three hours by bus, and more about Morocco as a whole is on its country page.