我正在查看一个asp.net应用程序,在global.asax内部的应用程序开始时调用数据库。这些调用需要约3秒钟(取决于SQL缓存计划)才能运行。我注意到当我重新部署时,应用程序运行缓慢。我认为这是因为应用程序启动时对数据库的调用。然而,几分钟后应用程序再次需要加载时间。
为了找出发生了什么事情,我已经将它写入了日志文件(参见下文)。从这个文件中,您可以看到当多个请求第一次命中应用程序时,应用程序会多次启动。然后似乎是以随机方式触发application_start(任何2-10分钟) 。
根据我的理解,application_starts的工作原理应该只有在应用程序第一次启动时才会触发,然而它似乎会在多个客户端随机出现!根据MSDN的说法,“Application_Start事件在应用程序第一次启动时被触发。”
有人能帮助我弄清楚发生了什么吗?我正在使用IIS6和.net 2.0。我是否缺少应用程序池设置。
Many thanks Rippo
[12/02/2009 16:16:58] 91.84.25.241 - Application started, Sub MyRules started
[12/02/2009 16:17:06] 65.55.51.34 - Application started, Sub MyRules started
[12/02/2009 16:17:07] 91.84.25.241 - Application started, Sub MyRules completed
[12/02/2009 16:17:10] 65.55.51.34 - Application started, Sub MyRules completed
[12/02/2009 16:17:26] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:30] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:30] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:33] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:33] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:36] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:36] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:39] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:42] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:48] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:48] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:52] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:17:52] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:17:54] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:18:27] 91.84.25.241 - Application started, Sub MyRules started
[12/02/2009 16:18:31] 91.84.25.241 - Application started, Sub MyRules completed
[12/02/2009 16:18:31] 212.115.51.229 - Application started, Sub MyRules started
[12/02/2009 16:18:33] 212.115.51.229 - Application started, Sub MyRules completed
[12/02/2009 16:29:26] 167.230.38.115 - Application started, Sub MyRules started
[12/02/2009 16:29:28] 167.230.38.115 - Application started, Sub MyRules completed
[12/02/2009 16:29:34] 82.110.42.84 - Application started, Sub MyRules started
[12/02/2009 16:29:37] 82.110.42.84 - Application started, Sub MyRules completed
[12/02/2009 16:29:38] 82.110.42.84 - Application started, Sub MyRules started
[12/02/2009 16:29:41] 82.110.42.84 - Application started, Sub MyRules completed
[12/02/2009 16:32:53] 99.142.1.97 - Application started, Sub MyRules started
[12/02/2009 16:32:57] 99.142.1.97 - Application started, Sub MyRules completed
[12/02/2009 16:32:57] 99.142.1.97 - Application started, Sub MyRules started
[12/02/2009 16:33:01] 99.142.1.97 - Application started, Sub MyRules completed
[12/02/2009 16:33:01] 99.142.1.97 - Application started, Sub MyRules started
[12/02/2009 16:33:06] 99.142.1.97 - Application started, Sub MyRules completed
[12/02/2009 16:33:06] 99.142.1.97 - Application started, Sub MyRules started
[12/02/2009 16:33:10] 99.142.1.97 - Application started, Sub MyRules completed
[12/02/2009 16:33:11] 99.142.1.97 - Application started, Sub MyRules started
[12/02/2009 16:33:16] 99.142.1.97 - Application started, Sub MyRules completed
[12/02/2009 16:36:15] 65.55.51.34 - Application started, Sub MyRules started
[12/02/2009 16:36:17] 65.55.51.34 - Application started, Sub MyRules completed
[12/02/2009 16:41:37] 119.123.226.156 - Application started, Sub MyRules started
[12/02/2009 16:41:37] 62.49.121.122 - Application started, Sub MyRules started
[12/02/2009 16:41:40] 62.49.121.122 - Application started, Sub MyRules completed
[12/02/2009 16:41:40] 119.123.226.156 - Application started, Sub MyRules completed
[12/02/2009 16:41:41] 62.49.121.122 - Application started, Sub MyRules started
[12/02/2009 16:41:44] 62.49.121.122 - Application started, Sub MyRules completed
[12/02/2009 16:45:17] 84.70.249.242 - Application started, Sub MyRules started
[12/02/2009 16:45:19] 84.70.249.242 - Application started, Sub MyRules completed
[12/02/2009 16:47:03] 80.41.121.68 - Application started, Sub MyRules started
[12/02/2009 16:47:05] 80.41.121.68 - Application started, Sub MyRules completed
[12/02/2009 16:47:29] 81.179.26.249 - Application started, Sub MyRules started
[12/02/2009 16:47:31] 81.179.26.249 - Application started, Sub MyRules completed
[12/02/2009 16:47:59] 81.136.179.170 - Application started, Sub MyRules started
[12/02/2009 16:47:59] 81.136.179.170 - Application started, Sub MyRules started
[12/02/2009 16:48:02] 81.136.179.170 - Application started, Sub MyRules completed
[12/02/2009 16:48:02] 81.136.179.170 - Application started, Sub MyRules started
[12/02/2009 16:48:02] 81.136.179.170 - Application started, Sub MyRules completed
[12/02/2009 16:48:02] 81.136.179.170 - Application started, Sub MyRules started
[12/02/2009 16:48:04] 81.136.179.170 - Application started, Sub MyRules completed
[12/02/2009 16:48:04] 81.136.179.170 - Application started, Sub MyRules completed
[12/02/2009 16:52:35] 69.34.161.80 - Application started, Sub MyRules started
[12/02/2009 16:52:35] 69.34.161.80 - Application started, Sub MyRules started
[12/02/2009 16:52:35] 69.34.161.80 - Application started, Sub MyRules started
[12/02/2009 16:52:38] 69.34.161.80 - Application started, Sub MyRules completed
[12/02/2009 16:52:38] 69.34.161.80 - Application started, Sub MyRules started
[12/02/2009 16:52:39] 69.34.161.80 - Application started, Sub MyRules completed
[12/02/2009 16:52:39] 69.34.161.80 - Application started, Sub MyRules completed
[12/02/2009 16:52:40] 69.34.161.80 - Application started, Sub MyRules completed