question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Task history takes too long to load on remote server for small number of logs

See original GitHub issue

TaskEventLog takes really long time to load logs for a particular task even for small number of logs.

I am using TaskEventLog constructor to connect to a remote server to read logs/history of a task. The code takes really long time to finish even for a small number of logs (30-60 entries). I am not getting any run time exceptions so I think that the creation of TaskEvent object is taking long. Please find below the code and other details.

  • Library Version - 2.8.16
  • Remote Server - Windows Server 2016 , 64-bit, x64 based processor

Any help/suggestions to resolve this issue is greatly appreciated.

TaskEventLog log = new TaskEventLog(@"\Test Task",
                // Specify the event id(s) you want to enumerate
                new int[] {
                    200 /* ActionStart */,
                    201 /* ActionSuccess */ ,
                    202 /* ActionFailure */
                },
 // Specify the start date of the events to enumerate. Here, we look at the last week.
 DateTime.Now.AddDays(-7), "Server", "Domain", "Username", "Password");

// Tell the enumerator to expose events 'newest first'
log.EnumerateInReverse = false;

//The below code takes long time to finish (more than 5 minutes for 50 odd logs)
var history = log.Select(ev => new History
                {
                    Level = ev.Level,
                    Created = ev.TimeCreated,
                    EventId = ev.EventId,
                    TaskCategory = ev.TaskCategory,
                    OperationalCode = ev.OpCode,
                    CorrelationId = ev.ActivityId
                })
                .ToList();

//Custom class for displaying History on the UI
public class History
    {
        public string Level { get; set; }
        public DateTime? Created { get; set; }
        public int EventId { get; set; }
        public string TaskCategory { get; set; }
        public string OperationalCode { get; set; }
        public Guid? CorrelationId { get; set; }
    }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
priyank89patelcommented, Apr 2, 2020

Yes, this surely is a Microsoft issue. However, I noticed that the same code performs better (much quicker) when deployed to some of our environments (DEV & TEST) so I think it is really slower on my work computer (may be some restrictions/security things I haven’t figured out yet). I appreciate your time and all the help with this. Thank you!

I have the same issue. Please could you tell me whether you have found the reason of your performance problems?

Unfortunately I could not find any solution to fix the performance issue, however, there was a significant performance improvement after the application was deployed to server. I was facing this issue on my workstation.

0reactions
Fenix-Zcommented, Apr 2, 2020

Yes, this surely is a Microsoft issue. However, I noticed that the same code performs better (much quicker) when deployed to some of our environments (DEV & TEST) so I think it is really slower on my work computer (may be some restrictions/security things I haven’t figured out yet).

I appreciate your time and all the help with this. Thank you!

I have the same issue. Please could you tell me whether you have found the reason of your performance problems?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does it take so long to view logs on a server?
Yes, reading logs takes a long time in the log file viewer. A few things to fix it: Try using xp_readerrorlog with filtered...
Read more >
High CPU usage troubleshooting guidance
Task Manager. Use Task Manager to view CPU consumption to help identify the process or application that's causing high CPU usage:.
Read more >
windows 7 - How to see scheduled task logs?
Just pause long enough for the task to finish. Another thing I do is to put the average run time in the description...
Read more >
Read history of a task on a remote server
Nope, the \taskname is just fine, in fact it's required (it's the path). You're having the same issue I was having until I...
Read more >
SQL Server Transaction Log Growth Monitoring and ...
In the transactional systems with excessive logging operations, the SQL Server Transaction Log file will grow rapidly, until it reaches its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found