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.

performance issue

See original GitHub issue

Description:

EnergySubscriber.UseApplicationMessageReceivedHandler(e =>
    {
        Task.Run(async () =>
        {
            Console.WriteLine("message received");
            Console.WriteLine(DateTimeOffset.UtcNow.ToString());
            var message = Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
            await ProcessEnergyMQTTMessage(message);
        });
    });

Above given code snippet, working perfectly in vs debug mode, processing every message coming completely from the publisher. But when I run the same code in K8s pods, it received the message but process the message partially. Every time it behaves differently (i mean, it processes the message 30%, 40%, 60%, 90%), a few time it completed the process, save it into DB.

But if I removed the task.run as code given below so it starts to process the message completely but it shows lag in telemetry.

EnergySubscriber.UseApplicationMessageReceivedHandler(e =>
    {
        Console.WriteLine("message received");
        Console.WriteLine(DateTimeOffset.UtcNow.ToString());
        var message = Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
        ProcessEnergyMQTTMessage(message).Wait();
    });

Please help to run this code with task.run

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bilalmalik777commented, Aug 29, 2019

@SeppPenner I find out the reason, actually DB connection is not getting free, so I am working on optimizing long-running queries. hopefully, it would resolve the problem. If the issue remains the same, I will contact you. But right now I think it is not an MQTT problem. Thanks

1reaction
SeppPennercommented, Aug 29, 2019

@bilalmalik777 Does this solve your issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with Performance Problems
Types of Performance Problems ; Quantity of work (untimely completion, limited production). Poor prioritizing, timing, scheduling; Lost time ; Quality of work ( ......
Read more >
9 Examples of a Performance Issue
A performance issue is a failure to meet the basic requirements of a job. They are based on reasonable expectations of behavior and...
Read more >
Handling Performance Issues With Grace
Low Productivity or Late Completion – Make sure you've been clear about the requirements and expectations of the job. · Poor Quality of...
Read more >
Performance Issues · microsoft/vscode Wiki
The following sections describe how you can narrow down a performance issue. Visual Studio Code is consuming a lot of CPU. High CPU...
Read more >
Performance Issue Root-Cause Diagnostic
Tool Overview: Accurately assessing employee performance issues is a critical part of providing high-quality performance evaluations.
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