NSAIDs are usually my first line of defense (I'm in between prescriptions for AS, right now) when I wake up in pain. Most days, I'll keep about 600mg of ibuprofen in my pocket and try to hold out as long as I can throughout the day. On particularly painful days, I take it right away.
I'd say I end up taking the 600mg maybe three or four times a week, on average.
So far, I haven't had any gut problems - and I've been doing this for a few years. However, I also happen to stick pretty closely to the NSD, which I believe has helped my gut lining stave off any potential damage from the NSAIDs.