Free Support Forum - groupdocs.com

Load Balanced / Multi node site utilizing GroupDocs.Viewer


#1

What is the standard / best way to setup a load balanced site utilizing Groupdocs.Viewer / MVC 5


We have a small site that utilizes groupdocs to serve pdf’s , png’s etc

When we put that site onto two nodes we started receiving File Not Found errors in the viewer.

We think this is because we don’t have a shared RootStoragePath as used in

Viewer.SetRootStoragePath(rootStoragePath, workingDirPath)

ie Files are uploaded to one node, attempted to be viewed on another node

Is the correct topology to have a shared rootStoragePath, and a local workingDirPath?

Or is it better to have the workingDirPath shared also, so that if one node caches a document all nodes have access to it ?

What is the standard implementation / setup for a multi-node site utilizing GroupDocs.Viewer?

#2
Hello Tommy,

Thank you for your posting and using GroupDocs.Viewer.

Best practice of using GroupDocs.Viewer for .NET for the multi-node site is in using shared rootStoragePath and shared workingDirPath. Also you should use prefixing for the cached document name with a value unique to each node.

This means that if web server 1’s ID is “123” and web server 2’s ID is “456”, each server will generate a document that will not clash with another server e.g. “123_23_Resume.doc” and “345_23_Resume.doc” (where “23” is the attachment ID).

The servers will not be fighting over the same file name “23_Resume.doc” and the client browser will be requesting resources specific to its originally rendered document

If you will have more questions please feel free to contact us.

------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+


#3

Why would we have a shared root storage path and shared working dir path, if we prefix each file so there is no collision?


We need to be able to, on one node, take a stream (representing a file we get from elsewhere), place it into the root storage path, and have all nodes be able to access it. It would be best if they also shared working dir path, so that one node caching a document would cause it to be cached for all nodes.

It seems like adding a webserver id would break this idea.





#4

Can I get an update to this question?


#5
Hello Tommy,

Thank you for your request and for your patience.

The approach that we described is already used by other our customers, so we shared it with you. Did you try the approach? The option with the prefixing was shared with us by one our customer. Initially we advised to them to use shared rootStoragePath and workingDirPath. But you can try to build your project without the prefixing and share with us the results.

Why you need shared folders? Because you need access to the same resources from both nodes.

What is a possible issue without prefixing - there can be file and folder locking problems accessing the same resources from different servers.

Please note that we are handling all requests in a thread so be sure we will handle any your request, but it can take some time. So please be patient. If you need more from our support we can advice you to buy the enhanced support, please check about it more here.

------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+