Installation for treating a feed gas stream comprising at least methane and carbon dioxide by membrane permeation, comprising: - a compressor A for compressing the feed gas stream, - a first membrane separation unit adapted to receive the gas stream from the compressor and to provide a first permeate and a first retentate, - a second membrane separation unit adapted to receive the first retentate and to provide a second permeate and a second retentate, the second permeate being configured to be recycled into the feed gas stream downstream of compressor A, - a third membrane separation unit adapted to receive the first permeate and to provide a third permeate and a third retentate, the third retentate being configured to be recycled to compressor A for compressing the feed gas stream, with each membrane separation unit comprising at least one membrane that is more permeable to carbon dioxide than to methane, - at least one means for measuring the suction pressure of the second permeate from the second membrane unit, - at least one compressor B for drawing the second permeate and adjusting the suction pressure of the second permeate based on the measured suction pressure before recycling the second permeate into the feed gas stream downstream of compressor A, - data transmission means configured to automatically perform the measurement of the suction pressure of the second permeate, the comparison of this measurement with a setpoint value and the adjustment of the suction pressure of the second permeate by compressor B, - at least one means for measuring the CH4 concentration in the second retentate, - at least one means for adjusting the pressure of the feed gas stream based on the measured CH4 concentration, the means for adjusting the pressure of the feed gas stream being compressor A or a shut-off and progressive pressurisation valve, and - data transmission and data processing means configured to automatically perform the comparison of the measured CH4 concentration in the second retentate with a setpoint value and the adjustment of the pressure of the feed gas stream. - a compressor A for compressing the feed gas stream, - a first membrane separation unit adapted to receive the gas stream from the compressor and to provide a first permeate and a first retentate, - a second membrane separation unit adapted to receive the first retentate and to provide a second permeate and a second retentate, the second permeate being configured to be recycled into the feed gas stream downstream of compressor A, - a third membrane separation unit adapted to receive the first permeate and to provide a third permeate and a third retentate, the third retentate being configured to be recycled to compressor A for compressing the feed gas stream, with each membrane separation unit comprising at least one membrane that is more permeable to carbon dioxide than to methane, - at least one means for measuring the suction pressure of the second permeate from the second membrane unit, - at least one compressor B for drawing the second permeate and adjusting the suction pressure of the second permeate based on the measured suction pressure before recycling the second permeate into the feed gas stream downstream of compressor A, - data transmission means configured to automatically perform the measurement of the suction pressure of the second permeate, the comparison of this measurement with a setpoint value and the adjustment of the suction pressure of the second permeate by compressor B, - at least one means for measuring the CH4 concentration in the second retentate, - at least one means for adjusting the pressure of the feed gas stream based on the measured CH4 concentration, the means for adjusting the pressure of the feed gas stream being compressor A or a shut-off and progressive pressurisation valve, and - data transmission and data processing means configured to automatically perform the comparison of the measured CH4 concentration in the second retentate with a setpoint value and the adjustment of the pressure of the feed gas stream. - at least one means for measuring the suction pressure of the second permeate from the second membrane unit, - at least one compressor B for drawing the second permeate and adjusting the suction pressure of the second permeate based on the measured suction pressure before recycling the second permeate into the feed gas stream downstream of compressor A, - data transmission means configured to automatically perform the measurement of the suction pressure of the second permeate, the comparison of this measurement with a setpoint value and the adjustment of the suction pressure of the second permeate by compressor B, - at least one means for measuring the CH4 concentration in the second retentate, - at least one means for adjusting the pressure of the feed gas stream based on the measured CH4 concentration, - data transmission and data processing means configured to automatically perform the comparison of the measured CH4 concentration in the second retentate with a setpoint value and the adjustment of the pressure of the feed gas stream.