CIUDAD DEL CARMEN, Mexico — The town that oil built is emptying out.

“For Sale” signs are plastered on concrete-block houses and sun-bleached bungalows alike. The idled oil workers who used to cluster in the main square, hoping to pick up odd jobs, have moved on.

Here in Ciudad del Carmen, on the gulf coast of Mexico, even the ironclad union positions are slipping away. Some roughnecks on the offshore rigs of the national oil company, Pemex, have not worked in months, and their voices are filled with anxiety.

“What do you think is going to happen?” some ask.

Pemex has been limping along for years, bleeding billions of dollars annually, saddled with debt and struggling to maintain production as its giant oil fields in the Gulf of Mexico run dry. Next year, it will pump less than two million barrels a day, the lowest output since 1980.

Fixing the oil company was already at the top of Mexico’s list of priorities, the focus of a long debate over the fate of one of its most important — and troubled — national institutions.