Q:

How costly it is to create a new IModel instance in RabbitMQ

I am using RabbitMQ .Net core client and I have many consumers consuming the same message.
The consumers should not wait for each other to finish so I am lunching each in a new thread.
I was registering IModel as a singleton in IOC
 services.AddSingleton(mb =>
        {
            var factory = new ConnectionFactory
            {
                HostName = HostName,
                UserName = Username,
                Password = Password,
                VirtualHost = VirtualHost
            };
            var connection = factory.CreateConnection();
            return connection.CreateModel();
        }); 

but if I start my app and the queue already contains messages, I get the following exception:

"Pipelining of requests forbidden"

I searched the issue and it seems like I can't pass the same IModel instance to multiple threads.
To override the issue I have two solutions, either register IModel as transient or use lock whenever I use IModel instance.
my question is: how costly it is to have a new instance of IModel whenever IModel is needed, hence a new connection to RabbitMQ will be initiated each time IModel is requested?
Is it worthy to use lock whenever an IModel instance is used?

A:

how costly it is to have a new instance of IModel whenever IModel is
  needed

I am pretty confident that the performance is fine for your application. Benchmarks can be run if you need to prove something.

...hence a new connection to RabbitMQ will be initiated each time
  IModel is requested?

Why do you think that is the case? Have you run Wireshark on port 5672 to see what actually happens when CreateModel is called?
Spoiler alert: CreateConnection is what creates a connection, and CreateModel opens a channel on that connection. You are correct that you can't share IModel instances among threads, so create one per-thread. It will be fast enough!
The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

