Problem with app deployed using load balancer (HAProxy)

Hi.


I’m using GroupDocs.Annotations 2.1.0 (Java) in a simple Viewer application I’m developing to open PDF and MS Office files. It were developed using web servlets just like on the demo application of GroupDocs.

The application is deployed on 2 Wildfly servers behind a HAProxy load balancer. The load balancer provides me a common interface to access the application, controlling session and resources. If I use only one server on the load balancer, the GroupDocs viewer application works fine. If i use both two servers, the application sometimes works, sometimes shows me an error: a screen of GroupDocs is shown (I’ve translated the original message) with a generic error meessage.

The log file is attached to this message. The problem is ocurring when calling the servlet GetDocumentPageImageServlet on the following line: annotationHandler.getDocumentPageImageHandler(path, width, quality, usePdf, pageIndex, isPrint, watermarkPosition, watermarkFontSize, useHtmlBasedEngine, rotate, response).

Do you have any configuration to avoid this kind of problem when using a load balancer? Any configuration concerning about cache, image loading?

If you need aditional information, like configuration files for Wildfly or HAProxy or source-code for the constructed application, please contact me.
Hello,

Thank you for your inquiry.

Unfortunately, we don't have any tested configuration that can help you to avoid such problem , when you use a load balancer. As we understand that the issue occurs because you use two web servers, that generated the cache of files on two servers. So, if the cache will be generated on one server, then it can not be available for other server. We notified our product team about your request and they will implement this improvement for the next generation of the GroupDocs.Annotations library.

We can recommend you try to use any other third party server (like Amazon S3) as a cache storage. So your two servers will process the documents and generate the cache, that will be stored on the Amazon server.

Also you can try to assign different identifications for the cache of the file for different servers . So, if on first server, the cache with identification of first server can not be found , then will generate new cache for this server.

---------

Best regards,
Evgen Efimov

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

Hi, Evgen.


About the cache problem you mentioned, I think I don’t have this problem. To clarify, I am talking about the files cache (cache of images generated to show the pages and thumbnais) created by GroupDocs. On my both servers I mapped a network directory that points to the same location on the hard disk. So, doesn’t matter from which server I try to open a document; it will exist (with cache files) at the path used to open the file. My documents are stored on a directory /opt/system/documents and the cache files are on /opt/system/documents/cache. So, both servers access the same documents and cache files. That kind of configuration should avoid the problem you are describing, wright?

That’s why I think is not no accessing the cache files.
Hello,

Could you please specify, the directory /opt/system/documents/cache exists on both servers or is it exist on the one server only and other server just linked with this directory?

We will wait for your details.

----------

Best regards,
Evgen Efimov

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

Hi, Evgen.



I talked to my colleague at network infrastructure and he helped me.



We have two Wildfly servers at different machines; let’s call it server1 and server2:

- both points to a NFS share which is on a third machine

- the visible directory on both servers is /opt/system/documents/ – it is a NFS share; it points to the same directory on the third machine

- inside this directory we have a ‘cache’ directory. It is only on this third server. Both server1 and server2 access it through the NFS /opt/system/documents/, and then /opt/system/documents/cache; this ‘cache’ directory doesn’t exist on server1 neither server2 machines

Hello,

We think, that the issue can depend from third party libraries that used in our library. We notified our Product team about your request and created a ticket in our issue tracking system .

As you know, at the moment our Product team works on a new generation of the library and unfortunately this issue should be fixed only in this generation.

Note: Could you please specify the issue occurs with all file types or with a specific one?

----------

Best regards,
Evgen Efimov

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

Hi.


Sorry for the delay to answer.

After you ask, my colleague at infrastructure department told me that the ‘cache’ directory were empty. I forgot to configure the application to write on it. The application were writing on the temp directory on separate files. Then I adjusted it to write a ‘cache’ directory on the path of the file that is being opened. But the problem persists. The application is unstable, sometimes opening the files, sometimes not. It just works well when the HAProxy is controlling only one server. Just to clarify, the configuration is the following:

- 2 instance of Wildfly Server with the same application controlled by a load balancer (HAProxy) with HTTPS
- on both servers, the files are reading on a filesystem path (NFS share) (for example, on /opt/system/files) pointing to the same file/directory on a third server
- there’s a cache where both servers read/write to that is inside the NFS share. For example, it is at /opt/system/files/cache

I’ve tested opening a TIFF file and the same problem occurs.

Thank you.

Hi,


Thank you for this information. We will provide additional investigation and then return to you.

Sorry for the inconvenience.
Hello Rafael,

As we mentioned earlier, that we have created a ticket and we attached it to this thread. We notified our Product team, about your additional information, it was very useful. You will be notified when the feature will be available in our new generation of the GroupDocs.Annotation library.


-----------

Best regards,
Evgen Efimov

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

Hi, Evgen.


So, do you confirm this is a bug? Do you know when the new generation of GroupDocs.Annotaitons will be released? Is it the version 2.1.0? Or a 3.0? I’m working with this viewer for a long time (months) and really need this feature to use the application in a load balancer.
Hello,

Unfortunately, according to our support policy we can't share any estimated date of the release. We can only say that the new version will be 3.0.

About the issue , we can't confirm that it is a bug , because we doesn't tested it with the load balancer , so we can considered it as a new feature. As we said you earlier that we created a ticket for this issue and our Product team will work on it .

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+

Hello.


Any update about this feature?
Hello Rafael,

Unfortunately our Product team still not fixed the issue , you can check a status of the issue in the first post. Please be patient , we will notify you when the issue will be fixed.

Sorry for the inconvenience.

----------

Best regards,
Evgen Efimov

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