Hinni / seq-input-mssql

Import data from MSSQL database to Seq. For example for error logs stored in tables.
Other
3 stars 3 forks source link

How to handle a database Timeout #12

Closed BigHoss closed 2 years ago

BigHoss commented 2 years ago

I query a view that does a few count statements.

When we ran it last week it took about 13sec in ssms. now its up to 26sec.

And in Seq we get the following error message:

image

A workaround i was thinking about was to do this query with an agentjob and write the result to a table and query this.

MattMofDoom commented 2 years ago

@BigHoss I think it would be reasonable to have a timeout config, and there's a few other connection params that would be useful. I'll prepare a PR for @Hinni to review after I've tested changes 😊

In terms of agent jobs, I'm going to do a blog post on how to turn agent job logs into a Seq view via MSSQL Input - it's insanely useful.

MattMofDoom commented 2 years ago

@BigHoss I've added PR #13 which will add connection and command (query) timeout settings, and ensures queries won't overlap ... just pending @Hinni to review & merge.

In the meantime, I've also written up how to turn SQL agent job logs into Seq logs using MSSQL Input 😁 Here's the link: https://mattmofdoom.com/using-seqinputmssql-to-read-sql-job-agent-tables-as-logs/

Cheers,

Matt

BigHoss commented 2 years ago

@MattMofDoom Thanks a lot.