Han Xing did not become a farmer for the money. He already had plenty, as the founder of a communications equipment company. What he wanted was food not tainted by heavy metals or fouled with pesticide. He couldn't find it in grocery stores.

So, like a rising number of wealthy Chinese, he decided to grow it himself, signing a 20-year lease on a 13-acre plot of land where he now has eight greenhouses, a giant fish pond and pens filled with more than 100 ducks, chicken and geese, the latter to defend the other poultry from local weasels.

Then there's the greenery: cherry, peach, apricot, walnut and apple trees; an herb garden that sprouts cilantro, rosemary, mint and garlic; and plots of earth jammed with celery, tomatoes, broccoli, peanuts, strawberries, peppers, green onions, eggplants and grapes.

Story continues below advertisement

"We all felt food safety was an issue," said Liang Hong, Mr. Han's wife. "It's better to have food from our own place."

At Sun Garden, they grow corn to feed the animals and harvest branches to fire the stove. "We have an eco-chain," Mr. Han said.

"Outside rice and flour, we grow all of our food here," his wife added.

Before they set up the farm 45 kilometres outside the centre of Beijing, she had stopped eating local green vegetables, buying only produce she could peel, like potatoes and carrots.

"That's why we decided to establish our own private operation," she said. Now 40 families eat the farm's produce, which they give free to close friends and sell to others.

Smog is the most visible consequence of China's decades of breakneck growth. But unchecked industrial expansion has also showered the country with invisible pollution. More than 80 per cent of water from Chinese wells is too contaminated to drink. A fifth of farmland is fouled by toxic heavy metals. Guangdong province found dangerous levels of cadmium in 44 per cent of the rice and rice products it sampled.

And the country has suffered a disastrous series of food quality scares, including melamine-tainted milk and rotten meat repackaged and resold.

Story continues below advertisement

China's political elite dine from secret farms devoted to their needs, Chinese media have reported, while champion athletes eat from a specialized military supply chain.

Now, the swelling ranks of the rich in China's private sector want the same. First came the Swiss-made home air filters. Now come the private rural cucumber patches.

At the Reignwood Pine Valley Golf Course, owned by Chinese-Thai billionaire Chanchai Ruayrungruang on the outskirts of Beijing, 2 1/2 acres of glass greenhouses protect soil imported from Denmark. A dozen hired farmers harvest some 5,000 kilograms of food a year for ultra-wealthy golf course members, said Mr. Cui, a man who answered the phone but declined to give his first name. Use of pesticides and fertilizers is strictly banned.

At another plot beyond Beijing's main airport, Huang Bin oversees a 10-acre operation that raises pigs, sheep and chickens, which lay more than 600 eggs a day.

"I spend Monday to Friday at work, and come to farm on the weekend," said Mr. Huang, whose company is involved in reducing energy use in construction and commercial property. He and some friends founded the farm as a way to pull out of the regular food chain, situating it on land that was once a state-run orchard. "Many Beijingers are looking for a place to get safe food," he said.

Some customers make their first purchase when they drive by and see chickens flying through the orchard, where they roost at night – a vision of a very different kind of food.

Story continues below advertisement

Business is brisk, with people "lining up" to book popular pork cuts, like ribs and marbled meat, Mr. Huang said.

Among middle-class Chinese, the search for safer food has largely been conducted online, as people turn to organic sellers. Imported foods have also made inroads online, including Australian beef and Canadian lobsters. Sales of fresh food on the Internet rose nearly 50 per cent in 2014, and a similar amount again last year.

But those wealthy enough to grow their own food scoff at the notion of "organic" produce in a heavily polluted country. Mr. Huang and Mr. Han have both tested their farms' land and water and found it clean.

What's not clear, however, is how much they have insulated themselves from food trouble with their private operations. "My real question is, 'Is what they're doing really that much safer?'" said Donald Schaffner, a professor at Rutgers University who has written extensively about food safety.

For years, "average consumers were worried about food additives and pesticides. Now they're worried about [genetically modified organisms]. But if you look at what causes people to get sick, it's bacteria," Prof. Schaffner said. That's particularly hard to manage in small operations.

Among China's successful urban classes, however, farming has its own lifestyle appeal.

Story continues below advertisement

Watching the pigs and sheep graze elicits "a feeling of returning to nature," said Mr. Huang.

It also rewrites the calculation for the well-travelled children of wealthy parents contemplating where their future will be. Suddenly, they feel they don't have to worry about what they eat if they stay home.

At Sun Garden, "this is the solution to the food scare in China," said Han Pingye, as his mother helped prepare a feast of bitter melon, smashed cucumber and pork-and-corn soup. Currently studying at the University of Miami, he plans to return to China after graduation. With the food issue "solved, Beijing becomes the best place for me," he said.