Gym chain 24 Hour Fitness is working with advisors at investment bank Lazard and law firm Weil, Gotshal & Manges to weigh options including a bankruptcy that could come as soon as the next few months, people familiar with the matter tell CNBC.

The chain is grappling with a heavy debt load, deteriorating performance and a coronavirus pandemic that forced it to shut its more than 400 clubs. The mid-priced fitness studio is already struggling to compete against premium rivals like Equinox and cheaper competitors like Planet Fitness.

Credit ratings agency Moody's recently downgraded the chain over worries around its "negative membership trends, very high-interest burden and negative free cash flow prior to the coronavirus outbreak, as well as approaching maturities to provide limited flexibility to manage through the crisis."

It has an $837 million term loan with a so-called springing maturity in March 2022 and $500 million in unsecured notes maturing in June 2022, if more than a fifth of those notes remain outstanding.

San Ramon, California-based 24 Hour Fitness had roughly $1.5 billion in sales in 2019, and less than $1 million in cash, according to Moody's. It is controlled by AEA Investors, which acquired it through a $1.8 billion deal with Fitness Capital Partners and Ontario Teachers' Pension Plan in 2014.

The people, who requested anonymity because the information is confidential, cautioned that bankruptcy is not definite, and may still be avoided. Spokespeople for Lazard and Weil, Gotshal & Manges as well as 24 Hour Fitness did not respond to requests for comment. AEA declined to comment.