Report this

What is the reason for this report?

Jetty Timeout Problem When Serving Images

Posted on June 19, 2015

Hi,

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

Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Upgrading Jetty version from 9.2.2.v20140723 to 9.2.10.v20150310 fixed the issue!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.