Method and system for producing synthesis gas by partial oxidation of a carbonaceous stream, wherein the partial oxidation is controlled using an oxygen to carbon ratio (O/C ratio). A carbonaceous stream and an oxygen containing stream is fed into a gasification reactor at a selected O/C ratio, where it is at least partially oxidized. A gaseous product stream is thereby obtained, which at least contains synthesis gas, CO2 and possibly CH4. The content of CO2 in the product stream is determined, and compared with a pre-determined content thereby possibly obtaining a difference value between the determined content and the pre-determined content. The O/C ratio in step is adjusted based on the difference value.