locked
Increase timer job execution timeout RRS feed

  • Question

  • Hi!
    I've recently got infopath forms server stopped working because of the state service database got full of expired records.
    The timer job which must delete expired records ("State Service Delete Expired Sessions") runs every hour but is deleting too little - 100-300 records for a single execution which is always lasts for 30 seconds.
    So the records are added faster then deleted and the database eventually is growing to limits.

    There are 2 causes - slow deletion from "Sessions" table and short timeout for the deletion operation.
    Trying to solve 1st problem I revealed that deleting from tables containing LOB datatypes (varbinary(max) in Sessions table) is always slow operation (because sql server has to read into memory lot of pages containig LOB data while deletion) and I didn't find solution to speed it up.
    Another solution is to increase timer job run frequency or increase it's execution timeout. Changing frequency I left for the last resort.

    The assumption the timeout is limiting deleting stored proc execution I've confirmed with ULS log:

    bw7k	State Service		StateSqlSession.DeleteExpiredSessions(): Exception for database StateService_cee884e83df5475585c1a26e9b19631a. Details: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    Is this timeout configurable?

    Monday, June 22, 2020 8:48 AM

Answers

  • Hi Roman,

    The error message suggests that the execution time has gone beyond the value of CommandTimeout property, which by default is 30 seconds.

    The timeout of State Service Delete Expired Sessions timer job is technically configurable, but you will need to raise the CommandTimeOut to a bigger value as well to avoid Timeout errors.

    In addition, I would recommend changing the timer job’s recurring schedule instead of modifying the timeout value directly, for it might raise performance issues.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by Roman Annenko Tuesday, June 23, 2020 11:05 AM
    Tuesday, June 23, 2020 6:22 AM