The longer you’ve been living in San Francisco, the less likely you are to be happy with it.

That’s one of the lessons from the 2017 San Francisco City Survey released Tuesday, in which those with more than 30 years of San Francisco living under their belts generally gave City Hall a thumbs down.

The controller’s office conducts the survey every two years to measure general satisfaction with public services.

Overall, public opinion seems fairly mellow this time; most of the 2,166 randomly selected phone respondents gave the city either a B or a B- grade on things like public safety, transit, and parks. Libraries got a B+.

The public ranked homelessness as the city’s biggest problem, with 33 percent of responses highlighting it as their top concern.

But combining responses from those who cited housing costs (31 percent) and cost of living (15 percent) suggests most people are worried about displacement more than anything else.

It’s when it comes to rating “local government’s ability to provide services” overall that the demographics start to diverge in a telling way. For the most part, City Hall averaged a B- score, with 57 percent of people giving the city either an A or a B grade.

(The report points out that’s down from 59 percent in 2015 but up from a scant 25 percent 15 years ago.)

However, “satisfaction with local government varies widely by demographic group,” writes the controller.

Notably, 65 percent of people who have lived in San Francisco for ten years or less gave City Hall either an A or a B.

But among those here for more than 10 years but less than 20, that figure declined to about 58 percent.

And for the truly time-tested San Franciscans with 30 years or more of city living in the rear view, satisfaction plunged to about 47 percent.

Inevitably, this corresponds to increased dissatisfaction among older residents, with only half of those 55 and older generally happy with the city, versus 63 percent of those under 35.

Previous year’s surveys from 2015 and 2013 didn’t break down replies by age the same way, so it’s hard to tell if this is an emerging trend or just the usual business.

Other demographic factors made a difference too: Privately educated residents ranked the city lower on average than those who went to public schools, and while a majority of Latino, Asian, Pacific Islander, and white respondents gave the city an A or a B, most black San Franciscans polled did not.

You can read the full report here and see a more in-depth data set on the city’s main site.