window存在的一些问题!

本文提供了Azure Table存储服务的几个实用建议,包括调整最大连接数、禁用100-continue行为、关闭Context跟踪等。同时,还介绍了如何在Azure Web角色中正确配置自定义HTTP处理器及使用角色配置文件中的存储连接信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1」。 Some Tips for table service.

  「1.1」 修改最大连接数,如果需要。

  Config file:

  

  

  

  

  

  代码:

  ServicePointManager.DefaultConnectionLimit = 24;

  「1.2」 Turn off 100-continue

  Config file:

  

  

  

  

  

  代码:

  ServicePointManager.Expect100Continue = false;

  「1.3」 关闭Context跟踪,如果用不上的环境(比如都是查询)

  context.MergeOption = MergeOption.NoTracking;

  「1.4」 合理利用PartitionKey & RowKey

  具体参见: More about “PartitionKey”&"RowKey“ in windows azure table storage

  <2> using customer httphandler in windows azure webrole, 在webrole中使用自定义HttpHandler.

  由于部署以后的webrole实际运行在IIS7上面,如果您配置的是:

  

  

  将会报错,正确的配置是在节点中。

  

  

  

  

  

  

  

  <3> 使用role配置文件里的storage连接信息创建client account时,使用以下代码:

  CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");

  出现以下错误:

  Exception: SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used.

  解决方案:

  在 public override bool OnStart()中加入以下代码:

  CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>

  {

  configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));

  RoleEnvironment.Changed += (anotherSender, arg) =>

  {

  if (arg.Changes.OfType()

  。Any((change) => (change.ConfigurationSettingName == configName)))

  {

  if (!configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)))

  {

  RoleEnvironment.RequestRecycle();

  }

  }

  };

  });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值