SAN FRANCISCO — Since the height of the Gold Rush, the San Francisco Bar Pilots have been guiding large vessels from the Pacific in and out of the harbors here and further inland, knowing as only they did the vagaries of the bay’s currents, its hidden shoals and every foggy channel’s twist and turn. The ships steadily grew larger just as the pilots’ salaries did, standing at $451,336 last year.

These days, though, the pilots, who are regulated by the state and number only 57, are having a hard time navigating the treacherous waters of Sacramento. A bill that would have increased piloting rates and pilots’ wages was soundly defeated last year; the fate of another bill that would raise the fees for the largest of the ships now appears bleak.

A previously obscure group of workers, overseen by an even more obscure state commission, is now attracting unwanted attention in the state capital for its high compensation, work schedule and perks. In normally laid-back committee hearings, at least one official delivered an emotional plea in favor of the bar pilots.

K. Michael Miller, the president of the commission that oversees the pilots, said he was going to be a “stand-up guy” and “ruffle some feathers” before defending the pilots’ practice of flying business class on training trips to France instead of economy, which he called “pretzel class.”