More than three million people took China's annual civil service exam on the weekend, state media reported on Monday, a record number that underscores young people's concerns about getting a secure job in a rocky economy.

With stubbornly high youth employment in the world's second-largest economy, the prospect of a less glamorous career in the civil service is increasingly attractive as private sector job opportunities dwindle.

"After all, the general environment is not good," one user of the Weibo social media platform said of economic prospects as posts about the civil service exam surged.

"Companies are laying off employees and closing down in large numbers. It is not stable at all, so I have to choose to be a civil servant. The less earnings is fine. At least I won't be unemployed and starve to death."

The exam was held simultaneously in 237 cities across the country on Sunday, the state-run China Daily reported.

A record high of 39,600 vacancies are up for grabs at central government agencies and affiliated institutions. On average, 77 candidates are competing for every position, the Global Times newspaper reported.

China is struggling to get its economy back on track after COVID-19 and the government has introduced a rash of policy measures, including strengthening financial support for private companies.

The number of people trying to get into graduate school has also declined, the China News Network reported, with a researcher at the China National Academy of Educational Sciences citing insecurity about work as a factor.

"For many undergraduate graduates, if they can find a job now, they will definitely prefer to work as soon as possible, said researcher Chu Zhaohui.

"Many people's expectations of finding a job after graduate school are relatively low."

The Global Times reported that the number of civil service jobs had increased for the past five years. Last year, nearly 2.6 million candidates competed for 37,100 vacancies. (Reporting by Bernard Orr; Additional reporting by Beijing and Shanghai newsrooms; Editing by Robert Birsel)