Failed to establish a connection to the database...

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Failed to establish a connection to the database...

Post by jschuit » Tue Oct 16, 2007 2:40 pm

Starting about a week ago, we started getting the following entries in the log file:

Critical Error downloading file! Exception of type System.OutOfMemoryException was thrown.

VaultFileUpload.aspx encountered: an exception while copying the request's input stream.Exception of type System.OutOfMemoryException was thrown.

Vault Failed to establish a connection to the database.
System.NullReferenceException: Object reference not set to an instance of an object.

At this point, the system appears dead to the clients. (can't log in) Restarting the server machine will bring everything back up and working again, for generally 2 to 4 days.


Both clients and server are at v3.1.8.
The server is a 2003 box with dual hyper-threading processors, 4 gb ram, 500gb storage, database is approx 56gb, 100 active user accounts, approx 30 active max concurrently.
Mods: changed the 'max pool size' to 200 (about a year ago), changed TreeManagerSize from default to 250 (after first event last week)

Let me know what additional information you need to solve this!

Thanks.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Tue Oct 16, 2007 2:59 pm

Can you tell me what the size of your .mdf and .ldf files for sgvault are?

How large of space do you have configured for the paging file (virtual memorty)?

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Post by jschuit » Tue Oct 16, 2007 3:11 pm

Hi Beth, here is the info you requested:

MDF: 53,792,256 bytes
LDF: 3,828,544 bytes

pagefile: 4GB

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Tue Oct 16, 2007 3:45 pm

Can you look in your server's event viewer for around the same time that you get the out of memory error and let me know if you see any types of errors there?

Try setting the DBBufferSizeKB in your Vault.config to 512 if it's on 256.

When these out of memory errors occur are there any large operations occurring? You might want to check out this KB on delta compression: The TreeDeltaCompresionThreshold option. This is also set in the vault.config file.

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Post by jschuit » Tue Oct 16, 2007 3:59 pm

There wasn't anything in the event log around the time of the out-of-memory exception.

I'll try mod'ing those two values... (I assume you are suggesting I disable the TreeDeltaCompresionThreshold)

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Tue Oct 16, 2007 4:46 pm

Try each one separately so you can observe what happens for each. Yes, you can do what the article suggests to see if that ends the memory issues. It will help me narrow down exactly what's causing that error.

Is your Vault server in debug mode? If not, set that in the Admin web page and perform an iisreset.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Wed Oct 17, 2007 8:26 am

A lot of memory optimizations were made in Vault in later versions. You might also want to consider upgrading.

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Post by jschuit » Fri Oct 19, 2007 7:37 am

After changing only the DBBufferSizeKB to 512 on the 16th, Vault had the OutOfMemory exception again this morning. (I'll email the log files to you Beth) I'm setting the TreeDeltaCompresionThreshold now.

We have purchased the v4.x upgrades, just can't wedge the downtime in among the projects to perform the update yet.

(edit: err, what is your email Beth? Its not in your profile...)

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Fri Oct 19, 2007 8:01 am

Send that to support at sourcegear.com (attn: Beth) with a link to this thread.
Thanks.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Fri Oct 19, 2007 8:05 am

One more setting I'd like you to change. Look for Tree Manager Size and set that to 100 or 50. Then perform an iisreset.

After that setting, if you are still getting memory errors, then I think upgrading will be the next step and I can help you with that. You might be losing more time to the errors than the time needed for an upgrade (you'd have to be the judge of that).

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Post by jschuit » Fri Oct 19, 2007 12:45 pm

Email sent.

Our TreeManagerSize is currently 250, should I make this change now? ..or wait until the next exception occurs?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Fri Oct 19, 2007 1:03 pm

You can go ahead and do that now. Then do an iisreset.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Fri Oct 19, 2007 1:11 pm

What's your paging file like or virtual memory size?

jschuit
Posts: 52
Joined: Thu Jul 29, 2004 10:16 am

Post by jschuit » Fri Oct 19, 2007 1:13 pm

The pagefile is 4GB (see above), Vault just had another exception so the question about when to apply that is now moot. I've set it to 50.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Mon Oct 22, 2007 5:32 pm

Any updates after changing the treemanager size?

Locked