Problem with Realm on Azure Asp Core


#1

I have Asp Core .NET that using 10 Realm Instances.
All ok on MacBook local server, but when I deploy on Azure, I can open only 4 Realm any time and app run great.
When I open Realm N.5 I obtain a server timeout.

I have already set:

var root = Path.GetTempPath();
SyncConfigurationBase.Initialize(UserPersistenceMode.NotEncrypted, basePath: root);

Too many open files? How I can close a Realm in .NET. I have try a User.Logout any time but I have always same error.

Thanks
Luigi


#2

Realm instances are disposable, so you can call .Dispose or just initialize them in a using statement to close them. It’s a bit surprising that the file descriptor limit is so low on Azure - perhaps you should look for a way to raise it.


#3

Thank for the answer. I have try to Dispose() last Realm before open next Realm but It’s don’t work.
I have no idea how increase descriptor limit on Azure.


#4

There should be a webconfig settings for that, but i’m not developing to .netCore since 2 years :slight_smile:


#5

ok, thanks! I have solved call realm.Dispose.

This don’t works:

Realm.GetInstance(config).Dispose()

This works!

Realm realm= Realm.GetInstance(config); //Store this realm in Controller

and after:

realm.Dispose();

Thanks!!!