Search code examples
c#imageresizerdiskcache

ImageResizer diskcache System.IO.IOException


The following exception is logged in our application:

System.IO.IOException: Insufficient system resources exist to complete the requested service. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.FlushOSBuffer() at System.IO.FileStream.Flush(Boolean flushToDisk) at ImageResizer.Plugins.DiskCache.CustomDiskCache.<>c__DisplayClass29_0.b__0() at ImageResizer.Plugins.DiskCache.LockProvider.TryExecute(String key, Int32 timeoutMs, LockCallback success) at ImageResizer.Plugins.DiskCache.CustomDiskCache.GetCachedFile(String keyBasis, String extension, ResizeImageDelegate writeCallback, Int32 timeoutMs, Boolean asynchronous) at ImageResizer.Plugins.DiskCache.DiskCache.Process(IResponseArgs e) at ImageResizer.Plugins.DiskCache.DiskCache.Process(HttpContext context, IResponseArgs e) at ImageResizer.InterceptModule.HandleRequest(HttpContext context, HttpModuleRequestAssistant ra, IVirtualFile vf) at ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

We have a load balanced environment with two web servers using the same cache folder on a separate file server.

Our diskcache configuration is like this:

<diskcache dir="~/imageresizercache" autoClean="true" hashModifiedDate="true" />

Any idea why we get this exception? Thanks,


Solution

  • Could you share the diagnostics page? /resizer.debug

    It sounds like there is a bottleneck connected to the shared file server. Generally it is best to disable autoClean if the cache files are not stored locally.