关于资源池资源占用问题

yanchangshan 2017-09-08 08:13:30
想问下 我做了个网站 主要是搜索 量较大 几百万的搜索 用的是lucent.net 网站老是挂掉 空间商答复是资源池满了 难道lucent.net 很占资源池吗 如果不是 我再查其他原因 也用了缓存 就一点数据啊
...全文
425 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanchangshan 2017-09-12
  • 打赏
  • 举报
回复
查了半天 基本判断是 我lucent.net 查询这里有问题 因为用缓存的那个只有几百数据 ,我后来把数据删除了 还是出现问题 用lucent 我查询之后就释放了 我是在页面load事件中 定义一个变量 var result来接收查询数据的 会不会这里的原因 每次加载就定义一个var result 接收数据 如果可能是这个原因 应该怎么做
闭包客 2017-09-12
  • 打赏
  • 举报
回复
全文检索就是很占资源的。
yanchangshan 2017-09-08
  • 打赏
  • 举报
回复
lucent.net查询 也有关闭啊

//上面查询代码就不贴了
                    listResult.Add(result);

                }
                return listResult;
            }
            finally
            {
                searcher.Close();
                reader.Close();
                directory.Close();
            }
yanchangshan 2017-09-08
  • 打赏
  • 举报
回复
我就做了点缓存 唯一就是时间短 如下代码
 
  string[] hotFocus = new string[12];
            if (HttpRuntime.Cache["hotFocus"] == null)
            {
                //select top 5 * from baiduHotFocus order by newid()
                string sqlStr = "select top 12 HotFocus from baiduHotFocus where status=1  and HotFocus in(select top 30 HotFocus from baiduHotFocus order by Updatetime desc)   order by newid()";
                DataTable dt = SqlHelper.ExecuteDataTable(sqlStr);

                for (int i = 0; i < 12; i++)
                {

                    hotFocus[i] = dt.Rows[i][0].ToString().Trim();
                }
                if (hotFocus != null)
                {
                    HttpRuntime.Cache.Insert("hotFocus", hotFocus, null, DateTime.Now.AddMinutes(1), TimeSpan.Zero);
                }
            }

            else
            {
                hotFocus =(string[]) HttpRuntime.Cache["hotFocus"];
            }

yanchangshan 2017-09-08
  • 打赏
  • 举报
回复
lucent 也几乎查完就释放
yanchangshan 2017-09-08
  • 打赏
  • 举报
回复
几百万的数据用的是lucent.net 我上面说过了 缓存用的数据库就几百条数据 用的空间是bluehost 看介绍什么都好 几乎不限制 用了之后 一天当十几次 问原因说资源池只有150M 满了就当 已经被坑了 只能考虑我程序 可是也没用啥 啊 就两个东西 一个lucent 一个缓存 缓存也几乎没什么数据
yanchangshan 2017-09-08
  • 打赏
  • 举报
回复
你说的是lucent.net 吗
shoppo0505 2017-09-08
  • 打赏
  • 举报
回复
连接使用完要回收,不然一直挂在那里。 然后越积越多,就挂掉了
peng2739956 2017-09-08
  • 打赏
  • 举报
回复
引用 3 楼 yanchangshan 的回复:
我就做了点缓存 唯一就是时间短 如下代码
 
  string[] hotFocus = new string[12];
            if (HttpRuntime.Cache["hotFocus"] == null)
            {
                //select top 5 * from baiduHotFocus order by newid()
                string sqlStr = "select top 12 HotFocus from baiduHotFocus where status=1  and HotFocus in(select top 30 HotFocus from baiduHotFocus order by Updatetime desc)   order by newid()";
                DataTable dt = SqlHelper.ExecuteDataTable(sqlStr);

                for (int i = 0; i < 12; i++)
                {

                    hotFocus[i] = dt.Rows[i][0].ToString().Trim();
                }
                if (hotFocus != null)
                {
                    HttpRuntime.Cache.Insert("hotFocus", hotFocus, null, DateTime.Now.AddMinutes(1), TimeSpan.Zero);
                }
            }

            else
            {
                hotFocus =(string[]) HttpRuntime.Cache["hotFocus"];
            }

慢着! 几百万的数据量 你不优化下SQL的?

and HotFocus in(select top 30 HotFocus from baiduHotFocus order by Updatetime desc)  //还用In? 另外你的索引呢 我怎么没看到

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧