根据请求确定目标 IIS 工作进程
好吧,奇怪的设置,奇怪的问题。 我们的 SaaS 应用程序有一个客户端和一个管理 Web 应用程序,在 asp.net-2.0/iis-6 上运行。 管理应用程序可以更改客户端应用程序上显示的选项。 当这些选项保存在管理员中时,我们从管理员调用客户端上的 Web 服务,以刷新该特定帐户的选项缓存。
最近,我们开始为客户端应用程序提供 > 1 个工作进程,从而导致仅在当前运行的工作进程中的 1 个上清除选项缓存。
所以,我显然有其他途径来解决这个问题(但是欢迎输入),但是我的问题是:有没有办法通过网络请求来定位/迭代每个工作进程?
Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the Client, from the Admin, to flush our cache of the options for that specific account.
Recently we started giving our Client application >1 Worker Processes, thus causing the cache of options to only be cleared on 1 of the currently running Worker Processes.
So, I obviously have other avenues of fixing this problem (however input is appreciated), but my question is: is there any way to target/iterate through each Worker Processes via a web request?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在这里对此答案做出一些假设...
我假设客户端应用程序正在使用 .NET 缓存类之一来存储应用程序的选项?
当你说“刷新”时,你的意思是将它们刷新回配置文件或数据库表吗?
当你说“刷新”
由于缓存对象和数据不会在进程之间共享,因此您需要一种机制来向在其他工作进程上运行的代码发出信号,表明它需要将其选项重新读入其缓存或强制进程重新启动(这不是非常方便,但很可能是不需要的)。
如果您无权访问客户端源来修改以监视选项配置文件或数据库表(例如使用 SqlCacheDependency),我认为您有点陷入这种行为。
I'm making some assumptions here for this answer....
I'm assuming the client app is using one of the .NET caching classes to store your application's options?
When you say 'flush' do you mean flush them back to a configuration file or db table?
Because the cache objects and data won't be shared between processes you need a mechanism to signal to the code running on the other worker process that it needs to re-read it's options into its cache or force the process to restart (which is not exactly convenient and most likely undesirable).
If you don't have access to the client source to modify to either watch the options config file or DB table (say using a SqlCacheDependency) I think you're kinda stuck with this behaviour.
我可以完全访问管理员和客户端,通过缓存,我的意思是.net 的缓存对象。 我所说的刷新是指从缓存对象中删除该项目。
我知道两个工作进程不共享缓存数据。 这就是我的难题)
系统就是这样消除每个新会话进入时都需要点击sql的方式。所以我试图找到一个解决方案,可以告诉每个工作进程缓存需要已清除,无需涉及 sql。
I have full access to admin and client, by cache, I mean .net's Cache object. By flush I mean removing the item from the Cache object.
I'm aware that both worker processes don't share the cache data. That's sort of my conundrum)
The system is the way it is to remove the need to hit sql every new-session that comes in. So I'm trying to find a solution that can just tell each worker process that the cache needs to be cleared w/o getting sql involved.