For me, I aim to keep a strict ratio of 5%net carbs, 65% fats, and 30% protein. I haven't had any issues maintaining this ratio, and its server as a great goal for me to plan my meals by. As far as how many carbs knock you out of ketosis, it varies by person.