SAN FRANCISCO — For most tech employees, there is such a thing as a free lunch, but those days could be coming to an end.

When Facebook opens a new office in Mountain View, California, this fall, the company will be prohibited by law from offering its employees the free, chef-cooked meals they currently enjoy at the Menlo Park headquarters eight miles away.

The city of Mountain View passed the free meals restriction in 2014 — though the rule covers only a particular development where Facebook is readying office space for 2,000 employees.

Free food is a classic perk of employment at tech companies. Mountain View is home to the headquarters of Google, which offers its employees free meals in an on-site cafeteria. Those employees are not be affected by the regulation.

It’s a small rule but one that highlights the growing tension surrounding the impact that large tech companies are having on their communities. While tech companies have created high paying jobs, they've also driven up housing prices and caused other headaches, such as heavy traffic.

"Many of these companies touted the boost their employees would have on our local economy, only to provide everything from round-the-clock gourmet catering to dry-cleaning on-site," San Francisco Supervisor Aaron Peskin said in a statement.

The idea of rules against free meals is also taking off in San Francisco. A new ordinance proposed by two members of the city’s board of supervisors would prohibit free cafeterias in any future office buildings.

The ban on the quintessential Silicon Valley work perk is designed to get employees to leave the office and patronize local businesses, Councilman John McAlister told the Mountain View Voice earlier this year.

"If you're taking up a major part of the property but giving people no reason to come to the businesses, that's not good for the sustainability of the area,” he said.

In San Francisco, the proposed ordinance wouldn’t affect the existing tech giants in the city, like Uber and Twitter, which offer free meals to employees, but would prohibit them and any other company there from opening a free cafeteria in a new office space.

Free meals are “pretty standard in the tech industry, so people expect it,” said Harry Glaser, CEO and co-founder of Periscope Data.

Glaser’s company serves lunch and dinner Monday through Friday to 150 employees at the Periscope Data headquarters, just down the street from a condensed area where Uber, Twitter, Square and other tech giants have offices.

But there may be a way where everyone wins.

Instead of relying on an in-house cafeteria to feed 150 employees, Glaser said the company caters their meals from local restaurants and everyone eats together at a long communal table.

“It's cultural. I like that we have a lunch room and the whole team comes together and eats together,” he said. “As the company gets bigger, we want to make sure we have an inclusive culture — whether you're in sales or engineering, new or been here a long time.”

Dinner is served around 6:30 p.m. every night, he said, but no one is expected to stay for it.

“It hasn't been my experience that it keeps people working longer hours,” he said. “But I know some companies have said that.”

Gwyneth Borden, executive director of the Golden Gate Restaurant Association, said the ordinance wouldn't affect companies catering from local restaurants, and is designed to instead take aim at cafeterias.

“Employees that never leave their offices is of little economic benefit to the city around them if their companies are not purchasing food from local businesses,” she said.