![]() The GUI itself does not hang, in fact the Stop button disables after a moment, but the transformation does not proceed. It consistently hangs (tested several times, waiting up to 1.6 hours) that is, Pentaho reports starting the job in the Logging window, then nothing more. These have hops between them: 1 to 2 to 3 to 4. Run a stored procedure against the table modified in #3.Run a stored procedure against the table populated in #2.Write to a staging table, with truncation (import table).Read a pipe-delimited text (a text file input step).If your DBA can't live with the locks even if the queue is a separate database, then maybe you could refactor your tasks into many more smaller tasks that are shorter lived. You may want to consider moving your queue database outside of your application database if it isn't already and enable the SlidingInvisibilityTimeout option. Whether you enable this option or not is dependent on your situation. Our DBA did not like the database locks, so I just removed this SlidingInvisibilityTimeout option to use the old transactional based message fetching algorithm since I didn't have any long running jobs in my queue. It is meant for long running jobs that may cause backups of transactional logs to error out (as there is a database transaction that is still active as part of the long running job).UseSqlServerStorage( There is a newer configuration option called SlidingInvisibilityTimeout when configuring SqlServerStorage that causes these database locks as part of newer fetching non-transactional message fetching algorithm. ):ĭo you have any idea why the Hangfire is hitting so many queries at each second? There are just 4 jobs and even those are completed (SELECT * FROM. Var server = new BackgroundJobServer(options) Var options = new BackgroundJobServerOptions ![]() QueuePollInterval = TimeSpan.FromHours(5), // Hangfire will poll after 5 hrs to check failed jobs. SlidingInvisibilityTimeout = TimeSpan.FromMinutes(30), ![]() ConnectionString, new SqlServerStorageOptionsĬommandBatchMaxTimeout = TimeSpan.FromMinutes(5), ![]() SetDataCompatibilityLevel(CompatibilityLevel.Version_170) Reference for GlobalConfiguration.Configuration: Here is the code of GetHangfirServers we are using: public static IEnumerable GetHangfireServers() with (readcommittedlock, forceseek) where = of various combinations of timespan values we set. JobQueue with (nolock)Įxec sp_executesql N'select count(*) from. with (readcommittedlock, forceseek) where = distinct(Queue) from. I have searched the documentation but could not find anything which could explain these two properties or how to set them to avoid DB locks.ĮDIT: The following queries are executed at every second: exec sp_executesql N'select count(*) from. QueuePollInterval = TimeSpan.FromHours(5)Įach site has around 20 background jobs, a few of them run every minute, whereas others every hour, every 6 hours and some once a day. This could possibly be due to these properties we setup: SlidingInvisibilityTimeout = TimeSpan.FromMinutes(30), We noticed almost 670+ locking queries because of Hangfire. It seems like Hangfire is locking our DB rendering whole DB unusable. We have identified one RPC Event “sys.sp_getapplock 1” In the all blocking sessions. Checking the DB logs, we found out there were multiple locking queries. We noticed that when we upgraded these sites to use Hangfire, the DB server collapsed. ![]() We have around 150 sites on our server, with each site using Hangfire 1.7.2. We are using Hangfire 1.7.2 within our ASP.NET Web project with SQL Server 2016. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |