Could not bootstrap exception thrown in IIS, when handling multiple concurrent access

Getting this exception in my application deployed to IIS. Here’s the details.

Could not bootstrap - check inner exceptions for details.
Couchbase.Configuration.Server.Serialization.BootstrapException: Could not bootstrap - check inner exceptions for details. —> System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Couchbase.IO.DefaultConnectionFactory.<>c__01.<GetGeneric>b__0_0(IConnectionPool1 p, IByteConverter c, BufferAllocator b)
at Couchbase.IO.SharedConnectionPool1.CreateAndAuthConnection() at Couchbase.IO.SharedConnectionPool1.Acquire()
at Couchbase.IO.Services.PooledIOService…ctor(IConnectionPool connectionPool)
at Couchbase.IO.IOServiceFactory.<>c__DisplayClass0_0.b__0(IConnectionPool pool)
at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String username, String password)
— End of inner exception stack trace —

Hi @ryan.ym.tham,

Would you mind posting your configuration and maybe some of the code that you think might be useful (bootstrapping or maybe an example of the concurrent access)?

1 Like

In our code DAL layer. We did not make use of singleton way of sharing cluster or bucket but we create connection and dispose it right away once we’ve finish using. Making use of c# Using statement for disposal. Another thing that I realise was number of active connection to couchbase server increases to thousands after some massive calls. And eventually my IIS crashes with the exception message as above and i will have to restart the application in IIS to have it back online. After restart, number of connection can see significantly reduced.

@ryan.ym.tham -

Please read through the connection management documentation. You most definitely do not want to be opening a bucket every time you make a call to the database, instead you’ll want to create/initialize the client when the application starts and dispose/close of it when the application shuts down.


1 Like

Thanks for the suggestion and ive actually tried to rely single connection via ClusterHelper. At first we find there is a tradeoff in performance when multiple concurrent call being made. But after adjusting the application pool size. Its working good and fast now.