Tuesday, 15 April 2014

ruby on rails - AWS S3 404 errors slowing down performance significantly -


I am uploading images directly from my rail app to S3 when I load an index page Shows, then he has to get the URL directly from S3.

What I am trying to do is to check whether their presence exists by using the S3 image? Method in the API documentation, and if the image is present, show that image, and if it does not exist, show a default image that is stored in my property pipeline.

I am able to do this, however, actually the performance becomes very slow (10 seconds load time!) And because of my logs, due to all 404 keyfound errors, the returns for images Which does not exist. When I retrieve all the images without doing this? Page loads fast enough (less than 1 second - images that are not just empty on my web page)

How can I see it? I would like to show a default image in the case of the missing image. Store images on the S3, but watch the volume cache on seeing images on your server.

The use of the first page that tries to show the image will cost, but after that, the cache hit will reduce the reaction time for other efforts to show that image.

Some relatively simple piece of cash management logic, it can do a lot of good work to cache many ideas, which take "too much time" to collect.

The models being cached are responsible for terminating the cache of their data - when the cached data of a model example is changed, it only blows pieces of its cached data , Which show that part of the data - not all the cached scenes displaying all the data, only those affected

I have used different piece caches for index views, View Is shown to exist, and items related to "a different model data when a model appears in the scene."


No comments:

Post a Comment