Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cache+folder non unique
#1
Hello Intraweb,

using Delphi 10.2 and Intraweb 15.5.8
I've found a sad problem, trying to use the same folder to lunch several instance of the application (in IIS I create different application pool for each application).

In a hard scenario when we try to lunch all the applications at the same time, even if I see the correct number of w3wp process, sometime we receive an error about the cache directory, and the autocreated sub-folder in the cache dir are not the same number of w3wp process, as if the same cache sub-folder is used by more than one processes.

Is there any bug fix?

I was referring also to this old post 
https://www.atozed.com/forums/thread-373...che+folder

Thanks
Alberto
Reply
#2
(12-04-2025, 12:02 PM)mondoedp Wrote: Hello Intraweb,

using Delphi 10.2 and Intraweb 15.5.8
I've found a sad problem, trying to use the same folder to lunch several instance of the application (in IIS I create different application pool for each application).

In a hard scenario when we try to lunch all the applications at the same time, even if I see the correct number of w3wp process, sometime we receive an error about the cache directory, and the autocreated sub-folder in the cache dir are not the same number of w3wp process, as if the same cache sub-folder is used by more than one processes.

Is there any bug fix?

I was referring also to this old post 
https://www.atozed.com/forums/thread-373...che+folder

Thanks
Alberto

We have run multiple IIS appools for years for the same programs and never have issues.

Maybe this code will help you.   It is in our server controller.   Each app has a separate control file where the cache folder is different for each app.

      if SystemParams.ServerControllerParams.CacheDir <> '' then
        begin
          // Clear the cache directory to make sure that the temp folder is empty on startup,
          // Check to make sure that it is not using the windows temp directory

          if POS('windows',lowercase(SystemParams.ServerControllerParams.CacheDir)) = 0 then
          begin
            If SysUtils.DirectoryExists(trim(SystemParams.ServerControllerParams.CacheDir)) then
              System.IOUtils.TDirectory.Delete(trim(SystemParams.ServerControllerParams.CacheDir),true);
          end;
          // Now recreate it
          if Sysutils.ForceDirectories(SystemParams.ServerControllerParams.CacheDir) then
            CacheDir := SystemParams.ServerControllerParams.CacheDir;
          // Now recreate the Downloads directory (used for streaming non IW cache files)
          if Sysutils.ForceDirectories(SystemParams.ServerControllerParams.CacheDir + '\Downloads') then
            gDownloadDir := SystemParams.ServerControllerParams.CacheDir + '\Downloads\';
        end;
Reply
#3
(12-04-2025, 04:54 PM)joelcc Wrote:
(12-04-2025, 12:02 PM)mondoedp Wrote: Hello Intraweb,

using Delphi 10.2 and Intraweb 15.5.8
I've found a sad problem, trying to use the same folder to lunch several instance of the application (in IIS I create different application pool for each application).

In a hard scenario when we try to lunch all the applications at the same time, even if I see the correct number of w3wp process, sometime we receive an error about the cache directory, and the autocreated sub-folder in the cache dir are not the same number of w3wp process, as if the same cache sub-folder is used by more than one processes.

Is there any bug fix?

I was referring also to this old post 
https://www.atozed.com/forums/thread-373...che+folder

Thanks
Alberto

We have run multiple IIS appools for years for the same programs and never have issues.

Maybe this code will help you.   It is in our server controller.   Each app has a separate control file where the cache folder is different for each app.

      if SystemParams.ServerControllerParams.CacheDir <> '' then
        begin
          // Clear the cache directory to make sure that the temp folder is empty on startup,
          // Check to make sure that it is not using the windows temp directory

          if POS('windows',lowercase(SystemParams.ServerControllerParams.CacheDir)) = 0 then
          begin
            If SysUtils.DirectoryExists(trim(SystemParams.ServerControllerParams.CacheDir)) then
              System.IOUtils.TDirectory.Delete(trim(SystemParams.ServerControllerParams.CacheDir),true);
          end;
          // Now recreate it
          if Sysutils.ForceDirectories(SystemParams.ServerControllerParams.CacheDir) then
            CacheDir := SystemParams.ServerControllerParams.CacheDir;
          // Now recreate the Downloads directory (used for streaming non IW cache files)
          if Sysutils.ForceDirectories(SystemParams.ServerControllerParams.CacheDir + '\Downloads') then
            gDownloadDir := SystemParams.ServerControllerParams.CacheDir + '\Downloads\';
        end;

Thank you Joel, 
I think that the solution to avoid the poblem is to use different cache folder as you do.
May I ask you in wich event you execute the code above, and how you mange different control file?
In our case, the applications use the same dll, but we use different application pool to split the job into several 32bit process, to bypass the 2GB memory limit.

Thanks
Alberto
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)