.net core 6 / ubuntu - Background service - high CPU usage

464 views
Skip to first unread message

Stan

unread,
Aug 28, 2022, 6:45:04 AM8/28/22
to rabbitmq-users
Hi,

I'm running around 30 .net core 6 workers and I notice there's a huge CPU usage (my server is close to 100% cpu usage).

I stopped 10 of them, but the cpu usage remains the same except that the active workers use more CPU.

The context.
RabbitMQ Cluster (3 nodes) on 3 remote servers.
All the workers run from a Ubuntu 22.04 server
RabbitMQ.Client 6.4.0
I use quorum queue


Did I miss something?

By the way I run the same workers with a Redis Stream support (without RabbitMQ)




This is how look like my consumers (I think they are very simple).

private async Task CoreProcessAsync(int terminaison, CancellationToken stoppingToken)
        {
            await Task.Delay(1, stoppingToken);
            int nombreMaxi = _parametres.NbItemsACharger;
            string queueName = $"{RABBITMQ_QUEUES_ROUTING.MQTT}-{terminaison}";
            var consumerAsync = new AsyncEventingBasicConsumer(_rabbitChannel);
            consumerAsync.Received += async (model, ea) =>
            {
                var body = ea.Body.ToArray();
                var message = Encoding.UTF8.GetString(body);
                var item = JsonSerializer.Deserialize<MqttFluxBoitier>(message);
                MqttFlux myMqttItem = new MqttFlux
                {
                    Topic = item.Topic,
                    Payload = item.Payload
                };
                await SendAsync(myMqttItem);
                _rabbitChannel.BasicAck(ea.DeliveryTag, false);
            };
            _rabbitChannel.BasicQos(0, (ushort)nombreMaxi, false);
            basicConsumerTag = _rabbitChannel.BasicConsume(queue: queueName, autoAck: false, consumer: consumerAsync);
            while (!stoppingToken.IsCancellationRequested);
            _logger.ForContext("Terminaison", terminaison).Warning("Déconnexion");
}



All the workers in action

b1.PNG


After stopping 10 of them

b2.PNG

Redis Version without RabbitMQ

b3.PNG







Luke Bakken

unread,
Aug 30, 2022, 9:50:47 AM8/30/22
to rabbitmq-users
Reply all
Reply to author
Forward
0 new messages