Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Jetty Timeout Problem When Serving Images
I’m running a Spring MVC app served by an embedded Jetty server on Ubuntu 14.04. I also have a MySql server running. I have added swap space to prevent out-of-memory errors according to this tutorial: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
The droplet is the 5 USD/mo one with 512MB RAM, 1 core, 20 GB SSD. Performance is actually quite nice overall, but looking at the logs there are some hickups occasionally:
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 300000/300000 ms
This exception is only thrown for images; such as “images/lowres/a.jpg”, “images/lowres/b.jpg” and so on.
This error occurs almost exclusively on a page which serves 15 images, each of size about 35KB, so roughly 0.5MB.
What happens is that either all images load nicely in about 700-900 ms or 1-5 images are not loading, and these then proceed to time out, thus throwing the above IOException after 300000 ms (5 mintues).
I want to understand what is happening here, and how to fix it. Feedback is very much appreciated!
Just realized it would be a good idea to monitor the memory usage of my droplet to see if this is possibly a memory issue
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×