在c#中,我能够为SSL3或TLS设置静态值,例如
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
Run Code Online (Sandbox Code Playgroud)
要么:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
Run Code Online (Sandbox Code Playgroud)
但是(我相信)这将影响我的应用程序中所有未来的HttpWebRequest对象.
有没有办法为给定的HttpWebRequest或至少为给定的URI设置此值?
注意我看到了这个:
Uri uri = new Uri(url);
ServicePoint sp = ServicePointManager.FindServicePoint(uri);
Run Code Online (Sandbox Code Playgroud)
但ServicePoint没有SecurityProtocol属性.
目前我认为我必须在创建新的HttpWebRequest之前设置静态全局属性.
这感觉不对,这也意味着:
我在SQL Azure中有一个数据库,在15到30分钟之间做一个简单的操作:
select count(id) from mytable
Run Code Online (Sandbox Code Playgroud)
数据库大约3.3GB,计数返回大约2,000,000,但我已经在本地尝试过,只需不到5秒!
我也运行了一个:
ALTER INDEX ALL ON mytable REBUILD
Run Code Online (Sandbox Code Playgroud)
在数据库中的所有表上.
如果有人能指出我试图诊断/解决这个问题,我将不胜感激.
(请跳到下面的更新3,因为我现在认为这是问题,但我仍然不明白).
更新1:聚集索引扫描中99%的时间似乎如下图所示.我有

更新2:这就是我做的时候统计信息的回复:
SET STATISTICS IO ON
SET STATISTICS TIME ON
select count(id) from TABLE
Run Code Online (Sandbox Code Playgroud)
统计:
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 317037 ms.
SQL Server …Run Code Online (Sandbox Code Playgroud) 这个问题从这个问题开始,但现在似乎更恰当地问了,因为我意识到这是一个与DTU相关的问题.
基本上,运行:
select count(id) from mytable
Run Code Online (Sandbox Code Playgroud)
编辑:添加where子句似乎没有帮助.
运行8到30 分钟(而SQL Server的本地副本上的相同查询大约需要4 秒).
下面是运行此查询时Azure门户中MONITOR选项卡的屏幕截图.注意我在没有触及数据库大约一周后做了这个,Azure报告我只使用了1%的DTU.

一些额外的东西:
我很欣赏它可能只是我有限的理解,但如果有人能够澄清这是否真的是预期的行为(即一个简单的计数需要这么长时间才能运行并最大化我的DTU),我将非常感激.
我收到以下错误:
Error: The process cannot access the file 'C:\DWASFiles\Sites\mywebsitename\VirtualDirectory0\site\wwwroot\newrelic\NewRelic.Agent.Core.dll' because it is being used by another process.
Run Code Online (Sandbox Code Playgroud)
在尝试从Github部署Azure网站时,在Running deployment命令...日志文件中.
将不胜感激任何可能导致此问题的指示.
更新:当直接从VS.NET发布以下内容时,这也失败了:
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4196,5): Warning : An error was encountered when processing operation 'Create File' on 'NewRelic.Agent.Core.dll'.
1>Retrying operation 'Update' on object filePath (mywebsitename\newrelic\NewRelic.Agent.Core.dll). Attempt 1 of 2.
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4196,5): Error : Web deployment task failed. ((06/07/2013 23:54:58) An error occurred when the request was processed on the remote computer.)
Run Code Online (Sandbox Code Playgroud)
这是以前工作,我不知道为什么它会停止.
有没有比遍历每个提交并调用以下命令更有效的方法来获取与提交相关的添加/删除计数:
GET /repos/:owner/:repo/commits/:sha
Run Code Online (Sandbox Code Playgroud)
( https://developer.github.com/v3/repos/commits/ )
只是为了得到:
"stats": {
"additions": 104,
"deletions": 4,
"total": 108
},
Run Code Online (Sandbox Code Playgroud)
数据?
不幸的是,提交端点:
GET /repos/:owner/:repo/commits
Run Code Online (Sandbox Code Playgroud)
包含大量关于每次提交的数据,但不包含这个细节,这意味着需要大量额外的 API 调用来获取它。
网站工具位于:https: //developers.facebook.com/tools/debug/
任何用户都可以使用它来检查它们的令牌,但似乎是API终点:https: //graph.facebook.com/debug_token
仅适用于app开发人员.
首先,我只想确认是这种情况?
其次,我想知道如果有一个API端点来检查任何令牌是否是这样的话?无法理解为什么不允许这样做,因为有一个UI /网页功能来执行此操作.