I have an asmx web service that has a series of functions that call stored procedures from a database. One of those functions is randomly timing out and I can't figure out why.
What's odd is that it usually times out on the first or second try for the day or after rebuilding the app. But if you run it again right away, it returns sub-second. It also never happens with any other function, just this one, which is strange considering how similar it is to the others. I can't seem to reproduce the issue from SQL Management Studio (although it's difficult to reproduce in general) so I'm inclined to think it's a deeper issue than the stored procedure simply taking its time. It's intermittent but will generally happen to me 2 or 3 times per day.
Any idea what could be causing the time out?