I have a service in my java application that I get the id of an image, height and width. I do image resizing according to the provided dimensions and return the bytes. As I am using a nginx in front of application server(tomcat), requests are taking too long to process because nginx is on a different server than tomcat. Nginx is receiving the bytes and then delivering. I wonder if anyone has gone through this problem and found a better solution.
Infrastructure (Amazon)
1 EC2 Micro (Nginx)
1 Elastic Load Balance
2 EC2 Medium (Java Application)
Nginx send requests to ELB.
I believe the problem is the transfer of bytes between the load balance and the nginx instance