旧金山举行的 QCon 会议带给我们很多新鲜的信息。虽然没机会参加,但是看看各个网站”晒架构”也是个比较过瘾的事情。请参观并收藏这个页面:Architectures you’ve always wondered about

eBay 的架构和去年相比基本是换汤不换药,倒是 Yahoo! 的 Ian Flint(这位老兄是 Bix 的运营总监. Bix 已被雅虎收购) 这个 PPT Yahoo! Communities Architecture: Unlikely Bedfellows 挺有意思,披露了一些鲜为人知的信息。

Yahoo! 社区包括我们比较熟悉的 del.icio.usFlickr、Yahoo!群组、Yahoo! Mail、Bix等。相当于 Yahoo!把这些属性相近的应用放到一起运营。这个思路倒是和盛大对游戏的运营有些相近。

架构特点

有两点值得注意:1)层次化 2)模块化。这也是大规模作业下的比较经济的途径。

软件架构

首先是操作系统已经从 FreeBSD 逐渐迁移到 RHEL。这怕是雅虎不得已作出来的决定吧。FreeBSD 的开发力量的确不如 Linux,这也是不争的事实。数据库上 MySQL 与 Oracle 都有。Yahoo! 在 DW/BI 用的是 Oracle,构建了一个超大数据库。诸如 yapache、yts(反向代理服务器)、yfor(提供快速失败接管)、 ymon(监控),还有还有ysquid、ypan(cpan的 Yahoo! 克隆) 这些组件都是通过 yinst 来统计部署。关于 Yapache,请参考我以前写的 Yapache-Yahoo! Apache 的秘密

这是 Bix 与 DB 有关的部署架构:
Yahoo_soft_arch.png

数据放在 Netapp NAS 上(所以有的时候应用之慢也可以理解了),通过快照复制到其他数据中心。

Yahoo! Mail 架构:

Yahoo_Mail_arch.png

这里面居然部署了 Oracle RAC,用来存储 Mail 服务相关的 Meta 数据。非常有趣。

运营维护

监控工具主要用的是 Nagios,用以监控集群。使用标准插件,另 外也有自行定制的插件。Nagios 这东西太棒了。主动、被动检查的消息转发是通过 Ymon 来做到。网管上针对 SNMP 的解决方案是用 Yahoo!自己 Y 字头的 Ywatch。这些 Y 字头的东西基本上外面都是找不到的。Yahoo!的技术其实并不那么开放。Google 在运营这方面也好不到什么地方去。趋势图用 Drraw 展现。Drraw 是基于 RRDtool 的 Web 展现工具。

Yahoo_ops.png

应用服务器的监控是被动的。整个监控系统模块化部署。Nagios 的警告信息转发到 Ywatch 中心控制台。

08月 27th, 2008网站压力测试工具集

工具 相关网址
LoadRunner http://www.mercuryinteractive.com/products/loadrunner/
SilkPerformer http://www.segue.com/products/load-s … nce-testing/index.asp
QALoad http://www.compuware.com/products/qacenter/qaload.htm
WebLoad
OpenSTA 开源
Jmeter 开源

自动测试工具集

工具 相关网址
WinRunner http://www.mercuryinteractive.com/products/winrunner/
SilkTest http://www.segue.com/products/functio … l-testing/silktest.asp
QARun http://www.compuware.com/products/qacenter/qarun.htm
SAFS http://safsdev.sourceforge.net/Default.htm

Bug追踪系统
工具 相关网址
JIRA http://www.atlassian.com/software/jira/
Bugzilla http://www.bugzilla.org
TestDirector http://www.mercuryinteractive.com/products/testdirector/
GNATS http://www.gnu.org/software/gnats/
TestTrackPro http://www.seapine.com/ttpro.html

软件测试网站
http://www.51cmm.com
http://www.sqe.com
http://www.qadirect.com
http://www.bonoy.com
http://www.sztest.net
http://www.testage.net
http://www.sqatester.com
http://www.testingfaqs.org

软件测试工具集锦见正文

类型 名称 公司 网址
测试设计工具
ALLPAIRS http://satisfice.com/
Caliber-RBT http://www.tbi.com
Caliber-RM http://www.tbi.com
DARTT http://home.t-online.de/home/bsse.info/
Datatect http://www.datatect.com
DGL http://www.csee.usf.edu/~maurer/
McCabe Test http://www.mccabe.com
McCabe TestCompress http://www.mccabe.com
Multi http://www.testing.com/
Panorama C/C++ http://www.softwareautomation.com
Reactis Tester http://www.reactive-systems.com
TDGEN http://www.soft.com/Products/index.html
T-VEC Test Generation System http://www.t-vec.com
GUI测试驱动器 Android http://www.smith-house.org/open.html
Atesto Functional Testing Service “http://www.atesto.com/

AutoTester for Windows http://www.autotester.com
AutoTester for OS/2 http://www.autotester.com
CAPBAK http://www.soft.com/Products/index.html
Certify http://www.worksoft.com/
CitraTest http://www.tevron.com
e-Monitor http://www.empirix.com/
e-Tester http://www.empirix.com/
eValid http://www.e-valid.com/
imbus GUI Test Case Library http://www.imbus.de
QARunTM http://www.compuware.com/qacenter
Panorama-2 “http://www.softwareautomation.com

QC/Replay http://www.centerline.com
QES/EZ for GUI http://www.qestest.com
Monitor Master http://www.argogroup.com
SilkTest http://www.segue.com
Smalltalk Test Mentor http://www.silvermark.com
Test Now http://www.stlabs.com/
TestQuest Pro Test Automation System http://www.testquest.com
TestRunner http://www.qronus.com/
WinRunner Mercury Interactive http://www.merc-int.com
xrc - X Remote Control http://www.absol.com/
Xrunner http://www.merc-int.com
负荷和性能工具 ANTS - Advanced .NET Testing System http://www.red-gate.com/

Atesto Automated Load Test http://www.atesto.com/
AutoController http://www.autotester.com
AutoController with Virtual DirectTest http://www.autotester.com
Benchmark FactoryTM http://www.quest.com
Capacity Calibration http://www.capcal.com
Chariot? http://www.ganymedesoftware.com
CYRANO ServerPack http://www.cyrano.com
e-Load http://www.empirix.com/
FORECAST http://www.facilita.co.uk
ITF - Internetworking Test Facility http://www.acomtech.com
Load http://www.pushtotest.com
Load Runner Product Family http://www.merc-int.com
Microsoft Web Application Stress Tool (WAS) http://webtool.rte.microsoft.c
om/
NetPressure http://www.syntheticnets.com
PegasusTM http://www.ganymedesoftware.com
Portent http://www.loadtesting.com
preVue-ASCII http://www.rational.com/products/prevue/
preVue-X http://www.rational.com/products/prevue/
“PureLoad
http://www.minq.se
QALoadTM http://www.compuware.com
Rational Suite PerformanceStudio http://www.rational.com/products/pstudio/

“Rational SiteLoad
http://www.rational.com/products/siteload/
RemoteCog Product Family http://www.fiveninesolutions.com
Scapa StressTest for Citrix MetaFrame http://www.scapatech.com
SilkPerformer http://www.segue.com/
Teleprocessing Network Simulator http://www.networking.ibm.com/tns/tnsprod
.htm
WebLoad 3.0 http://www.radview.com
Web Roller http://webapplicationstesting.com
Webserver Stress Tool http://www.paessler.com
WebSpray http://www.redhillnetworks.com
非GUI测试驱动器 “AdaTEST
http://www.qcsltd.com
ANVL http://www.midnight.com/
AutoAdviser http://www.autotester.com
AutoTester Client/Server for use with SAP R/3 http://www.autotester.com
Cantata http://www.qcsltd.com
“CONVEX Integrated Test Environment (CITE)
http://www.cirr.com/
CTA++ http://www.testwell.fi
CTB http://www.testwell.fi
ITF - Internetworking Test Facility http://www.acomtech.com/
OTF - An Object Testing Framework “http://www.mcgsoft.com/

QADirector? http://www.compuware.com/qacenter
“QCIT
http://www.qistest.com
QES/Architect http://www.qestest.com
QES/EZ http://www.qestest.com
QMTest http://www.codesourcery.com/
SilkPilot http://www.segue.com
SMARTS http://www.soft.com/Products/index.html
SDTF - SNA Development Test Facility http://www.acomtech.com
TALC2000 http://www.talc2000.com
TBGEN http://www.testwell.fi
TEO http://www.gako.fr
Test Manager http://www.launchsoftware.com
Test Mentor - Java Edition http://www.javatesting.com
Test Library Manager http://www.autotester.com
“Test Station
http://www.autotester.com
TestWorks http://www.soft.com/Products/index.html
VectorCAST http://www.vectors.com
VersaTest http://www.softsell.com
测试实现工具 Access for DB2 http://www.princetonsoftech.com/
Aprobe http://www.ocsystems.com
Aqtest http://www.automatedqa.com/
BoundsChecker compuware http://www.numega.com/
C++Test http://www.parasoft.com
DateWise FileCompare http://www.datewise.com/mt
dmalloc http://www.dmalloc.com/
EXDIFF http://www.soft.com/Products/index.html
“fakesmtpd
http://www.jera.com/
“FREstimate
http://www.softrel.com/
HeapAgent http://www.microquill.com
InCtrl5 http://www.zdnet.com/downloads/stories/info/0,77424,.html
JSUnit http://www.edwardh.com/jsunit/
Junit http://www.junit.org/
MDBDiff http://jupiter.drw.net/matpie/PBS … ts/retired/MDBDiff.h
tml
Move for DB2 http://www.princetonsoftech.com/
mpatrol http://www.cbmamiga.demon.co.uk/mpatrol/
“ObjectTester
http://www.obsoft.com
Inuse http://www.parasoft.com
Rational Purify http://www.rational.com/products/purify_unix/index.jtmpl

Rational Test RealTime http://www.rational.com
SilkRealizer http://www.segue.com
WhenToStop http://www.softrel.com/
ZeroFault http://www.tkg.com
测试评估工具 AdaTEST95 http://www.qcsltd.com
Aonix Validator/Req http://www.aonix.com/
C-Cover http://www.bullseye.com
Cantata++ http://www.qcsltd.com
CodeTEST http://www.amc.com
CTC++ http://www.testwell.fi
Glass JAR Toolkit http://glassjartoolkit.com/gjtk.html
“Hindsight/TCA
http://www.integrisoft.com
Hindsight/TPA http://www.integrisoft.com
“Insure++
http://www.parasoft.com
“Java Test Coverage
http://www.semdesigns.com/Products/TestCoverage/index.html
LDRA Testbed http://www.ldra.com
“LOGISCOPE toolset
http://www.telelogic.com/
ObjectCoverage http://www.obsoft.com
Panorama C/C++ “http://www.softwareautomation.com

Rational PureCoverage http://www.rational.com/products/purecoverage/index.
jtmpl
“TCMON
http://www.testwell.fi
TCA “http://www.parasoft.com

TCAT C/C++ http://www.soft.com/Products/index.html
TCAT for Java http://www.soft.com/Products/index.html
TCAT-PATH http://www.soft.com/Products/index.html
T-SCOPE http://www.soft.com/Products/index.html
TestWorks/Coverage http://www.soft.com/Products/index.html
静态分析工具 AccVerify SE for FrontPage http://www.hisoftware.com/msacc/
Aivosto Project Analyzer http://www.aivosto.com/vb.html
ASSENT http://www.tcs.com
ccount “http://www.cs.umd.edu/users/cml/resources/cmetrics/

“Cleanscape lint-Plus
http://www.cleanscape.net/stdprod/lplus/index.html
ClearMaker http://www.balthazar.hu
“CMT++
http://www.testwell.fi
CodeCompanion http://www.jenssoft.com
CodeSurfer http://www.grammatech.com
“Dependency Walker
http://www.dependencywalker.com/
floppy/fflow http://netlib2.cs.utk.edu/floppy/
ftnchek http://www.dsm.fordham.edu/~ftnchek
Hindsight/SQA http://www.integrisoft.com
Krakatau http://www.powersoftware.com/
McCabe QA http://www.mccabe.com
METRIC http://www.soft.com/Products/index.html
ObjectDetail http://www.obsoft.com
CodeWizard http://www.parasoft.com
Jtest http://www.parasoft.com
PC-lint/FlexeLint http://www.gimpel.com/
PC-Metric http://www.molalla.net/~setlabs
PolySpace Verifier http://www.polyspace.com
Plum Hall SQS http://www.plumhall.com
QA C http://www.prqa.co.uk
QA C++ http://www.prqa.co.uk
“QA Fortran
http://www.prqa.co.uk
“QStudio Java
http://www.qa-systems.com
Safer C Toolset http://www.oakcomp.co.uk/SoftwareProducts.html
SofAudit http://www.soring.hu/index.html
STATIC http://www.soft.com/Products/index.html
TestBed http://www.easternsystems.com
TestWorks/Advisor http://www.soft.com/Products/index.html
缺陷跟踪工具 1CR http://www.plus-one.com/+1CR_fact_sheet.html
Aardvark http://www.red-gate.com/
AdminiTrack http://www.adminitrack.com
Alcea Fast BugTrack http://www.alceatech.com/
AllChange 2000 http://www.intasoft.co.uk/intasoft/
BugAware http://www.bugaware.com
“Bugbase 2000
http://www.threerock.com
“Bugcentral.com
http://www.bugcentral.com/
BugCollector Pro http://www.nesbitt.com/
Bug/Defect Tracking Expert http://www.bug-defect-tracking-expert.com/
“Buggit
http://www.pb-sys.com/
Buggy http://www.novosys.de/Buggy/Buggy.html
“Bugzero
http://www.websina.com/bugzero/
Bugzilla http://www.mozilla.org/projects/bugzilla/
“Census
http://www.metaquest.com/
“ClearQuest
http://www.rational.com/products/clearquest/
CustomerFirst http://www.custfirst.com/products.html
Debian Bug Tracking System http://www.chiark.greenend.org.uk/~ian/debbugs/

Defect Tracker (New Fire) http://www.newfire.com/
Defect Tracker (Pragmatic) http://www.Pragmaticsw.com/Pragmatic/DefectTrac
ker.asp
Defect Tracking System (DTS) http://www.open.com.au/dts/
“defectX
http://www.defectx.com/
DevTrack http://www.techexcel.com/
“d-Tracker
http://www.empirix.com/
elementool http://elementool.com/
“ExtraView
http://www.extraview.com/extraview_home.html
FogBUGZ http://www.fogcreek.com/FogBUGZ/
JitterBug http://samba.anu.edu.au/cgi-bin/jitterbug
Keystone Problem Tracking System http://www.stonekeep.com/
NeumaPT http://www.neuma.com/
SWBTracker http://www.softwarewithbrains.com/swbtrack.htm
“Squish
http://www.squishlist.com
T-Plan Incident Manager http://www.t-plan.co.uk
TeamTrack http://www.teamshare.com
TeamTrack Workgroup http://www.teamshare.com
Team Tracker http://www.hstech.com.au/TeamTracker/
TestTrack http://www.seapine.com
“TrackWeb Defects
http://www.soffront.com/
Trackgear http://www.logigear.com/
TrackRecord http://www.numega.com/devcenter/tr.shtml
“Trackwise
http://www.sparta-systems.com/

MYSQL系统优化与系统设置参数的一次调查
对mysql进行优化意味着适当地分配内存,并让mysqld了解将会承担何种类型的负载。减少磁盘访问的次数。
类似地,确保 MySQL 进程正确操作就意味着它花费在服务查询上的时间要多于花费在处理后台任务(如处理临时磁盘表或打开和关闭文件)上的时间。
记录慢速查询
在一个 SQL 服务器中,数据表都是保存在磁盘上的。索引为服务器提供了一种在表中查找特定数据行的方法,而不用搜索整个表。当必须要搜索整个表时,就称为表扫描。通常 来说,您可能只希望获得表中数据的一个子集,因此全表扫描会浪费大量的磁盘 I/O,因此也就会浪费大量时间。当必须对数据进行连接时,这个问题就更加复杂了,因为必须要对连接两端的多行数据进行比较。
当然,表扫描并不总是会带来问题;有时读取整个表反而会比从中挑选出一部分数据更加有效(服务器进程中查询规划器用来作出这些决定)。如果索引的使用效率 很低,或者根本就不能使用索引,则会减慢查询速度,而且随着服务器上的负载和表大小的增加,这个问题会变得更加显著。执行时间超过给定时间范围的查询就称 为慢速查询。
您可以配置 mysqld 将这些慢速查询记录到适当命名的慢速查询日志中。管理员然后会查看这个日志来帮助他们确定应用程序中有哪些部分需要进一步调查。清单 1 给出了要启用慢速查询日志需要在 my.cnf 中所做的配置。
启用 MySQL 慢速查询日志
[mysqld]
; enable the slow query log, default 10 seconds
log-slow-queries
; log queries taking longer than 5 seconds
long_query_time = 5
; log queries that don’t use indexes even if they take less than long_query_time
; MySQL 4.1 and newer only
log-queries-not-using-indexes
这三个设置一起使用,可以记录执行时间超过 5 秒和没有使用索引的查询。请注意有关 log-queries-not-using-indexes 的警告:您必须使用 MySQL 4.1 或更高版本。慢速查询日志都保存在 MySQL 数据目录中,名为 hostname-slow.log。如果希望使用一个不同的名字或路径,可以在 my.cnf 中使用 log-slow-queries = /new/path/to/file 实现此目的。
阅读慢速查询日志最好是通过 mysqldumpslow 命令进行。指定日志文件的路径,就可以看到一个慢速查询的排序后的列表,并且还显示了它们在日志文件中出现的次数。一个非常有用的特性是 mysqldumpslow 在比较结果之前,会删除任何用户指定的数据,因此对同一个查询的不同调用被计为一次;这可以帮助找出需要工作量最多的查询。
对查询进行缓存
一般程序严重依赖数据库,但有时却会反复执行相同的查询。每次执行查询时,数据库都必须要执行相同的工作。对查询进行分析,确定如何执行查询,从磁盘中加 载信息,然后将结果返回给客户机。MySQL 有一个特性称为查询缓存,它将查询结果保存在内存中。在很多情况下,这会极大地提高性能。
虚拟系统查询缓存为:
my.cnf中添加
[4a-o07-b4:root/1054]#cat /etc/my.cnf|grep query_cache
query_cache_size=32M
mysql> show variables like ‘%cache%’;
+——————————+————+
| Variable_name | Value |
+——————————+————+
| query_cache_size | 33554432 |
+——————————+————+
14 rows in set (0.00 sec)
监视查询缓存
在启用查询缓存之后,重要的是要理解它是否得到了有效的使用。MySQL 有几个可以查看的变量,可以用来了解缓存中的情况。
mysql> SHOW STATUS LIKE ‘qcache%’;
+————————-+————+
| Variable_name | Value |
+————————-+————+
| Qcache_free_blocks | 5216 |
| Qcache_free_memory | 14640664 |
| Qcache_hits | 2581646882 |
| Qcache_inserts | 360210964 |
| Qcache_lowmem_prunes | 281680433 |
| Qcache_not_cached | 79740667 |
| Qcache_queries_in_cache | 16927 |
| Qcache_total_blocks | 47042 |
+————————-+————+
8 rows in set (0.00 sec)
变量名

说明
Qcache_free_blocks

缓存中相邻内存块的个数。数目大说明可能有碎片。FLUSH QUERY CACHE 会对缓存中的碎片进行整理,从而得到一个空闲块。
Qcache_free_memory

缓存中的空闲内存。
Qcache_hits

每次查询在缓存中命中时就增大。
Qcache_inserts

每次插入一个查询时就增大。命中次数除以插入次数就是不中比率;用 1 减去这个值就是命中率。在上面这个例子中,大约有 87% 的查询都在缓存中命中
Qcache_lowmem_prunes

缓存出现内存不足并且必须要进行清理以便为更多查询提供空间的次数。这个数字最好长时间来看;如果这个数字在不断增长,就表示可能碎片非常严重,或者内存很少。(上面的 free_blocks 和 free_memory 可以告诉您属于哪种情况)。
Qcache_not_cached

不适合进行缓存的查询的数量,通常是由于这些查询不是 SELECT 语句。
Qcache_queries_in_cache

当前缓存的查询(和响应)的数量。
Qcache_total_blocks

缓存中块的数量。

通常,间隔几秒显示这些变量就可以看出区别,这可以帮助确定缓存是否正在有效地使用。运行 FLUSH STATUS 可以重置一些计数器,如果服务器已经运行了一段时间,这会非常有帮助。
使用非常大的查询缓存,期望可以缓存所有东西,这种想法非常诱人。由于 mysqld 必须要对缓存进行维护,例如当内存变得很低时执行剪除,因此服务器可能会在试图管理缓存时而陷入困境。作为一条规则,如果 FLUSH QUERY CACHE 占用了很长时间,那就说明缓存太大了。
强制限制
您可以在 mysqld 中强制一些限制来确保系统负载不会导致资源耗尽的情况出现。清单 3 给出了 my.cnf 中与资源有关的一些重要设置。
清单 3. MySQL 资源设置
set-variable=max_connections=500
set-variable=wait_timeout=10
max_connect_errors = 100
连接最大个数是在第一行中进行管理的。与 Apache 中的 MaxClients 类似,其想法是确保只建立服务允许数目的连接。要确定服务器上目前建立过的最大连接数,请执行 SHOW STATUS LIKE ‘max_used_connections’。
第 2 行告诉 mysqld 终止所有空闲时间超过 10 秒的连接。在 LAMP 应用程序中,连接数据库的时间通常就是 Web 服务器处理请求所花费的时间。有时候,如果负载过重,连接会挂起,并且会占用连接表空间。如果有多个交互用户或使用了到数据库的持久连接,那么将这个值设 低一点并不可取!
最后一行是一个安全的方法。如果一个主机在连接到服务器时有问题,并重试很多次后放弃,那么这个主机就会被锁定,直到 FLUSH HOSTS 之后才能运行。默认情况下,10 次失败就足以导致锁定了。将这个值修改为 100 会给服务器足够的时间来从问题中恢复。如果重试 100 次都无法建立连接,那么使用再高的值也不会有太多帮助,可能它根本就无法连接。
缓冲区和缓存
MySQL 支持超过 100 个的可调节设置;但是幸运的是,掌握少数几个就可以满足大部分需要。查找这些设置的正确值可以通过 SHOW STATUS 命令查看状态变量,从中可以确定 mysqld 的运作情况是否符合我们的预期。给缓冲区和缓存分配的内存不能超过系统中的现有内存,因此调优通常都需要进行一些妥协。
打开的表缓存
1.每个表都可以表示为磁盘上的一个文件,必须先打开,后读取。
为了加快从文件中读取数据的过程,mysqld 对这些打开文件进行了缓存,其最大数目由 /etc/mysqld.conf 中的 table_cache 指定
mysql> show variables like ‘table_cache%’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| table_cache | 512 |
+—————+——-+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE ‘open%tables’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| Open_tables | 301 |
| Opened_tables | 893 |
+—————+——-+
2 rows in set (0.00 sec)
看status说明目前有301给表是打开的,有893个表需要打开。
如果opened_tables随着重新运行show status命令快速增加,就说明缓存命中率不够。
如果open_tables比tabe_cache设置小很多,就说明该值太大了。
线程缓存
与表的缓存类似,对于线程来说也有一个缓存。 mysqld 在接收连接时会根据需要生成线程。在一个连接变化很快的繁忙服务器上,对线程进行缓存便于以后使用可以加快最初的连接。
mysql> show variables like ‘thread_cache%’;
+——————-+——-+
| Variable_name | Value |
+——————-+——-+
| thread_cache_size | 0 |
+——————-+——-+
1 row in set (0.00 sec)
mysql> \q
Bye
[4a-o07-b4:root/1003]#cat /etc/my.cnf|grep thread_cache
[4a-o07-b4:root/1004]#
mysql> SHOW STATUS LIKE ‘threads%’;
+——————-+——-+
| Variable_name | Value |
+——————-+——-+
| Threads_cached | 0 |
| Threads_connected | 39 |
| Threads_created | 31287 |
| Threads_running | 1 |
+——————-+——-+
4 rows in set (0.00 sec)
虚拟系统没有设置线程的缓存。
索引缓冲区
关键字缓冲区保存了 MyISAM 表的索引块。理想情况下,对于这些块的请求应该来自于内存,而不是来自于磁盘。
mysql> show variables like ‘key_buffer_size’;
+—————–+———–+
| Variable_name | Value |
+—————–+———–+
| key_buffer_size | 134217728 |
+—————–+———–+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE ‘key_read%’;
+——————-+————+
| Variable_name | Value |
+——————-+————+
| Key_read_requests | 1407915295 |
| Key_reads | 713099 |
+——————-+————+
2 rows in set (0.00 sec)
Key_reads 代表命中磁盘的请求个数, Key_read_requests 是总数。命中磁盘的读请求数除以读请求总数就是不中比率 —— 在本例中每 2,000 个请求,大约有 1 个没有命中内存。如果每 1,000 个请求中命中磁盘的数目超过 1 个,就应该考虑增大关键字缓冲区了。例如,key_buffer = 128M 会将缓冲区设置为 128MB。
确定临时表的使用
临时表可以在更高级的查询中使用,其中数据在进一步进行处理(例如 GROUP BY 字句)之前,都必须先保存到临时表中;理想情况下,在内存中创建临时表。但是如果临时表变得太大,就需要写入磁盘中。
每次使用临时表都会增大 Created_tmp_tables;基于磁盘的表也会增大 Created_tmp_disk_tables。对于这个比率,并没有什么严格的规则,因为这依赖于所涉及的查询。长时间观察 Created_tmp_disk_tables 会显示所创建的磁盘表的比率,您可以确定设置的效率。
mysql> show variables like ‘tmp_table_size’;
+—————-+———-+
| Variable_name | Value |
+—————-+———-+
| tmp_table_size | 33554432 |
+—————-+———-+
1 row in set (0.00 sec)
mysql> show variables like ‘max_heap_table_size’;
+———————+———-+
| Variable_name | Value |
+———————+———-+
| max_heap_table_size | 16777216 |
+———————+———-+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE ‘created_tmp%’;
+————————-+———-+
| Variable_name | Value |
+————————-+———-+
| Created_tmp_disk_tables | 92153 |
| Created_tmp_files | 48269 |
| Created_tmp_tables | 35837047 |
+————————-+———-+
每个会话的设置
注意这里针对的是每个会话的,它们在乘以可能存在的连接数的时候,这些选项表示大量的内存!
排序缓冲区(sort_buffer_size)
当 MySQL 必须要进行排序时,就会在从磁盘上读取数据时分配一个排序缓冲区来存放这些数据行。
如果要排序的数据太大,那么数据就必须保存到磁盘上的临时文件中,并再次进行排序。
mysql> show variables like ’sort_buffer_size’;
+——————+———+
| Variable_name | Value |
+——————+———+
| sort_buffer_size | 2097144 |
+——————+———+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE ’sort%’;
+——————-+———–+
| Variable_name | Value |
+——————-+———–+
| Sort_merge_passes | 31 |
| Sort_range | 99583552 |
| Sort_rows | 123728703 |
| Sort_scan | 64994 |
+——————-+———–+
4 rows in set (0.00 sec)
如果 sort_merge_passes 很大,就表示需要注意 sort_buffer_size。例如, sort_buffer_size = 2M 将排序缓冲区设置为 2MB。
读缓冲区(read_buffer_size)
理想情况下,索引提供了足够多的信息,可以只读入所需要的行。
但是有时候查询,需要读取表中大量数据。
要理解这种行为,需要知道运行了多少个 SELECT 语句Com_select ,以及需要读取表中的下一行数据的次数Handler_read_rnd_next。
mysql> SHOW STATUS LIKE “handler_read_rnd_next”;
+———————–+———–+
| Variable_name | Value |
+———————–+———–+
| Handler_read_rnd_next | 788605837 |
+———————–+———–+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE “com_select”;
+—————+———–+
| Variable_name | Value |
+—————+———–+
| Com_select | 185910100 |
+—————+———–+
1 row in set (0.00 sec)
mysql>
Handler_read_rnd_next/Com_select =1/5 。如果该值超过4000,就应该查看read_buffer_size,虚拟系统为131072。
read_buffer_size
每个线程连续扫描时为扫描的每个表分配的缓冲区的大小(字节)。如果进行多次连续扫描,可能需要增加该值,默认值为131072。

javascript 框架执行elements时间测试

http://mootools.net/slickspeed/#

一、关于邮件群发的经验和技巧

1、强力推荐使用免smtp服务器的群发软件。这种软件将您的电脑虚拟成发信服务器,邮件直接地送至对方的邮箱,可以清楚地知道发送成功的数量,还可以知道邮址不能发送成功的原因。如亿虎Email邮差和WorldCast等。

2、尽量不要使用多smtp服务器的群发软件。多smtp的服务器软件,由于先将邮件发送至smtp服务器进行中转,现在,一般的邮件服务器都做了 设置,如果smtp服务器检测到短时间内来自同一个IP地址的大量连接请求,就会中止转发邮件,从而产生大量退信现象。况且,现在免费的smtp服务器已 经很难找了。

3、建议将邮件地址打乱发送,效果最佳。您可以使用一些电子邮件地址列表筛选和管理软件,如Mail List Management和欧阳邮件列表管家可以轻松实现这一要求。

4、发送信件的时候,建议申请多个hotmail、yahoo等免费信箱作为发送信箱,轮流使用,而将自己常用的信箱作为回复信箱,这样可以避免常 用的信箱受到封锁,从而也可以避免因此产生的大量退信现象。如sohu.com的邮箱,经常使用同一个信箱发送信件的话,服务器会屏蔽您的邮址,从而不能 发送,碰到这种情况,就需要更换发送信箱了。

5、合理使用群发线程。群发线程越多,速度自然越快,但现在很多的服务器自动检测,如163.net、263.net的邮箱,如果线程数使用很多, 服务器马上显示太多的连接请求,拒绝再转发。具体多少线程数为好,用户可以根据自己的电脑进行测试,从而找到最佳的发送线程数,既要保证发送速度快,同时 也要保证最高的成功率,还要保证发送邮件的时候不死机。

6、群发软件的选择使用。由于每一款群发软件在设计时发送参数都略有不同,所以不是每一款群发软件都能发送邮件到任何一个邮箱。如:一款群发软件可 发送邮件至21cn.com、sohu.com、263.net等,但却不能够发送邮件至sina.com、etang.com。而另一款群发软件却可发 送邮件至sina.com、263.net、etang.com、sohu.com等,但它不能发送邮件至21cn.com。这种情况在免SMTP群发软 件中尤为突出。因此,要尽可能全面的群发邮件到不同的邮箱,建议用户使用不同的群发软件,一种软件不能发送成功的邮址,可以导入到另一种群发软件,试试 看。

7、由于网络速度和服务器设置等多方面的原因,发送的时候可能经常会出现服务器连接失败的提示,您可以将这些邮址重新发送一次,很多又可以成功的。

二、关于邮件地址收集的经验和技巧

1、搜集网站邮址软件。通过扫描网页及相关链接方式,不断搜索网页上公布的Email地址。重点推荐亿虎Email扫描大师、Fast Email Spider和商舟邮箱搜集大师。这些软件对收集行业邮件地址比较有用。建议您先收集一些行业网站的网址,然后利用这些软件搜索这些网站,可以得到大量活 跃程度比较高的邮址。

2、搜索服务器邮址软件。利用字典文件直接从邮件服务器收集邮址,重点推荐邮件地址探索者和伊妹捕神,本站已经整理了一份比较全面的中国邮件服务器和国际邮件服务器的清单以及字典文件,如果您觉得本站提供的邮址不够,可以利用这种搜索软件自行搜索服务器邮址。

3、搜索硬盘、光盘邮址软件。快速搜索电脑硬盘、光盘、软盘中的文本文件、网页文件及*.eml格式文件中的电子邮件地址,重点推荐:小不点 Email地址提取大师和科蓝邮件地址搜寻工具。基于这种软件的用途,您还可以利用teleport等网站下载软件将那些供求信息BBS信息,“拉回”到 自己的电脑,然后用这种软件进行搜索邮址,可以得到大量的有效Email地址。

三、关于邮件地址和管理和验证

1、邮址管理软件。电子邮件地址列表筛选和管理软件,可以帮助客户管理好自己的电子邮件列表,避免发送大量重复垃圾邮件, 重点推荐:Mail List Management(MLM)和欧阳邮件列表管家。MLM软件是我们使用过的邮址管理软件中功能最强,速度最快的软件,100万的邮址几分钟就可以完成 过滤重复邮址、重新排序等。欧阳邮件列表管家则可以快速将一个很大的邮址文件分割成较小的文件,以方便群发。

2、邮址验证软件。采用模拟向被校验邮箱发信,而实际上又并没有发出的方式来对检查邮件地址的存在与否,重点推荐: Advanced Email Verifier和Advanced Maillist Verify。我们在实际使用中发现,很多验证有效的邮址,在群发的时候就是不能发送成功,这是由于邮件服务器设置的原因,所以,如果您需要建立一个自己 的高效率的邮址列表,可以直接使用免smtp服务器的软件导入邮址群发,将那些发送成功的邮址保存下来以便今后使用。

四、关于信息发布软件

由于现在对邮件发送的越来越多的限制,群发邮件很容易产生“垃圾邮件”,很多的人采用供求信息BBS进行推广。这样的软件现在也很多,比较有名的如 商务快车、环球商务信息发布系统、营销之星和网际营销等等。这些软件可以将您的信息发布至国内外上千个BBS站点或者新闻组。但这些软件相对比较贵。

07月 22nd, 2008Flickr照片搜索器

好久在工作需要写了一个利用flickr api 写一个照片搜索器,网址:http://bbs.577love.com/pear/test.php

`configure’ configures this package to adapt to many kinds of systems.
`configure’ 配置这个包来适合多数系统.
Usage: ./configure [OPTION]… [VAR=VALUE]…
语法: ./configure [选项]… [变量=值]…
To assign environment variables (e.g., CC, CFLAGS…), specify them as VAR=VALUE.  See below for descriptions of some of the useful variables.
配置环境变量(例如,CC,CFLAGS),格式为VAR=VALUE. 看下面对这些可用变量的说明.
Defaults for the options are specified in brackets.
选项的默认值括在方括号之中.
Configuration:
配置:
  -h, –help              display this help and exit 显示这个帮助并退出
      –help=short        display options specific to this package 显示这个包的详细选项
      –help=recursive    display the short help of all the included packages 显示所有包括的包的帮助信息
  -V, –version           display version information and exit 显示版本信息并退出
  -q, –quiet, –silent   do not print `checking…’ messages 不打印’检查’信息
      –cache-file=FILE   cache test results in FILE [disabled] 存储测试信息到文件中 [disabled]
  -C, –config-cache      alias for `–cache-file=config.cache’ `–cache-file=config.cache’的别名
  -n, –no-create         do not create output files 不生成输出文件
      –srcdir=DIR        find the sources in DIR [configure dir or `..'] 在DIR查找代码

Installation directories:
安装目录:
  –prefix=PREFIX         install architecture-independent files in PREFIX 安装路径
     [/usr/local/apache2]
  –exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX 执行文件安装路径
     [PREFIX]

By default, `make install’ will install all the files in `/usr/local/apache2/bin’, `/usr/local/apache2/lib’ etc.  You can specify an installation prefix other than `/usr/local/apache2′ using `–prefix’,for instance `–prefix=$HOME’.
默认情况下,’make install’安装所有的文件在 `/usr/local/apache2/bin’, `/usr/local/apache2/lib’ 等等.你可以指定一个安装前缀 ‘–prefix’选项来改变安装位置,例如 `–prefix=$HOME’.

For better control, use the options below.
更详细的配置,使用下面的选项.
Fine tuning of the installation directories:
调整安装目录的选项:
  –bindir=DIR           user executables [EPREFIX/bin]
  –sbindir=DIR          system admin executables [EPREFIX/sbin]
  –libexecdir=DIR       program executables [EPREFIX/libexec]
  –sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  –sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  –localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  –libdir=DIR           object code libraries [EPREFIX/lib]
  –includedir=DIR       C header files [PREFIX/include]
  –oldincludedir=DIR    C header files for non-gcc [/usr/include]
  –datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
  –datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
  –infodir=DIR          info documentation [DATAROOTDIR/info]
  –localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
  –mandir=DIR           man documentation [DATAROOTDIR/man]
  –docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
  –htmldir=DIR          html documentation [DOCDIR]
  –dvidir=DIR           dvi documentation [DOCDIR]
  –pdfdir=DIR           pdf documentation [DOCDIR]
  –psdir=DIR            ps documentation [DOCDIR]

System types:
系统类型:
  –build=BUILD     configure for building on BUILD [guessed]
  –host=HOST       cross-compile to build programs to run on HOST [BUILD]
  –target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features:
可选的功能:
  –disable-FEATURE       do not include FEATURE (same as –enable-FEATURE=no)
  –enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  –enable-layout=LAYOUT
  –enable-v4-mapped      Allow IPv6 sockets to handle IPv4 connections
  –enable-exception-hook Enable fatal exception hook
  –enable-maintainer-mode
                          Turn on debugging and compile time warnings
  –enable-pie            Build httpd as a Position Independent Executable
  –enable-modules=MODULE-LIST
                          Space-separated list of modules to enable | “all” |
                          “most”
  –enable-mods-shared=MODULE-LIST
                          Space-separated list of shared modules to enable |
                          “all” | “most”
  –disable-authn-file    file-based authentication control
  –enable-authn-dbm      DBM-based authentication control
  –enable-authn-anon     anonymous user authentication control
  –enable-authn-dbd      SQL-based authentication control
  –disable-authn-default authentication backstopper
  –enable-authn-alias    auth provider alias
  –disable-authz-host    host-based authorization control
  –disable-authz-groupfile
                          ‘require group’ authorization control
  –disable-authz-user    ‘require user’ authorization control
  –enable-authz-dbm      DBM-based authorization control
  –enable-authz-owner    ‘require file-owner’ authorization control
  –enable-authnz-ldap    LDAP based authentication
  –disable-authz-default authorization control backstopper
  –disable-auth-basic    basic authentication
  –enable-auth-digest    RFC2617 Digest authentication
  –enable-isapi          isapi extension support
  –enable-file-cache     File cache
  –enable-cache          dynamic file caching
  –enable-disk-cache     disk caching module
  –enable-mem-cache      memory caching module
  –enable-dbd            Apache DBD Framework
  –enable-bucketeer      buckets manipulation filter
  –enable-dumpio         I/O dump filter
  –enable-echo           ECHO server
  –enable-example        example and demo module
  –enable-case-filter    example uppercase conversion filter
  –enable-case-filter-in example uppercase conversion input filter
  –enable-ext-filter     external filter module
  –disable-include       Server Side Includes
  –disable-filter        Smart Filtering
  –disable-charset-lite  character set translation
  –enable-charset-lite   character set translation
  –enable-deflate        Deflate transfer encoding support
  –enable-ldap           LDAP caching and connection pooling services
  –disable-log-config    logging configuration
  –enable-log-forensic   forensic logging
  –enable-logio          input and output logging
  –disable-env           clearing/setting of ENV vars
  –enable-mime-magic     automagically determining MIME type
  –enable-cern-meta      CERN-type meta files
  –enable-expires        Expires header control
  –enable-headers        HTTP header control
  –enable-ident          RFC 1413 identity check
  –enable-usertrack      user-session tracking
  –enable-unique-id      per-request unique ids
  –disable-setenvif      basing ENV vars on headers
  –enable-version        determining httpd version in config files
  –enable-proxy          Apache proxy module
  –enable-proxy-connect  Apache proxy CONNECT module
  –enable-proxy-ftp      Apache proxy FTP module
  –enable-proxy-http     Apache proxy HTTP module
  –enable-proxy-ajp      Apache proxy AJP module
  –enable-proxy-balancer Apache proxy BALANCER module
  –enable-ssl            SSL/TLS support (mod_ssl)
  –enable-distcache      Select distcache support in mod_ssl
  –enable-optional-hook-export
                          example optional hook exporter
  –enable-optional-hook-import
                          example optional hook importer
  –enable-optional-fn-import
                          example optional function importer
  –enable-optional-fn-export
                          example optional function exporter
  –enable-static-support Build a statically linked version of the support
                          binaries
  –enable-static-htpasswd
                          Build a statically linked version of htpasswd
  –enable-static-htdigest
                          Build a statically linked version of htdigest
  –enable-static-rotatelogs
                          Build a statically linked version of rotatelogs
  –enable-static-logresolve
                          Build a statically linked version of logresolve
  –enable-static-htdbm   Build a statically linked version of htdbm
  –enable-static-ab      Build a statically linked version of ab
  –enable-static-checkgid
                          Build a statically linked version of checkgid
  –enable-static-htcacheclean
                          Build a statically linked version of htcacheclean
  –enable-static-httxt2dbm
                          Build a statically linked version of httxt2dbm
  –enable-http           HTTP protocol handling
  –disable-mime          mapping of file-extension to MIME
  –enable-dav            WebDAV protocol handling
  –disable-status        process/thread monitoring
  –disable-autoindex     directory listing
  –disable-asis          as-is filetypes
  –enable-info           server information
  –enable-suexec         set uid and gid for spawned processes
  –disable-cgid          CGI scripts
  –enable-cgi            CGI scripts
  –disable-cgi           CGI scripts
  –enable-cgid           CGI scripts
  –enable-dav-fs         DAV provider for the filesystem
  –enable-dav-lock       DAV provider for generic locking
  –enable-vhost-alias    mass virtual hosting module
  –disable-negotiation   content negotiation
  –disable-dir           directory request handling
  –enable-imagemap       server-side imagemaps
  –disable-actions       Action triggering on requests
  –enable-speling        correct common URL misspellings
  –disable-userdir       mapping of requests to user-specific directories
  –disable-alias         mapping of requests to different filesystem parts
  –enable-rewrite        rule based URL manipulation
  –enable-so             DSO capability

Optional Packages:
可选包:
  –with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  –without-PACKAGE       do not use PACKAGE (same as –with-PACKAGE=no)
  –with-included-apr     Use bundled copies of APR/APR-Util
  –with-apr=PATH         prefix for installed APR, path to APR build tree,
                          or the full path to apr-config
  –with-apr-util=PATH    prefix for installed APU, path to APU build tree,
                          or the full path to apu-config
  –with-pcre=PATH        Use external PCRE library
  –with-port=PORT        Port on which to listen (default is 80)
  –with-z=DIR            use a specific zlib library
  –with-sslc=DIR         RSA SSL-C SSL/TLS toolkit
  –with-ssl=DIR          OpenSSL SSL/TLS toolkit
  –with-mpm=MPM          Choose the process model for Apache to use.
                          MPM={beos|event|worker|prefork|mpmt_os2}
  –with-module=module-type:module-file
                          Enable module-file in the modules/<module-type>
                          directory.
  –with-program-name     alternate executable name
  –with-suexec-bin       Path to suexec binary
  –with-suexec-caller    User allowed to call SuExec
  –with-suexec-userdir   User subdirectory
  –with-suexec-docroot   SuExec root directory
  –with-suexec-uidmin    Minimal allowed UID
  –with-suexec-gidmin    Minimal allowed GID
  –with-suexec-logfile   Set the logfile
  –with-suexec-safepath  Set the safepath
  –with-suexec-umask     umask for suexec’d process

Some influential environment variables:
一些有影响的环境变量:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor

————–安装配置开始—————-
安装说明:

首先访问 http://www.yupoo.com 申请一个站长自己的api key
申请过程见图( yupoo申请api_step_x.jpg )
1.解压插件到hack文件夹下面,使目录保持 hack\pw_yupoo\

2. 编辑 hack\pw_yupoo\config.php
根据申请api最后一步获得的api key 和 secretKey 配置config.php文件

$apiKey=”b40a95b25e0451b8aa0120f5xxxxx”;
$secretKey=”gv8lthgvpjexxxx”;

3.修改( \js\wind_c_editor.js )[注意:下面有两个参数因虚拟主机服务器目录修改IMGDIR和HackDIR]

将如下代码复制这个文件最末尾(横线之间的代码):
———————————————-
function $(id) {
return document.getElementById(id);
}

function _attachEvent(obj, evt, func) {
if(obj.addEventListener) {
obj.addEventListener(evt, func, false);
} else if(obj.attachEvent) {
obj.attachEvent(”on” + evt, func);
}
}

function doane(event) {
e = event ? event : window.event;
if(is_ie) {
e.returnValue = false;
e.cancelBubble = true;
} else if(e) {
e.stopPropagation();
e.preventDefault();
}
}

var hiddenobj = new Array();
var pmwinposition = new Array();
function pmwin(action, param) {
var IMGDIR = “images”;
var HackDIR = “hack/pw_yupoo”;
var objs = document.getElementsByTagName(”OBJECT”);
if(action == ‘open’) {
for(i = 0;i < objs.length; i ++) {
if(objs[i].style.visibility != ‘hidden’) {
objs[i].setAttribute(”oldvisibility”, objs[i].style.visibility);
objs[i].style.visibility = ‘hidden’;
}
}
var clientWidth = document.body.clientWidth;
var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
var pmwidth = 800;
//var pmheight = clientHeight * 0.765;
var pmheight = 482;
if(!$(’pmlayer’)) {
div = document.createElement(’div’);div.id = ‘pmlayer’;
div.style.width = pmwidth + ‘px’;
div.style.height = pmheight + ‘px’;
div.style.left = ((clientWidth - pmwidth) / 2) + ‘px’;
div.style.position = ‘absolute’;
div.style.zIndex = ‘9999′;
$(’append_parent’).appendChild(div);
$(’pmlayer’).innerHTML = ‘<div style=”width: 800px; background: #666666; margin: 5px auto; text-align: left;”>’ +
‘<div style=”width: 800px; height: ‘ + pmheight + ‘px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px”>’ +
‘<div onmouseover=”pmwindrag(this)” style=”cursor: move; position: relative; left: 0px; top: 0px; width: 800px; height: 30px; margin-bottom: -30px;”></div>’ +
‘<a href=”javascript:void(0);” onclick=”pmwin(\’close\’)”><img style=”position: absolute; right: 20px; top: 15px” src=”‘ + IMGDIR +’/close.gif” title=”关闭” /></a>’ +
‘<div id=”pmwinmask” style=”margin-top: 30px; position: absolute; width: 100%; height: 100%; display: none”></div><iframe id=”pmframe” name=”pmframe” style=”width:’ + pmwidth + ‘px;height:100%” allowTransparency=”true” frameborder=”0″></iframe></div></div>’;
}
$(’pmlayer’).style.display = ”;
$(’pmlayer’).style.top = ((clientHeight - pmheight) / 2 + scrollTop) + ‘px’;
if(!param) {
pmframe.location = HackDIR + ‘/insert_img.php’;
} else {
pmframe.location = HackDIR + ‘/insert_img.php?’ + param;
}
} else if(action == ‘close’) {
for(i = 0;i < objs.length; i ++) {
if(objs[i].attributes['oldvisibility']) {
objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
objs[i].removeAttribute(’oldvisibility’);
}
}
hiddenobj = new Array();
$(’pmlayer’).style.display = ‘none’;
}
}

var pmwindragstart = new Array();
function pmwindrag(obj) {
obj.onmousedown = function(e) {
if(is_ie) {
document.body.onselectstart = function() {
return false;
}
}
pmwindragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
pmwindragstart[2] = parseInt($(’pmlayer’).style.left);
pmwindragstart[3] = parseInt($(’pmlayer’).style.top);
$(’pmwinmask’).style.display = ”;
doane(e);
}
_attachEvent(document.body, ‘mousemove’, function(e) {
if(pmwindragstart[0]) {
var pmwindragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
with($(’pmlayer’)) {
style.left = (pmwindragstart[2] + pmwindragnow[0] - pmwindragstart[0]) + ‘px’;
style.top = (pmwindragstart[3] + pmwindragnow[1] - pmwindragstart[1]) + ‘px’;
}
doane(e);
}
});
obj.onmouseup = function(e) {
if(is_ie) {
document.body.onselectstart = function() {
return true;
}
}
pmwindragstart = [];
$(’pmwinmask’).style.display = ‘none’;
doane(e);
}
obj.onmouseover = null;
}
function insertOpenImage(txt) {
pmwin(’open’);
}

function insertTextImage(txt) {
editor.focusEditor();
if (txt!=null) {
if (editor._editMode == “textmode”) {
sm=txt;
AddText(sm,”);
} else {
try{editor._doc.execCommand(”insertimage”,false,txt);}
catch(e) {}
}
}
}

4.修改模板文件(template\wind\wysiwyg_editor.html)
将原来insertimage: [ true, insertImage, false ], 修改 为 insertimage: [ true, insertOpenImage, false ]

5.调用yupoo本地缓存设置(下面这个对对象$f是一个YUPOO PHP API接口):(此项为可选项,仅作速度优化用)

编辑(hack\pw_yupoo\insert_img.php)文件,找到下面的代码,两种缓存方式只能选一种。

//使用文件缓存方式,需设置文件cache路径,如果是linux系统,需将目录权限设置成777
$f->enableCache(
“fs”,
‘./cache/files’,//文件cache路径
“300″
);

//数据库的缓存方式,需指定用户名和数据库名(默认的cache表名为yupoo_cache)
$f->enableCache(
“db”,
“mysql://root:zhangsf@localhost/test”
);

6.上传临时文件设置(默认是到cache文件夹下面,可以自行修改)[对于上一步本地缓存采用文件系统的在linux系统中这个目录设置成可写,也就是写权限为777] 详细cache配置查看(hack\pw_yupoo\config.php) 文件

7.编辑(template\wind\heaer.htm)文件,找到<div id=”main”>在这个后面紧跟着加入两个div层
<div id=”append_parent”></div>
<div id=”ajaxwaitid”></div>

附件下载:pw_yupoo_uft8

————–安装配置开始—————-
安装说明:

首先访问 http://www.yupoo.com 申请一个站长自己的api key
申请过程见图( yupoo申请api_step_x.jpg )
1.解压插件到hack文件夹下面,使目录保持 hack\pw_yupoo\

2. 编辑 hack\pw_yupoo\config.php
根据申请api最后一步获得的api key 和 secretKey 配置config.php文件

$apiKey=”b40a95b25e0451b8aa0120f5xxxxx”;
$secretKey=”gv8lthgvpjexxxx”;

3.修改( \js\wind_c_editor.js )[注意:下面有两个参数因虚拟主机服务器目录修改IMGDIR和HackDIR]

将如下代码复制这个文件最末尾(横线之间的代码):
———————————————-
function $(id) {
return document.getElementById(id);
}

function _attachEvent(obj, evt, func) {
if(obj.addEventListener) {
obj.addEventListener(evt, func, false);
} else if(obj.attachEvent) {
obj.attachEvent(”on” + evt, func);
}
}

function doane(event) {
e = event ? event : window.event;
if(is_ie) {
e.returnValue = false;
e.cancelBubble = true;
} else if(e) {
e.stopPropagation();
e.preventDefault();
}
}

var hiddenobj = new Array();
var pmwinposition = new Array();
function pmwin(action, param) {
var IMGDIR = “images”;
var HackDIR = “hack/pw_yupoo”;
var objs = document.getElementsByTagName(”OBJECT”);
if(action == ‘open’) {
for(i = 0;i < objs.length; i ++) {
if(objs[i].style.visibility != ‘hidden’) {
objs[i].setAttribute(”oldvisibility”, objs[i].style.visibility);
objs[i].style.visibility = ‘hidden’;
}
}
var clientWidth = document.body.clientWidth;
var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
var pmwidth = 800;
//var pmheight = clientHeight * 0.765;
var pmheight = 482;
if(!$(’pmlayer’)) {
div = document.createElement(’div’);div.id = ‘pmlayer’;
div.style.width = pmwidth + ‘px’;
div.style.height = pmheight + ‘px’;
div.style.left = ((clientWidth - pmwidth) / 2) + ‘px’;
div.style.position = ‘absolute’;
div.style.zIndex = ‘9999′;
$(’append_parent’).appendChild(div);
$(’pmlayer’).innerHTML = ‘<div style=”width: 800px; background: #666666; margin: 5px auto; text-align: left;”>’ +
‘<div style=”width: 800px; height: ‘ + pmheight + ‘px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px”>’ +
‘<div onmouseover=”pmwindrag(this)” style=”cursor: move; position: relative; left: 0px; top: 0px; width: 800px; height: 30px; margin-bottom: -30px;”></div>’ +
‘<a href=”javascript:void(0);” onclick=”pmwin(\’close\’)”><img style=”position: absolute; right: 20px; top: 15px” src=”‘ + IMGDIR +’/close.gif” title=”关闭” /></a>’ +
‘<div id=”pmwinmask” style=”margin-top: 30px; position: absolute; width: 100%; height: 100%; display: none”></div><iframe id=”pmframe” name=”pmframe” style=”width:’ + pmwidth + ‘px;height:100%” allowTransparency=”true” frameborder=”0″></iframe></div></div>’;
}
$(’pmlayer’).style.display = ”;
$(’pmlayer’).style.top = ((clientHeight - pmheight) / 2 + scrollTop) + ‘px’;
if(!param) {
pmframe.location = HackDIR + ‘/insert_img.php’;
} else {
pmframe.location = HackDIR + ‘/insert_img.php?’ + param;
}
} else if(action == ‘close’) {
for(i = 0;i < objs.length; i ++) {
if(objs[i].attributes['oldvisibility']) {
objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
objs[i].removeAttribute(’oldvisibility’);
}
}
hiddenobj = new Array();
$(’pmlayer’).style.display = ‘none’;
}
}

var pmwindragstart = new Array();
function pmwindrag(obj) {
obj.onmousedown = function(e) {
if(is_ie) {
document.body.onselectstart = function() {
return false;
}
}
pmwindragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
pmwindragstart[2] = parseInt($(’pmlayer’).style.left);
pmwindragstart[3] = parseInt($(’pmlayer’).style.top);
$(’pmwinmask’).style.display = ”;
doane(e);
}
_attachEvent(document.body, ‘mousemove’, function(e) {
if(pmwindragstart[0]) {
var pmwindragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
with($(’pmlayer’)) {
style.left = (pmwindragstart[2] + pmwindragnow[0] - pmwindragstart[0]) + ‘px’;
style.top = (pmwindragstart[3] + pmwindragnow[1] - pmwindragstart[1]) + ‘px’;
}
doane(e);
}
});
obj.onmouseup = function(e) {
if(is_ie) {
document.body.onselectstart = function() {
return true;
}
}
pmwindragstart = [];
$(’pmwinmask’).style.display = ‘none’;
doane(e);
}
obj.onmouseover = null;
}
function insertOpenImage(txt) {
pmwin(’open’);
}

function insertTextImage(txt) {
editor.focusEditor();
if (txt!=null) {
if (editor._editMode == “textmode”) {
sm=txt;
AddText(sm,”);
} else {
try{editor._doc.execCommand(”insertimage”,false,txt);}
catch(e) {}
}
}
}

4.修改模板文件(template\wind\wysiwyg_editor.html)
将原来insertimage: [ true, insertImage, false ], 修改 为 insertimage: [ true, insertOpenImage, false ]

5.调用yupoo本地缓存设置(下面这个对对象$f是一个YUPOO PHP API接口):(此项为可选项,仅作速度优化用)

编辑(hack\pw_yupoo\insert_img.php)文件,找到下面的代码,两种缓存方式只能选一种。

//使用文件缓存方式,需设置文件cache路径,如果是linux系统,需将目录权限设置成777
$f->enableCache(
“fs”,
‘./cache/files’,//文件cache路径
“300″
);

//数据库的缓存方式,需指定用户名和数据库名(默认的cache表名为yupoo_cache)
$f->enableCache(
“db”,
“mysql://root:zhangsf@localhost/test”
);

6.上传临时文件设置(默认是到cache文件夹下面,可以自行修改)[对于上一步本地缓存采用文件系统的在linux系统中这个目录设置成可写,也就是写权限为777] 详细cache配置查看(hack\pw_yupoo\config.php) 文件

7.编辑(template\wind\heaer.htm)文件,找到<div id=”main”>在这个后面紧跟着加入两个div层
<div id=”append_parent”></div>
<div id=”ajaxwaitid”></div>

附件:pw_yupoo102

————–安装配置结束—————-

07月 16th, 2008端口对照表

端口对照表

http ======> port 80 (Hyper Text Transfer Protocol)
ftp-data ==> port 20 (File Transfer Protocol - Default Data)
ftp =======> port 21 (File Transfer Protocol - Control)
POP3 ======> port 110 (Post Office Protocol version 3)
SMTP ======> port 25 (Simple Mail Transfer Protocol)
NNTP ======> port 119 (Network News Transfer Protocol)
telnet ====> port 23 (Telnet)
Gopher ====> port 70 (Gopher)
IRC =======> port 194 (Internet Relay Chat)
Proxy =====> port 80/8080/3128 (Proxy)
Socks =====> port 1080 (Socks)
DNS =======> port 53 (Domain Name Server)
hostname ==> port 101 (NIC Host Name Server)
finger ====> port 79 (Finger)
nicname ===> port 43 (Who Is)
login =====> port 49 (Login Host Protocol)
HTTPS =====> port 443 (https MCom)
imap3 =====> port 220 (Interactive Mail Access Protocol v3)
NetBIOS ===> port 137 138 139 (NetBIOS)
NFS =======> port 2049 (Network File Service)
SNMP ======> port 161 (Simple Network Management Protocol)
snmptrap ==> port 162 (SNMP TRAP)
TFTP ======> port 69 (Trivial File Transfer)
sqlserv ===> port 118 (SQL Services)
uucp-path => port 117 (UUCP Path Service)
X Window ==> port 6000 6001 (X Window System)

0/tcp Reserved
0/udp Reserved
tcpmux 1/tcp TCP Port Service Multiplexer
compressnet 2/tcp Management Utility
compressnet 3/tcp Compression Process
rje 5/tcp Remote Job Entry
echo 7/tcp Echo
echo 7/udp Echo
discard 9/tcp Discard
discard 9/udp Discard
systat 11/tcp Active Users
daytime 13/tcp Daytime
daytime 13/udp Daytime
qotd 17/tcp Quote of the Day
qotd 17/udp Quote of the Day
rwrite 18/tcp RWP rwrite
rwrite 18/udp RWP rwrite
msp 18/tcp Message Send Protocol
msp 18/udp Message Send Protocol
chargen 19/tcp Character Generator
chargen 19/udp Character Generator
ftp-data 20/tcp File Transfer [Default Data]
ftp 21/tcp File Transfer [Control]
telnet 23/tcp Telnet
24/tcp any ** mail system
24/udp any ** mail system
smtp 25/tcp Simple Mail Transfer
nsw-fe 27/tcp NSW User System FE
nsw-fe 27/udp NSW User System FE
msg-icp 29/tcp MSG ICP
msg-icp 29/udp MSG ICP
msg-auth 31/tcp MSG Authentication
msg-auth 31/udp MSG Authentication
dsp 33/tcp Display Support Protocol
dsp 33/udp Display Support Protocol
35/tcp any ** printer server
35/udp any ** printer server
time 37/tcp Time
time 37/udp Time
rap 38/tcp Route Access Protocol
rap 38/udp Route Access Protocol
rlp 39/udp Resource Location Protocol
graphics 41/tcp Graphics
graphics 41/udp Graphics
nameserver 42/udp Host Name Server
nicname 43/tcp Who Is
mpm-flags 44/tcp MPM FLAGS Protocol
mpm 45/tcp Message Processing Module [recv]
mpm-snd 46/tcp MPM [default send]
ni-ftp 47/tcp NI FTP
ni-ftp 47/udp NI FTP
auditd 48/tcp Digital Audit Daemon
auditd 48/udp Digital Audit Daemon
login 49/tcp Login Host Protocol
re-mail-ck 50/tcp Remote Mail Checking Protocol
re-mail-ck 50/udp Remote Mail Checking Protocol
la-maint 51/udp IMP Logical Address Maintenance
xns-time 52/tcp XNS Time Protocol
xns-time 52/udp XNS Time Protocol
domain 53/tcp Domain Name Server
domain 53/udp Domain Name Server
xns-ch 54/tcp XNS Clearinghouse
xns-ch 54/udp XNS Clearinghouse
isi-gl 55/tcp ISI Graphics Language
isi-gl 55/udp ISI Graphics Language
xns-auth 56/tcp XNS Authentication
xns-auth 56/udp XNS Authentication
57/tcp any ** terminal access
57/udp any ** terminal access
xns-mail 58/tcp XNS Mail
xns-mail 58/udp XNS Mail
59/tcp any ** file service
59/udp any ** file service
60/tcp Unassigned
60/udp Unassigned
ni-mail 61/tcp NI MAIL
ni-mail 61/udp NI MAIL
acas 62/tcp ACA Services
covia 64/tcp Communications Integrator (CI)
tacacs-ds 65/tcp TACACS-Database Service
sql*net 66/tcp Oracle SQL*NET
bootps 67/udp Bootstrap Protocol Server
bootpc 68/udp Bootstrap Protocol Client
tftp 69/udp Trivial File Transfer
gopher 70/tcp Gopher
netrjs-1 71/tcp Remote Job Service
netrjs-1 71/udp Remote Job Service
netrjs-2 72/tcp Remote Job Service
netrjs-