The coronavirus is spreading so rapidly in Philadelphia that the city’s contact-tracing program no longer has the ability to track every case, city officials said Tuesday, while they urged residents to cancel all holiday gatherings and Pennsylvania reported a record number of new cases.

As the city contends with the renewed surge of the virus, which has seen more than 38,000 Pennsylvanians newly infected in October alone, and if it continues into the winter, Philadelphia Health Commissioner Thomas Farley said it “may be the worst period of the entire epidemic.”

City officials were considering whether to impose additional restrictions and told residents to stay home as much as possible. The swamping of the contact-tracing program held some echoes of the spring, when the virus was spreading so rapidly that the city quickly prioritized mitigation over containment.

Pennsylvania reported 2,751 new coronavirus cases Tuesday, the highest number recorded in a single day. Hospitalizations also continued to climb, and the state reported 23 new deaths.

Philadelphia announced 340 new cases and five deaths. The city had an average of 296 new confirmed infections per day in the week that ended Saturday, Farley said, representing the highest average since the first week of May, and a positivity rate last week of 7.2%.

The state’s positivity rate has been at 5% since Friday. Epidemiologists view 5% as a threshold of concern because it suggests many more undetected cases in the community.

City hospitals are not pressured, with about 200 people hospitalized, Farley said. The death rate also remains low: The city is seeing about one death per 60 confirmed cases compared with about one death per 15 cases in the spring. That change is due in part to increased testing and the diagnosis of people who have minimal or no symptoms, Farley said. Plus, hospital treatments for the sickest patients have improved.

New Jersey’s numbers have stayed lower than Pennsylvania’s but are on the rise. The state reported 1,663 more cases on Tuesday, along with 14 newly confirmed deaths.

Nearly 500,000 people in the U.S. have contracted COVID-19 in the last week, a Reuters analysis said. The country’s daily average for new cases reached an all-time high of more than 71,000 on Monday, data from the New York Times showed.

Nationally, nearly 43,000 patients are hospitalized with the coronavirus, a 45% increase since Sept. 28, according to an Inquirer analysis of data from the COVID Tracking project. Hospitals in 12 states across the Upper Midwest and Rust Belt — including Wisconsin, Minnesota, South Dakota, and Ohio — are at record levels, and 41 states and Puerto Rico now have more hospitalizations than at the end of September.

Pennsylvania, New Jersey, and Delaware all have more people hospitalized now than last month.

Schuylkill County is seeing higher case numbers than Philadelphia, reporting more new cases per day than any county in Southeastern Pennsylvania and more than it has at any other time during the pandemic. Infections there have shot up over the course of the month: from 53 new cases reported on Sept. 25 to 360 on Monday, according to state data analyzed by The Inquirer.

In Philadelphia, as many as 15% to 20% of people who have tested positive are not being contacted by tracers because of the surge, said Hannah Lawman, chief of operations for the city’s Division of COVID Containment.

The city’s contact-tracing program is able to handle 200 to 250 cases a day; the city’s daily count has been above that for about two weeks.

Of the patients who do get contacted, the tracers are no longer able to reach them all within 24 hours of their positive tests, which is a benchmark epidemiologists say is important to meet for contact tracing to be effective in keeping people who have been exposed to the virus from spreading it.

The pressure on contact tracers has reached the point that when tracers do reach people, they will be asking them to do their own outreach to those they have had close contact with. “We don’t have time to do it,” Farley said.

Until the surge began about three weeks ago, the city’s 122 tracers were able to try every person who provided contact information within 24 hours — though the program’s efficacy was challenged by people refusing to answer. The city had seen a participation rate of about 40% to 50%, Lawman said.

Though the city’s case counts meet a state benchmark for moving to remote learning, Farley said the city was not requiring schools to go fully remote at this time.

The Pennsylvania Department of Education recommends that schools move to remote learning if there are more than 100 cases per 100,000 residents in the area population over a seven-day period, or if more than 10% of test results are positive.

In the week that ended Saturday, Philadelphia did have more than 100 cases per 100,000 residents, but its positivity rate was 7.2%.

The new cases have largely been driven by private family and social gatherings, including sleepovers, carpools, football parties, and celebrations, Farley said.

There is also some evidence of spread in workplaces and in restaurants. Farley said officials reviewed reports from contact tracing and found that since indoor dining began in September, 16% of people with the virus described eating out during the period they may have been infectious. When only outdoor dining was permitted, that figure was 11%, he said.

“Much of this surge will happen before the vaccine arrives,” Farley said. “We’re not going to get past this epidemic by Thanksgiving or by Hanukkah or by Christmas.”

Staff writer Susan Snyder contributed to this article.