On the streets they just call him Willie, and whether they gripe or cheer when he passes with a tip of his hat, it almost always sounds wistful now, as if everyone knows that this could be their stylish, sweet-talking mayor's last hurrah.

Willie L. Brown Jr., once the most powerful legislator in California, and for the past four years the brash boss of this never-dull city, is all over town these days, running hard for reelection. And this time he may need every bit of his charm as he courts an electorate that sounds downright grumpy.

These are boom times in San Francisco, with its economy on a roll, its municipal budget awash in cash and crime plummeting. But the city is still a nervous wreck of traffic jams, late buses, no parking, soaring rents, scarce housing and rich young cyber-moguls charging up from Silicon Valley and pushing out the poor, the punks and the panhandlers who have long called it home.

This may be the most uncomfortably prosperous place in the nation, and that mood is casting a shadow over a mayoral election that is getting wilder by the week.

Only here would a candidate for mayor promise that he would try to lower property values somehow if he wins, as one of the top contenders for Brown's job did recently, to loud applause.

On the campaign trail, Brown is under fire from voters worried about all kinds of quality-of-life issues, and often he is giving just as much heat as he receives. At some forums, he is vowing to focus more on neighborhood issues during a second and final term, saying he has had to spend most of the past four years setting the budget and crime straight. But at times he also sounds frustrated with the uproar, insisting the city is in great shape.

"San Francisco, get a clue," he announced at one church event earlier this month.

Brown, a Democrat, is favored to win the crowded Nov. 2 mayoral race, even though some polls have shown that fewer than four in 10 San Francisco voters are thrilled with the work he's done so far and say he's too arrogant. He has most of the endorsements that matter. His diverse political machine is in high gear. And he is raising money from supporters across the country for what at age 65--after four savvy decades in politics--could be his curtain call in public office. Then again, Brown is hardly acting as if he is ready for retirement.

He is constantly on the go, keeping 18-hour days, inviting constituents to one-on-one meetings with him many Saturday mornings in his City Hall office, and either delighting or infuriating them with his combative political style.

Some months ago, Brown was awakened at home at 2:30 a.m. by a resident calling him to complain that a street light outside of her house had been broken for a while, and the city had failed to repair it. He took her number and at the office that day ordered his aides to fix the light, no matter what. Then he personally telephoned the woman back to check if the light was working--waking her up at 2:30 a.m.

Fourteen candidates are vying to be the next mayor, but only two Democrats among them are posing any serious challenge to Brown. One is former San Francisco police chief Frank Jordan, the incumbent Brown beat four years ago. The other is a millionaire political consultant, Clint Reilly, who has managed a number of prominent campaigns in the state but is running for elective office for the first time. Both candidates are trailing Brown in the polls. And the closer the vote gets, the uglier the contest is becoming.

Some of Brown's supporters are making an issue of personal problems that Reilly, 51, had nearly 20 years ago, including a drunken driving arrest and what one top Brown aide described as "savagely mauling" a woman friend. Reilly contends that Brown's camp is exaggerating the incident of domestic violence, but he has nonetheless apologized for it. And he has launched his own assault on Brown's integrity, accusing him of presiding over a City Hall that is overrun with corruption and cronyism. For the past year, the FBI has been investigating possible fraud and favoritism in San Francisco's minority contracting.

Reilly and other candidates are also denouncing Brown's governing style, saying he is all smooth talk, no action. "I don't think he understands the difference between holding a press conference and actually making something happen," Reilly told voters at a forum on public transportation problems. Meanwhile, Jordan, 64, is blasting Brown and Reilly as "lifelong manipulators of the political process."

Brown is scoffing at all of the attacks and boasting that his administration is clean and competent. "I'm known for the quality of people I hire," he said last week. "That's why I never hired Mr. Reilly."

The mayoral race received yet another jolt a few days ago when the openly gay chairman of San Francisco's Board of Supervisors, Tom Ammiano, announced that he would be a last-minute write-in candidate. He stands virtually no chance of winning, political analysts say, but could still force a runoff election by stealing votes Brown might need to gain a majority.

Life is always rough for an incumbent in San Francisco, still the proudly liberal land of rebels with a thousand causes, and forever suspicious of the latest crew in power. Politics here also has a lost-in-time quality. Candidates are battling on the airwaves, but it is almost an afterthought. The real action is on the street, or door-to-door, and in countless neighborhood forums that are packed with passionate voters. At several debates, police have had to drag citizens out by their limbs. An activist moderating another forum on the changing character of the city captured the crowd's volatile mood by telling the mayoral candidates, "I am not a concerned citizen, I am a positively terrified citizen."

"People are apprehensive in this election," said Michael Smith, a San Francisco resident who runs a local nonprofit group that promotes pedestrian rights. "It's not that they want the prosperity in the city now to be reduced. They just want it managed better. And a lot of things like housing and transportation are just getting worse."

Rich DeLeon, a professor at San Francisco State University who has written a book on the tumultuous politics here, said that economic growth is a double-edged sword for the city because residents are militant about preserving the traditional character of neighborhoods at all costs. "Anywhere else, Brown would seem to have everything going for him for reelection," DeLeon said.

But Brown has made a career of escaping political trouble. Earlier this decade, when Republicans won a majority in the state legislature, Brown even managed to keep his influential job as Assembly speaker by persuading a conservative Republican lawmaker to commit political suicide and vote for him. The exiled legislator later joined Brown's mayoral administration to run the city's solid waste-management program.

And when a new term-limits law in California finally forced Brown out of his beloved legislative seat, he turned his attention to becoming San Francisco's mayor, a job that he once said was beneath his talents, and basked in victory.

He's playing to win again. Swirling through the city's multicultural Mission district the other day, dressed to kill in a tailored Italian suit, Brown reeled in votes like a wily old master of his trade. He went eyeball-to-eyeball with residents asking him about city problems and had aides get their numbers. He took photos of constituents. He flipped on sunglasses a merchant gave him. He offered to carry a woman's grocery bags. On it went for nearly two hours, and by the time he was done he had a small army trailing him.

Later, there would be another forum with another short-fused civic group. "I love this city," Brown said as he arrived, "and I love this business." Then he straightened his fedora and plunged, as cocky as ever, straight into the crowd.

CAPTION: San Francisco Mayor Willie L. Brown Jr., running for a second and final term, is under fire from voters worried about all kinds of quality-of-life issues.