A process and equipment for treating natural gas produced by a well that has recently been stimulated, and that contains an undesirably high concentration of the fracturing gas used to stimulate the well. The process involves treating the gas by membrane separation, and provides for control of treatment parameters to compensate for the changing concentration of fracturing gas in the produced gas, as well as changes in gas flow rate.