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
After stopping 10 of them
Redis Version without RabbitMQ