??xml version="1.0" encoding="utf-8" standalone="yes"?>精品一区二区三区免费毛片爱 ,粉嫩一区二区三区在线观看,欧美专区一二三http://www.aygfsteel.com/ebecket/archive/2010/03/30/316954.htmlbecket_zhengbecket_zhengTue, 30 Mar 2010 09:01:00 GMThttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316954.htmlhttp://www.aygfsteel.com/ebecket/comments/316954.htmlhttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316954.html#Feedback0http://www.aygfsteel.com/ebecket/comments/commentRss/316954.htmlhttp://www.aygfsteel.com/ebecket/services/trackbacks/316954.html
(1)、back_logQ?br /> 求MySQL 能有的连接数量。当主要MySQLU程在一个很短时间内得到非常多的q接hQ这pv作用Q然后主U程׃旉(管很短)查连接ƈ且启动一个新U程?br /> back_log值指出在MySQL暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。只有如果期望在一个短旉内有很多q接Q你需要增加它Q换句话_(d)q值对到来的TCP/IPq接的侦听队列的大小。你的操作系l在q个队列大小上有它自q限制?试图讑֮back_log高于你的操作pȝ的限制将是无效的?br /> 当你观察你的Lq程列表Q发现大?264084 | unauthenticated user | xxx.xxx.xxx.xxx | NULL | Connect | NULL | login | NULL 的待q接q程Ӟp加大 back_log 的g。默认数值是50Q我把它改ؓ(f)500?br />
(2)、interactive_timeoutQ?br /> 服务器在关闭它前在一个交互连接上{待行动的秒数。一个交互的客户被定义ؓ(f)?mysql_real_connect()使用 CLIENT_INTERACTIVE 选项的客戗?默认数值是28800Q我把它改ؓ(f)7200?br />
(3)、key_buffer_sizeQ?br /> 索引块是~冲的ƈ且被所有的U程׃n。key_buffer_size是用于烦引块的缓冲区大小Q增加它可得到更好处理的索引(Ҏ(gu)有读和多重写)Q到你能负担得v那样多。如果你使它太大Q系l将开始换ƈ且真的变慢了。默认数值是8388600(8M)Q我的MySQLL?GB内存Q所以我把它改ؓ(f)402649088(400MB)?br />
(4)、max_connectionsQ?br /> 允许的同时客L(fng)数量。增加该值增?mysqld 要求的文件描q符的数量。这个数字应该增加,否则Q你经常看?Too many connections 错误?默认数值是100Q我把它改ؓ(f)1024 ?br />
(5)、record_bufferQ?br /> 每个q行一个顺序扫描的U程为其扫描的每张表分配q个大小的一个缓冲区。如果你做很多顺序扫描,你可能想要增加该倹{默认数值是131072(128K)Q我把它改ؓ(f)16773120 (16M)

(6)、sort_bufferQ?br /> 每个需要进行排序的U程分配该大的一个缓冲区。增加这值加速ORDER BY或GROUP BY操作。默认数值是2097144(2M)Q我把它改ؓ(f) 16777208 (16M)?br />
(7)、table_cacheQ?br /> 为所有线E打开表的数量。增加该D增加mysqld要求的文件描q符的数量。MySQLҎ(gu)个唯一打开的表需?个文件描q符。默认数值是64Q我把它改ؓ(f)512?br />
(8)、thread_cache_sizeQ?br /> 可以复用的保存在中的U程的数量。如果有Q新的线E从~存中取得,当断开q接的时候如果有I间Q客L(fng)U置在缓存中。如果有很多新的U程Qؓ(f)了提高性能可以q个变量倹{通过比较 Connections ?Threads_created 状态的变量Q可以看到这个变量的作用。我把它讄?80?br />
(10)、wait_timeoutQ?br /> 服务器在关闭它之前在一个连接上{待行动的秒数?默认数值是28800Q我把它改ؓ(f)7200?br />
注:(x)参数的调整可以通过修改 /etc/my.cnf 文gq?MySQL 实现。这是一个比较}慎的工作Q上面的l果也仅仅是我的一些看法,你可以根据你自己L的硬件情况(特别是内存大)q一步修攏V?a class="hidden" >本文 51CTO.COM技术博?/a>


becket_zheng 2010-03-30 17:01 发表评论
]]>
MySQL服务器安装完之后如何调节性能 http://www.aygfsteel.com/ebecket/archive/2010/03/30/316953.htmlbecket_zhengbecket_zhengTue, 30 Mar 2010 09:00:00 GMThttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316953.htmlhttp://www.aygfsteel.com/ebecket/comments/316953.htmlhttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316953.html#Feedback0http://www.aygfsteel.com/ebecket/comments/commentRss/316953.htmlhttp://www.aygfsteel.com/ebecket/services/trackbacks/316953.html
译者:(x)叉荣(Email:Q,转蝲h明译者和出处Qƈ且不能用于商业用途,q者必I?br />
My favorite question during Interview for people to work as MySQL DBAs or be involved with MySQL Performance in some way is to ask them what should be tuned in MySQL Server straight after installation, assuming it was installed with default settings.
在面试MySQL DBA或者那些打做MySQL性能优化的hӞ我最喜欢问题是:(x)MySQL服务器按照默认设|安装完之后Q应该做哪些斚w的调节呢Q?br />
I’m surprised how many people fail to provide any reasonable answer to this question, and how many servers are where in wild which are running with default settings.

令我很惊讶的是,有多h对这个问题无法给出合理的{案Q又有多服务器都运行在默认的设|下?br />
Even though you can tune quite a lot of variables in MySQL Servers only few of them are really important for most common workload. After you get these settings right other changes will most commonly offer only incremental performance improvements.

管你可以调节很多MySQL服务器上的变量,但是在大多数通常的工作负载下Q只有少数几个才真正重要。如果你把这些变量设|正了Q那么修改其他变量最多只能对pȝ性能改善有一定提升?br />
key_buffer_size - Very important if you use MyISAM tables. Set up to 30-40% of available memory if you use MyISAM tables exclusively. Right size depends on amount of indexes, data size and workload - remember MyISAM uses OS cache to cache the data so you need to leave memory for it as well, and data can be much larger than indexes in many cases. Check however if all of key_buffer is used over time - it is not rare to see key_buffer being set to 4G while combined size of .MYI files is just 1GB. This would be just a waste. If you use few MyISAM tables you’ll want to keep it lower but still at least 16-32Mb so it is large enough to accommodate indexes for temporary tables which are created on disk.

key_buffer_size - q对MyISAM表来说非帔R要。如果只是用MyISAM表,可以把它讄为可用内存的 30-40%。合理的值取决于索引大小、数据量以及(qing)负蝲 -- CQMyISAM表会(x)使用操作pȝ的缓存来~存数据Q因此需要留出部分内存给它们Q很多情况下数据比烦引大多了。尽如此,需要L查是否所有的 key_buffer 都被利用?-- .MYI 文g只有 1GBQ?key_buffer 却设|ؓ(f) 4GB 的情冉|非常的。这么做太浪费了。如果你很少使用MyISAM表,那么也保留低?16-32MB ?key_buffer_size 以适应l予盘的(f)时表索引所需?br />
innodb_buffer_pool_size This is very important variable to tune if you’re using Innodb tables. Innodb tables are much more sensitive to buffer size compared to MyISAM. MyISAM may work kind of OK with default key_buffer_size even with large data set but it will crawl with default innodb_buffer_pool_size. Also Innodb buffer pool caches both data and index pages so you do not need to leave space for OS cache so values up to 70-80% of memory often make sense for Innodb only installations. Same rules as for key_buffer apply - if you have small data set and it is not going to grow dramatically do not oversize innodb_buffer_pool_size you might find better use for memory available.

innodb_buffer_pool_size - q对Innodb表来说非帔R要。Innodb相比MyISAM表对~冲更ؓ(f)敏感。MyISAM可以在默认的 key_buffer_size 讄下运行的可以Q然而Innodb在默认的 innodb_buffer_pool_size 讄下却跟蜗牛似的。由于Innodb把数据和索引都缓存v来,无需留给操作pȝ太多的内存,因此如果只需要用Innodb的话则可以设|它高达 70-80% 的可用内存。一些应用于 key_buffer 的规则有 -- 如果你的数据量不大,q且不会(x)暴增Q那么无需?innodb_buffer_pool_size 讄的太大了?br />
innodb_additional_pool_size This one does not really affect performance too much, at least on OS with decent memory allocators. Still you might want to have it 20MB (sometimes larger) so you can see how much memory Innodb allocates for misc needs.

innodb_additional_pool_size - q个选项Ҏ(gu)能影响q不太多Q至在有差不多_内存可分配的操作pȝ上是q样。不q如果你仍然惌|ؓ(f) 20MB(或者更?Q因此就需要看一下Innodb其他需要分配的内存有多?br />
innodb_log_file_size Very important for write intensive workloads especially for large data sets. Larger sizes offer better performance but increase recovery times so be careful. I normally use values 64M-512M depending on server size.

innodb_log_file_size 在高写入负蝲其是大数据集的情况下很重要。这个D大则性能相对高Q但是要注意到可能会(x)增加恢复旉。我l常讄?64-512MBQ跟据服务器大小而异?br />
innodb_log_buffer_size Default for this one is kind of OK for many workloads with medium write load and shorter transactions. If you have update activity spikes however or work with blobs a lot you might want to increase it. Do not set it too high however as it would be waste of memory - it is flushed every 1 sec anyway so you do not need space for more than 1 sec worth of updates. 8MB-16MB are typically enough. Smaller installations should use smaller values.

innodb_log_buffer_size 默认的设|在中等强度写入负蝲以及(qing)较短事务的情况下Q服务器性能q可以。如果存在更新操作峰值或者负载较大,应该考虑加大它的g。如果它的D|太高了Q可能会(x)费内存 -- 它每U都?x)刷Cơ,因此无需讄过1U所需的内存空间。通常 8-16MB p够了。越的pȝ它的D?br />
innodb_flush_logs_at_trx_commit Crying about Innodb being 100 times slower than MyISAM ? You probably forgot to adjust this value. Default value of 1 will mean each update transaction commit (or each statement outside of transaction) will need to flush log to the disk which is rather expensive, especially if you do not have Battery backed up cache. Many applications, especially those moved from MyISAM tables are OK with value 2 which means do not flush log to the disk but only flush it to OS cache. The log is still flushed to the disk each second so you normally would not loose more than 1-2 sec worth of updates. Value 0 is a bit faster but is a bit less secure as you can lose transactions even in case MySQL Server crashes. Value 2 only cause data loss with full OS crash.

innodb_flush_logs_at_trx_commit 是否为Innodb比MyISAM?000倍而头大?看来也许你忘了修改这个参C。默认值是 1Q这意味着每次提交的更C务(或者每个事务之外的语句Q都?x)刷新到盘中,而这相当耗费资源Q尤其是没有甉|备用~存时。很多应用程序,其是从 MyISAM转变q来的那些,把它的D|ؓ(f) 2 可以了Q也是不把日志h到磁盘上Q而只h到操作系l的~存上。日志仍然会(x)每秒h到磁盘中去,因此通常不会(x)丢失每秒1-2ơ更新的消耗。如果设|ؓ(f) 0 快很多了,不过也相对不安全?-- MySQL服务器崩溃时׃(x)丢失一些事务。设|ؓ(f) 2 指挥丢失h到操作系l缓存的那部分事务?br />
table_cache - Opening tables can be expensive. For example MyISAM tables mark MYI header to mark table as currently in use. You do not want this to happen so frequently and it is typically best to size your cache so it is large enough to keep most of your tables open. It uses some OS resources and some memory but for modern hardware it is typically not the problem. 1024 is good value for applications with couple hundreds tables (remember each connection needs its own entry) if you have many connections or many tables increase it larger. I’ve seen values over 100.000 used.

table_cache -- 打开一个表的开销可能很大。例如MyISAM把MYI文g头标志该表正在用中。你肯定不希望这U操作太频繁Q所以通常要加大缓存数量,使得以最大限度地~存打开的表。它需要用到操作系l的资源以及(qing)内存Q对当前的硬仉|来说当然不是什么问题了。如果你?00多个表的话,那么讄?1024 也许比较合适(每个U程都需要打开表)Q如果连接数比较大那么就加大它的倹{我曄见过讄?100,000 的情c?br />
thread_cache Thread creation/destructions can be expensive, which happen at each connect/disconnect. I normally set this value to at least 16. If application has large jumps in amount of concurrent connections and I see fast growth of
Threads_Created variable I boost it higher. The goal is not to have threads created in normal operation.

thread_cache -- U程的创建和销毁的开销可能很大Q因为每个线E的q接/断开都需要。我通常臛_讄?16。如果应用程序中有大量的跌q发q接q且 Threads_Created 的g比较大,那么我就?x)加大它的倹{它的目的是在通常的操作中无需创徏新线E?br />
query_cache If your application is read intensive and you do not have application level caches this can be great help. Do not set it too large as it may slow things down as its maintenance may get expensive. Values from 32M to 512M normally make sense. Check it however after a while and see if it is well used. For certain workloads cache hit ratio is lower than would justify having it enabled.

query_cache -- 如果你的应用E序有大量读Q而且没有应用E序U别的缓存,那么q很有用。不要把它设|太大了Q因为想要维护它也需要不开销Q这?x)导致MySQL变慢。通常讄?32-512Mb。设|完之后最好是跟踪一D|_(d)查看是否q行良好。在一定的负蝲压力下,如果~存命中率太低了Q就启用它?br />
Note: as you can see all of these are global variables. These variables depend on hardware and mix of storage engines, while per session variables are typically workload specific. If you have simple queries there is no reason to increase sort_buffer_size even if you have 64GB of memory to waste. Furthermore doing so may decrease performance.
I normally leave per session variable tuning to second step after I can analyze workload.

注意Q就像你看到的上面这些全局表量Q它们都是依据硬仉|以?qing)不同的存储引擎而不同,但是?x)话变量通常是根据不同的负蝲来设定的。如果你只有一些简单的查询Q那么就无需增加 sort_buffer_size 的gQ尽你?64GB 的内存。搞不好也许?x)降低性能?br /> 我通常在分析系l负载后才来讄?x)话变量?br />
P.S Note MySQL distribution contains bunch of sample my.cnf files which may be great templates to use. Typically they would already be much better than defaults if you chose correct one.

P.SQMySQL的发行版已经包含了各U?my.cnf 范例文g了,可以作ؓ(f)配置模板使用。通常q比你用默认设|好的多了?/div>


becket_zheng 2010-03-30 17:00 发表评论
]]>
[集群]基础http://www.aygfsteel.com/ebecket/archive/2010/03/30/316951.htmlbecket_zhengbecket_zhengTue, 30 Mar 2010 08:57:00 GMThttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316951.htmlhttp://www.aygfsteel.com/ebecket/comments/316951.htmlhttp://www.aygfsteel.com/ebecket/archive/2010/03/30/316951.html#Feedback0http://www.aygfsteel.com/ebecket/comments/commentRss/316951.htmlhttp://www.aygfsteel.com/ebecket/services/trackbacks/316951.html
1.L(fng)要什么是集群技术?Z么要使用集群技术?
集群是一l协同工作的服务实体Q用以提供比单一服务实体更具扩展性和可用?/strong>的服务^台?/div>
2.误Z所知道的集种c,和实现方案?
目前Linux下的集群主要有三U类?nbsp;
1. HA (High Availability) 
2. LB (Load Balancing) 
3. HPC (High performance Computing) 
?DC (Distributed Computing) 
?PC (Parallel Computing)
高性能计算集群QHigh Performance Compute clusteringQ(?BeowulfQ用多个机器来为需要大量计能力的d提供更强大的计算能力。RHEL没有内嵌q类集群的解x案?nbsp;
高可用性集(High-availability clusteringQ用多个机器来为某个服务或某组服务提供额外的可靠性?nbsp;
负蝲均衡集群QLoad-balance clusteringQ用特D的路由技术来l一l服务器分配d?nbsp;
RedHat提供了后两种集群技术的解决Ҏ(gu)。用一l程序来监视该系l和集群中的服务的健L(fng)c?/div>
虽然集群pȝq不能解x有的pȝ问题Q但是它能够帮助pȝ理员最大限度地利用现有的资源。ƈ不是所有的E序都适用于集系l,但是常见的系l应用如HTTP服务QFTP服务Q数据库服务都可以利用集系l来增强它们的功能?/div>
3.什么时候需要用LB集群Q?/div>
公共WEB服务、FTP服务、数据库服务{高负蝲服务中?/div>
4.什么时候需要用HA集群Q?/div>
Ha集群主要用于文g服务QW(xu)EB服务Q数据库服务{关键应用中
5.Linux下实现LB集群的项目是Q?/div>
目前在LINUXpȝ下用最为广泛的LB集群pȝ为LVS


becket_zheng 2010-03-30 16:57 发表评论
]]>
SQL注入 相关http://www.aygfsteel.com/ebecket/archive/2010/03/22/316111.htmlbecket_zhengbecket_zhengMon, 22 Mar 2010 01:01:00 GMThttp://www.aygfsteel.com/ebecket/archive/2010/03/22/316111.htmlhttp://www.aygfsteel.com/ebecket/comments/316111.htmlhttp://www.aygfsteel.com/ebecket/archive/2010/03/22/316111.html#Feedback0http://www.aygfsteel.com/ebecket/comments/commentRss/316111.htmlhttp://www.aygfsteel.com/ebecket/services/trackbacks/316111.html

看了竹的《SQL注入天书之ASP注入漏洞全接触》,感觉q篇文章写得非常好,由浅入深Q实例详,Ҏ(gu)手v到教学作用,对老手起到交流探讨作用Q目前近40%的ASP|页均存在此漏洞Q可以说《SQL注入天书之ASP注入漏洞全接触》也来得非常实用?/p>

我是从其它网站上拯?#8220;   http://www.mytest.com/showdetail.asp?id=49 ;and (select count(*) from sysobjects)>0
  修改为:(x)
http://www.mytest.com/showdetail.asp?id=49 and (select count(*) from sysobjects)>0

SQL Server注入漏洞可能造成什么损失呢Q?br />   轻:(x)查看数据库名、SQL Serverq接名、得到表的字D与记录{?br />   重:(x)备䆾数据库、下载数据库、在计算机内d理员等?/p>

“查看数据库名、SQL Serverq接名、得到表的字D与记录”之类的攻击,对于存在注入漏洞的网一般都可实现。但若是使用Web理|站QW(xu)eb的密码又没加密,q样事态就变严重了。另外对于SELECT语句Q如果没有控制好LockTypeQ应讄为adLockReadOnlyQ,也是很严重的?/p>

对于ASPQSQL Server如何d防范注入漏洞Q?/strong>
  一、对q入sql语句的数字先q行cd转换
  二、对q入sql语句的字W,单引号("'")替换Z个单引号("''")或其?/p>

仅此两点卛_Q也许有Z(x)问,那么文中W?|_(d)(x)

在入门篇提到Q有很多人喜Ƣ用’h试注入漏z,所以也有很多h用过?#8217;L(fng)Ҏ(gu)?#8220;防止”注入漏洞Q这也许能挡住一些入门者的dQ但对SQL注入比较熟?zhn)的hQ还是可以利用相关的函数Q达到绕q程序限制的目的?/div>   是什么意思呢Q既然说q行cd转换Q过滤掉"'"可以了Q这里怎么又说可以l过"'"的限制呢Q其实,q里所说的是指Ҏ(gu)字类型或我们注入d的sql。也是_(d)(x)

对sql = "……where id=" & request.QueryString("id")
  ?*.asp?id=char(50)Qchar?x)v到函数的作用

或者where xtype=char(85)Q见文中W?)Qchar也会(x)起到函数的作用?/p>

但对于sql = "……where key='" & request.QueryString("key") & "'"
  ?*.asp?key=char(50)Q这里的char(50)是不起作用的Qؓ(f)什么呢Q?br />   套入sql一看,语句是这L(fng)Q?br />   sql = "……where key='char(50)'"
  char(50)位于"'"内,变成了字W(ԌQ所以就起不到函数的作用了?/p>

L好的?fn)惯Q制定统一的规?br />   上面的方法确实解决了注入漏洞问题Q但q不表示其它地方可以马虎了,Z么要马虎了,Z么要让自q|页千疮癑֭Q让几句代码ȝ挡一面呢Q如果不L好的?fn)惯Q团体之间如果不制定l一的规范,今天q个问题解决了,明天那个问题q会(x)出现?/p>

Q、用RecordSet记录集之前必d断RecordSet的BOF或EOF属性?br />   Q、对于SELECT语句Q除了不得已的情况,LockType必须讄为adLockReadOnly?br />   Q、放入数据库中的密码应该使用良好的加密算法进行加密,同时也禁止密码以明文的Ş式存在于面文g中?br />   Q、在Web条g下,在非本机调试的情况下Q不得用saq接数据库?br />   Q、对于需要用h限的q_Q必d用户名和密码载入sessionQ然后在需要的面q行判断Q不得用if session("loginOK")<>"" then之类的语句来判断用户是否是合法用戗?br />   ……
  必要Ӟ可以止IISq回详细的出错信息,可以止public对sysobjects表的SELECT权限?br />   ……

安全不是一斚w的,仅靠几个规范几个好的?fn)惯q不能保证能造就出安全的I间Q?个False?9个Trueq行“?#8221;q算Q结果还是FalseQ从中可以看出,哪怕只有一炚w误,都可能导致结果全盘被否定。Web安全Q除了注入漏z,q有FTP讄错误、Web服务讄错误、后台程序漏z这些最最基本的都可能D服务器整个被人控Ӟ所以处处都要三思啊?/p>
再次说明防注入不是替换关键字Q?br />

最q又看到很多关于 SQL 注入的帖子,都是使用替换 select、delete、update {字W串的方法来防注入的?/p>

再说明一下,q种是错误的防注入方法,原因如下Q?/span>

  1. 可能替换不全Q不是所有的关键字都列入其中了的?
  2. 本nq种替换有漏洞Q比?aandnd 本n没有问题Q把其中?and 替换掉后Q反而冒Z?and 出来?
  3. q种替换方式q破坏了文字的原义,我曾l在某个|站上注册了 candy q个用户名,后来该系l却告诉我没有这个用P后来才知?candy 中的 and 被去掉了?/li>

正确的防注入Ҏ(gu)是:(x)

  • Ҏ(gu)字类型进?sql 前强制{换ؓ(f)数字?
  • Ҏ(gu)本类型进?sql 前替换单引号为双引号?
  • Ҏ(gu)期类型进?sql 前强制{换成日期Qƈ替换单引号ؓ(f)双引受?/li>

q是从注入的原理来防的?/p>

becket_zheng 2010-03-22 09:01 发表评论
]]>服务器应用程序不可用 -IIS中浏览出现错?的解x?/title><link>http://www.aygfsteel.com/ebecket/archive/2010/03/19/315865.html</link><dc:creator>becket_zheng</dc:creator><author>becket_zheng</author><pubDate>Fri, 19 Mar 2010 01:24:00 GMT</pubDate><guid>http://www.aygfsteel.com/ebecket/archive/2010/03/19/315865.html</guid><wfw:comment>http://www.aygfsteel.com/ebecket/comments/315865.html</wfw:comment><comments>http://www.aygfsteel.com/ebecket/archive/2010/03/19/315865.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ebecket/comments/commentRss/315865.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ebecket/services/trackbacks/315865.html</trackback:ping><description><![CDATA[ 今天下了个源?Q结果在IIS中浏览出现错误:(x) <div style="text-indent: 2em"> 今天遇到q个问题试很多Ҏ(gu)Q最后看到这文章,解决了!Q?br /> <wbr></div> <div style="text-indent: 2em"><font style="font-size: 12px"> <wbr> <wbr> <wbr> </font><font style="font-size: 14px"><font style="font-size: 14px">"<font color="#ff0000">服务器应用程序不可用</font>" (zhn)试囑֜?Web 服务器上讉K?Web 应用E序当前不可用。请点击 Web 览器中?#8220;h”按钮重试(zhn)的h。管理员注意事项:详述此特定请求失败原因的错误信息可在 Web 服务器的pȝ事g日志中找到?br />  <wbr> <wbr> <wbr> 到日志去一查,发现Q?#8220;<font color="#ff0000">aspnet_wp.exe <wbr> (PID: 356)意外停止?/font>” <wbr>“׃ ASP.NET q程标识对全局E序集缓存没有读权限Q因此未能执行请求。错? 0x80070005 拒绝讉K?#8221;</font></font></div> <div><font style="text-indent: 2em" size="2"><br />  <wbr> <wbr> <wbr> <font style="font-size: 16px">到网上找了很长时间看了很多的相关资料Q有说是微Y补丁QKB886093Q的问题Q但是我的机器根本就没安q个补丁Q有的说需要重新注册IISQ有的说需要配|machine.config但是我有的项目是也是览的,郁闷了好久,试了很多办法,觉得问题可能是出在IIS的权限设|,所以又重新IIS的权限设|了一?具体做法Q?/font></font></div> <div><font style="font-size: 16px"> <wbr> <wbr> <wbr> IIS中左键单击需要运行的Web站点->所有Q?>权限向导->l承所有安全性设|?>完成.</font></div> <div><font size="3"> <wbr> <wbr> <wbr> l果你猜怎么了,哈哈Q涛C旧啦Q!Q?/font></div> <img src ="http://www.aygfsteel.com/ebecket/aggbug/315865.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ebecket/" target="_blank">becket_zheng</a> 2010-03-19 09:24 <a href="http://www.aygfsteel.com/ebecket/archive/2010/03/19/315865.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>搜烦优化的问?/title><link>http://www.aygfsteel.com/ebecket/archive/2010/02/01/311564.html</link><dc:creator>becket_zheng</dc:creator><author>becket_zheng</author><pubDate>Mon, 01 Feb 2010 14:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/ebecket/archive/2010/02/01/311564.html</guid><wfw:comment>http://www.aygfsteel.com/ebecket/comments/311564.html</wfw:comment><comments>http://www.aygfsteel.com/ebecket/archive/2010/02/01/311564.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ebecket/comments/commentRss/311564.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ebecket/services/trackbacks/311564.html</trackback:ping><description><![CDATA[<p>关于搜烦优化的问题:(x)<br /> 假设有个|站Q有主页 in,主页的链接l1,l2,l3.<br /> 目前q四个网늚搜烦关键字都是:(x)"A B C",如下Q?br /> <meta name="keywords" content="A|B|C" /> 都是一L(fng)?br /> 目前癑ֺ搜烦"A"Q排名第一Q搜索CQ排名非常的靠后?/p> <p>现在惌C也能在百度搜索里面靠前,所以打这P(x)<br /> l2和l3面分别Ҏ(gu)q样Q?br /> <meta name="keywords" content="B|C|A" /><br /> <meta name="keywords" content="C|A|B" /></p> <p>q样的话Q是不是可以了Q这样做Q会(x)不会(x)影响了A的搜索排名?</p> <img src ="http://www.aygfsteel.com/ebecket/aggbug/311564.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ebecket/" target="_blank">becket_zheng</a> 2010-02-01 22:36 <a href="http://www.aygfsteel.com/ebecket/archive/2010/02/01/311564.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>探寻IIS最大ƈ发数 http://www.aygfsteel.com/ebecket/archive/2010/01/20/310158.htmlbecket_zhengbecket_zhengTue, 19 Jan 2010 17:27:00 GMThttp://www.aygfsteel.com/ebecket/archive/2010/01/20/310158.htmlhttp://www.aygfsteel.com/ebecket/comments/310158.htmlhttp://www.aygfsteel.com/ebecket/archive/2010/01/20/310158.html#Feedback0http://www.aygfsteel.com/ebecket/comments/commentRss/310158.htmlhttp://www.aygfsteel.com/ebecket/services/trackbacks/310158.html探寻IIS最大ƈ发数

试pȝWindow 2003 Server ,IIS 6.0 ,ASP.Net 3.5 sp1
Dual 1.8双核Q?G内存Q?4G虚拟内存?/p>

Z探寻IIS的最大ƈ发数Q先要做几个假设?/p>

1、假设最大ƈ发数是当前的连接数。意思是当前能承受最大的q接Q那么就表明最大的q发?br /> 2、假设IIS应用E序池处于默认状态,更改讄会(x)Ҏ(gu)大连接数产生影响?/p>

做完假设Q现在做限制Q设|站点保持HTTPq接Q超时设|成0Q就是不?x)超时。在站点h的default.aspx面讄U程Thread.Sleep(int.MaxValue)Q接下来开发一个用来保持连接的程序?/p>


    class Program {
        
private volatile static int errorCount = 0;
        
private volatile static int rightCount = 0;

        
static void Main(string[] args) {
            ServicePointManager.DefaultConnectionLimit 
= 10000;
            
int count = 0;
            
int all = 0;
            
while (true) {
                all
++; count++;
                CreateThread();
                Thread.Sleep(
10);
                
if (count >= 200) {
                    Console.WriteLine(
string.Format("sucess:{0};error:{1}", all - errorCount, errorCount));
                    count 
= 0;
                }
                
if (all > 1800)
                    
break;
            }
            Console.ReadKey();
        }

        
static void CreateThread() {
            Thread thread 
= new Thread(ActiveRequest);
            thread.IsBackground 
= true;
            thread.Start();
        }

        
static void ActiveRequest() {
            RequestClient client 
= new RequestClient("http://192.168.18.2/default.aspx?d=" + Guid.NewGuid());
            client.RequestProcess();
            
if (client.IsError) {
                errorCount
++;
                Console.WriteLine(
string.Format("错误消息:{0}", client.Messages));
            } 
else {
                rightCount
++;
                
//Console.WriteLine(client.Messages);
            }
        }
    }

/**
 * author : yurow
 *      
http://birdshover.cnblogs.com
 * description:
 *      
 * history : created by yurow 2009-8-16 0:29:05 
 
*/

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace MaxLinked {
    
/// <summary>
    
/// 
    
/// </summary>
    public class RequestClient {
        HttpWebRequest request;
        WebResponse response;

        
public RequestClient(string url) {
            request 
= (HttpWebRequest)HttpWebRequest.Create(url);
            request.Timeout 
= int.MaxValue;
            request.KeepAlive 
= true;
            ErrorCode 
= -1;
        }

        
public void AddHeader(string name, string value) {
            request.Headers.Add(name, value);
        }

        
private bool isError = false;
        
private StringBuilder buffer = new StringBuilder();

        
public int ErrorCode { getset; }

        
public bool IsError {
            
get { return isError; }
        }

        
public string Messages {
            
get { return buffer.ToString(); }
        }

        
public void RequestProcess() {
            
try {
                response 
= request.GetResponse();
            } 
catch (WebException ex) {
                ErrorCode 
= (int)ex.Status;
                buffer.Append(ex.Message);
                isError 
= true;
            } 
            
if (response != null) {
                Stream stream 
= null;
                StreamReader reader 
= null;
                
try {
                    
//stream = response.GetResponseStream();
                    
//reader = new StreamReader(stream, Encoding.UTF8);
                    
//buffer.Append(reader.ReadToEnd());
                } catch (Exception ex) {
                    buffer.Append(ex.Message);
                    isError 
= true;
                } 
finally {
                    
//if (reader != null)
                    
//    reader.Close();
                    
//if (stream != null)
                    
//    stream.Close();
                }
            } 
else {
                isError 
= true;
                buffer.Append(
"建立q接p|Q?/span>");
            }
        }

        
public void Close() {
            
if (response != null)
                response.Close();
            request.Abort();
        }
    }
}

 

E序讄为只能启?800个线E,q是׃.Net单进E最大线E数好像?000个。因此,要测试最大ƈ发数Q要需要同时开几个试q程。把pȝ虚拟内存调到最大|U程q多?x)急剧占用内存。现在开始测试?/p>

打开web站点的性能计数器,把显C比例调?万?/p>

发现?000个连接时QIIS服务器崩溃(503错误Q,L了个澡,发现IIS服务器无法自׃复错误。又试了几ơ,发现最大ƈ发值是8200个,但是一般到5000左右׃(x)崩溃Q有时候甚臛_?000个?/p>

?200个计,一个用户开一个浏览器览|页Q可能会(x)占用2?个连接(参考?a id="homepage1_HomePageDays_DaysList_ctl00_DayItem_DayList_ctl00_TitleUrl" class="postTitle2" >IISq接数实验——Web开发必?/span> 》),按两个计,那么IIS默认情况下,最大ƈ发数?000个左叟?/p>

打开应用E序池配|,把最大工作进E数调高Q默认ؓ(f)1Q,能有效提高最大连接数。我记得以前看过一文章,讲的是调?左右比较合适?/p>



becket_zheng 2010-01-20 01:27 发表评论
]]>
վ֩ģ壺 | | | | ƽң| | | | | ȷ| ̨| | | ͸| | ͤ| | | | ͤ| ʩ| | Ͽ| | | | | | | | Ͼ| | | | | | | | ȳ| ˷| ˮ|