prtdiag输出CPU 内存插槽等硬件信息-Solaris

08:26上午 六月 19, 2008 in category General by 天龙

# prtdiag
System Configuration:                                                           
BIOS Configuration: Intel Corp. BA72210A.86B.0155.2005.0110.1040 01/10/2005

==== Processor Sockets ====================================

Version                          Location Tag
-------------------------------- --------------------------
Intel(R) Pentium(R) 4 processor  J3E1

==== Memory Device Sockets ================================

Type    Status Set Device Locator      Bank Locator
------- ------ --- ------------------- --------------------
DDR     in use 1   J5G2                CHANNEL A DIMM0
DDR     in use 2   J5G3                CHANNEL A DIMM1
DDR     in use 1   J5H1                CHANNEL B DIMM0
DDR     in use 2   J5H2                CHANNEL B DIMM1

==== On-Board Devices =====================================
Intel GMCH AGP Graphics Controller
Marvell Ethernet Device
Intel 82551 Ethernet Device

==== Upgradeable Slots ====================================

ID  Status    Type             Description
--- --------- ---------------- ----------------------------
11  available 未知              J5B1
1   available PCI              J6B2
2   available PCI              J6B1
12  available
未知             J7C1
13  available
未知              J8C2
3   available PCI              J9B1

评论[0]

mod-cband中文手册

05:10下午 六月 18, 2008 in category 技术 by 天龙

mod_cband - 一个在apache2下使用的每用户、每虚拟主机、每客户端的带宽限制器

文档

1. 在指令中可以使用的单位:

传输速度:
    o kbps, Mbps, Gbps - "位/秒"的倍数, 分别为: 1024, 1024*1024 和 1024*1024*1024 位/秒
    o kb/s, Mb/s, Gb/s - "字节/秒"的倍数, 分别为: 1024, 1024*1024 and 1024*1024*1024 字节/秒
    o 默认为 kbps,就是1024位/秒,128字节/秒

传输定额:
    o K, M, G - 字节的倍数, 分别为: 1000, 1000*1000 and 1000*1000*1000 字节
    o Ki, Mi, Gi - 字节的倍数, 分别为: 1024, 1024*1024 and 1024*1024*1024 字节
    o 默认为 K,就是1000字节

时间周期:
    o S, M, H, D, W - 秒的倍数: 秒, 分, 小时, 天, 周; 分别为: 1, 60, 3600, 86400, 604800 秒
    o 默认为 S,就是秒


2. 指令

名称    CBandDefaultExceededURL
描述     所有虚拟主机或者用户超出配置的限制时,默认跳转的URL
注意:    如果你没有指定这个URL,将返回标准的 "503 服务不可用"信息
上下文     Server config
语法     CBandDefaultExceededURL URL


名称     CBandDefaultExceededCode
描述     当配置的传输被超出,返给用户的http代码
上下文     Server config
语法     CBandDefaultExceededCode HTTP_CODE
例子     CBandDefaultExceededCode 509


名称     CBandScoreFlushPeriod
描述     指定一个虚拟主机或者用户的分数被写入记分板文件的周期。使用这个来提高mod_cband的性能,默认为1
上下文     Server config
语法     CBandScoreFlushPeriod number_of_requests
例子     CBandScoreFlushPeriod 100
        任何虚拟主机或者用户的记分板将在100个请求之后保存


名称     CBandSpeed
描述     指定虚拟主机最大传输速度
上下文     <Virtualhost>
语法     CBandSpeed kbps rps max_conn
        kbps - 最大传输速度,单位[kMG]bps 或者 [kMG]B/s
        rps - 每秒最大请求数
        max_conn - 最大并发连接数
例子     CBandSpeed 1024 10 30
        指定最大传输速度为1024kbps (1024 * 1024 位/秒),每秒最多接收10个请求,同时最大30个并发连接
注意:    这个功能从0.9.6.0版本开始支持


名称     CBandRemoteSpeed
描述     为任一个远程客户端指定最大速度
上下文     <Virtualhost>
语法     CBandRemoteSpeed kbps rps max_conn
        kbps - 最大传输速度,单位[kMG]bps 或者 [kMG]B/s
        rps - 每秒最大请求数
        max_conn - 最大并发连接数
例子     CBandRemoteSpeed 20kb/s 3 3
        指定最大速度为20kB/s (20 * 1024字节/秒),每秒最多3个请求,最多同时保持3个连接
注意:    这个功能从0.9.6.1-rc2版本开始支持


名称     CBandClassRemoteSpeed
描述     为符合目标类的任意远程客户端指定最大传输速度
上下文     <Virtualhost>
语法     CBandClassRemoteSpeed class_name kbps rps
        class_name - 目标类名称
        kbps - 最大传输速度,kbps 或者 kB/s
        rps - 每秒最大请求数
        max_conn - 最大并发连接数
例子     <CBandClass googlebot_class>
            CBandClassDst 66.249.64/24
            CBandClassDst 66.249.65/24
            CBandClassDst 66.249.79/24
        </CBandClass>
        CBandClassRemoteSpeed googlebot_class 20kb/s 2 3

        指定最大速度为20kB/s (20 * 1024字节/秒),每秒最多2个请求,最多同时保持3个连接
注意:    这个功能从0.9.6.1-rc2版本开始支持


名称     CBandRandomPulse
描述     为数据传输打开或者关闭随机脉冲生成器。
        随机脉冲生成器是mod_cband实现速度限制的一部分。
        这个指令改变了传输速度是被决定和强制的。
        传输速度在一个时间段被测量,然后在这个时间段给出传输速度。
        当 r.p.g. 被起用,这个时间段是随机选择的,为网络负载提供统计。
        禁用它会导致带宽和CPU利用率失真。
上下文     Global
语法     CBandRandomPulse On/Off


名称     CBandLimit
描述     指定虚拟主机配额
上下文     <Virtualhost>
语法     CBandLimit limit
        limit - 带宽配额, 可用单位: K (kilo), M (mega), G (giga), Ki (kibi),
        Mi (mebi), Gi (gibi)
例子     CBandLimit 10M
        Specifies 10 * 1000 * 1000 字节配额

        CBandLimit 10Mi
        Specifies 10 * 1024 * 1024 字节配额


名称     CBandClassLimit
描述     为虚拟主机目标类制定配额
上下文     <Virtualhost>
语法     CBandClassLimit class_name limit
        class_name - 类名称
        limit - 配额大小, 可用单位: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)


名称     CBandExceededURL
描述     为某一虚拟主机或者用户超出配置的限制时跳转的URL
注意:     如果你没有指定这个URL,将返回标准的 "503 服务不可用"信息
上下文     <Virtualhost>
语法     CBandExceededURL URL


名称     CBandExceededSpeed
描述     当一个虚拟主机传输超过配置的限制时,减慢到这个指定的最大速度
上下文     <Virtualhost>
语法     CBandExceededSpeed kbps rps max_conn
        kbps - 最大传输速度, kbps 或 kB/s
        rps - 每秒最大请求数
        max_conn - 最大同时连接数
注意:    这个功能从0.9.6.1版本开始支持


名称     CBandScoreboard
描述     指定虚拟主机记分板文件
上下文     <Virtualhost>
语法     CBandScoreboard path
注意:     对于apache用户必须是可写的


名称     CBandPeriod
描述     指定一个虚拟主机使用率被清除的周期
上下文     <Virtualhost>
语法     CBandPeriod period
        period - 可用单位: S (seconds), M (minutes), H (hours), D (days), W (weeks)
例子     CBandPeriod 1W
        CBandPeriod 14D
        CBandPeriod 60M


名称     CBandPeriodSlice
描述     Specifies the period slice length
默认     slice_len = limit
上下文     <Virtualhost>
语法     CBandPeriodSlice slice_length
例子     CBandLimit 100G
        CBandPeriod 4W
        CBandPeriodSlice 1W
        一个周期被分为4部分(4W/1W = 4). 每部分有100G/4=25G配额限制。
        经过一周配额将是50G, 经过两周配额将是75G ...


名称     <CBandUser>
描述     定义一个新的cband用户
上下文     Server config
语法     <CBandUser user_name>


名称     CBandUserSpeed
描述     为一个cband用户指定最大传输速度
上下文     <CBandUser>
语法     CBandUserSpeed kbps rps max_conn
        kbps - 最大传输速度,kbps 或 kB/s
        rps - 每秒最大请求数
        max_conn - 最大并发连接数
例子     CBandUserSpeed 100kb/s 10 5
        Specifies maximal speed 100 kB/s (100 * 1024 bytes per second),
        maximal 10 requests per second and 5 open connections
注意:    这个功能从0.9.6.0版本开始支持


名称     CBandUserLimit
描述     为cband用户指定配额
上下文     <CBandUser>
语法     CBandUserLimit limit
        limit - 配额大小, 可用单位: K (kilo), M (mega), G (giga), Ki (kibi),
        Mi (mebi), Gi (gibi)
例子     CBandUserLimit 10M
        指定 10 * 1000 * 1000 字节配额

        CBandUserLimit 10Mi
        指定 10 * 1024 * 1024 字节配额


名称     CBandUserClassLimit
描述     为cband用户目标类指定配额
上下文     <CBandUser>
语法     CBandUserClassLimit class_name limit
        class_name - 类名称
        limit - 配额大小, 可用单位: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)


名称     CBandUserExceededURL
描述     当用户的虚拟主机超出配置的传输时重定向到的URL
注意:     如果你没有指定这个URL,将返回标准的 "503 服务不可用"信息
上下文     <CBandUser>
语法     CBandUserExceededURL URL


名称     CBandUserExceededSpeed
描述     当用户的传输超出限制时,将会下降到这个指定的最大速度
注意:     CBandUserExceededURL must not be used if you want to only slow down user's pages with CBandUserExceededSpeed directive
上下文     <CBandUser>
语法     CBandUserExceededSpeed kbps rps max_conn
        kbps - 最大传输速度 ,kbps 或 kB/s
        rps - 每秒最大请求数
        max_conn - 最大并发连接
注意:    这个功能从0.9.6.0版本开始支持


名称     CBandUserScoreboard
描述     指定一个用户的记分板文件
上下文     <CBandUser>
语法     CBandUserScoreboard path
注意:     路径对apache-user必须可写


名称     CBandUserPeriod
描述     指定一个用户使用率清零的周期
上下文     <CBandUser>
语法     CBandUserPeriod period
        period - 可用单位: S (秒), M (分), H (小时), D (天), W (周)
例子     CBandUserPeriod 1W
        CBandUserPeriod 14D
        CBandUserPeriod 60M


名称     CBandUserPeriodSlice
描述     指定一个周期分段长度
默认     slice_len = limit
上下文     <CBandUser>
语法     CBandUserPeriodSlice slice_length
例子     CBandUserLimit 100G
        CBandUserPeriod 4W
        CBandUserPeriodSlice 1W
        这个周期被分为4小段(4周/1周 = 4). 每段有 100G/4=25G 配额,一周后配额是50G, 两周后将是75G ...


3. 状态处理器配置例子
To view actual bandwidth limits, usages, users, scoreboards, add the following lines into the config file:

<Location /cband-status>
SetHandler cband-status
</Location>

<Location /cband-status-me>
SetHandler cband-status-me
</Location>

Then you can access the status page with a URL like:
http://server_name/cband-status
http://server_name/cband-status-me

An example of the cband-status is available here
An example of the cband-status-me is available here

In versions >=0.9.5-rc1 you can also view /cband-status handler in the XML format:

http://server_name/cband-status?xml
http://server_name/cband-status-me?xml

An example of the cband-status in the XML format is available here
An example of the cband-status-me in the XML format is available here


4. Bandwidth Speed Configuration 例子

<VirtualHost *:80>
    DocumentRoot /var/www/xyz.org/
    Server名称 xyz.org
    CustomLog /var/log/apache2/xyz.org.access combined
    ErrorLog /var/log/apache2/xyz.org.access.error
    RewriteEngine On
    RewriteOptions inherit

    # Maximal 1024kbps speed for this virtualhost
    # Maximal 10 requests per second for this virtualhost
    # Maximal 30 open connections for this virtualhost
    CBandSpeed 1024 10 30

    # Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
    CBandRemoteSpeed 10kb/s 3 2

    # Maximal 20kB/s speed, 2 requests/s and 3 open connections for remote
    # clients from class googlebot_class :P
    CBandClassRemoteSpeed googlebot_class 20kb/s 2 3
</VirtualHost>

5. Bandwidth Quota Configuration 例子
per-virtualhost bandwidth limiting configuration
Next, you may define virtualhost's bandwidth limits, URL location and the path to scoreboard files for individual virtualhosts:

# specify default 'bandwidth exceeded' location
CBandDefaultExceededURL    http://haha.org/bandwidth_exceeded.html

<VirtualHost *:80>
    DocumentRoot /var/www/xyz.org/
    Server名称 xyz.org
    CustomLog /var/log/apache2/xyz.org.access combined
    ErrorLog /var/log/apache2/xyz.org.access.error
    RewriteEngine On
    RewriteOptions inherit

    # 100MB virtualhost bandwidth limit
    CBandLimit 100000

    # redirect to http://abc.org/bandwidth_exceeded.html
    # when the limit has been reached
    CBandExceededURL http://abc.org/bandwidth_exceeded.html

    # virtualhost's scoreboard file
    CBandScoreboard /var/run/apache2/xyz.org.scoreboard

    # a period of time after which the scoreboard will be cleared (30 minutes)
    # (only in >=0.9.5-rc2)
    CBandPeriod 30M
</VirtualHost>


per-user bandwidth limiting configuration (only in versions >=0.9.1)
In versions >=0.9.1 you can define limits for users and assign virtualhosts to them

# define user 'dembol'
<CBandUser dembol>
    # 200MB bandwidth limit for user 'dembol'
    CBandUserLimit 200000

    # redirect to http://abc.org/bandwidth_exceeded.html
    # when the limit has been reached
    CBandUserExceededURL http://abc.org/bandwidth_exceeded.html

    # user's scoreboard file
    CBandUserScoreboard /var/run/apache2/dembol.scoreboard

    # a period of time after which the scoreboard will be cleared (5 weeks)
    # (only in >=0.9.5-rc2)
    CBandUserPeriod 5W
</CBandUser>

# assign virtualhost 'xyz.org' to user 'dembol'
<VirtualHost *:80>
    Server名称 xyz.org
    # Specify virtualhost's owner
    CBandUser dembol
</VirtualHost>

# assign virtualhost 'aga.org' to user 'dembol'
<VirtualHost *:80>
    Server名称 aga.org
    # Specify virtualhost's owner
    CBandUser dembol
</VirtualHost>


per-user and per-virtualhost bandwidth limiting configuration (only in versions >=0.9.1)
In versions >=0.9.1 you can also mix per-user and per-virtualhost bandwidth limiting techniques

# define user 'dembol'
<CBandUser dembol>
    # 200MB bandwidth limit for user 'dembol'
    CBandUserLimit 200000

    # redirect to http://abc.org/bandwidth_exceeded.html
    # when the limit has been reached
    CBandUserExceededURL http://abc.org/bandwidth_exceeded.html

    # user's scoreboard file
    CBandUserScoreboard /var/run/apache2/dembol.scoreboard

    # a period of time after which the scoreboard will be cleared (4 days)
    # (only in >=0.9.5-rc2)
    CBandUserPeriod 4D
</CBandUser>

# assign virtualhost 'xyz.org' to user 'dembol'
<VirtualHost *:80>
    Server名称 xyz.org
    # Specify virtualhost's owner
    CBandUser dembol

    # 100MB virtualhost bandwidth limit
    CBandLimit 100000

    # redirect to http://abc.org/bandwidth_exceeded.html
    # when the limit has been reached
    CBandExceededURL http://abc.org/bandwidth_exceeded.html

    # virtualhost's scoreboard file
    CBandScoreboard /var/run/apache2/xyz.org.scoreboard

    # a period of time after which the scoreboard will be cleared (50 minutes)
    # (only in >=0.9.5-rc2)
    CBandPeriod 50M
</VirtualHost>

# assign virtualhost 'aga.org' to user 'dembol'
<VirtualHost *:80>
    Server名称 aga.org
    # Specify virtualhost's owner
    CBandUser dembol
</VirtualHost>


per-destination bandwidth limiting configuration (only in >=0.9.5-rc1 versions)
In >= 0.9.5-rc1 you can limit traffic to some destination classes. The destination classes are defined by <CBandClass class_name> section. The limits for the classes are specified by CBandClassLimit and CBandUserClassLimit commands

# define 'class_1'
<CBandClass class_1>
    CBandClassDst 217.172.231.67
    CBandClassDst 127/8
    CBandClassDst 192.168.0.0/24
    CBandClassDst 10.0.0.20
</CBandClass>

# define 'class_2'
<CBandClass class_2>
    CBandClassDst 192.168.100.100
    CBandClassDst 153.19/16
</CBandClass>

<CBandUser dembol>
    CBandUserLimit 1000000
    CBandUserExceededURL http://edns.pl/bandwidth_exceeded.html
    CBandUserScoreboard /home/dembol/write/user.dembol.scoreboard

    # 500MB limit for 'class_2'
    CBandUserClassLimit class_2 500000
</CBandUser>

<VirtualHost *:80>
    ...
    CBandUser dembol

    # 1GB limit for 'class_1'
    CBandClassLimit class_1 1000000

    # a period of time after which the scoreboard will be cleared (120 seconds)
    # (only in >=0.9.5-rc2)
    CBandPeriod 120S
</VirtualHost>

评论[0]

uname 命令 - Solaris

08:00下午 六月 17, 2008 in category General by 天龙

uname用来获取当前系统的名字。

常用选项:

-a 打印当前可用基本信息

-i 打印平台名称

-m 打印机器硬件名

-n 打印节点名称

-p 打印当前主机的ISA或者处理器类型

-r 打印操作系统发布版本

-v 打印操作系统版本


例子

uname -a
SunOS S10-zone01 5.10 Generic_137112-01 i86pc i386 i86pc

uname -i
i86pc


uname -p
i386

uname -r
5.10

uname -s
SunOS

uname -v
Generic_137112-01

uname -X
System = SunOS
Node = S10-zone01
Release = 5.10
KernelID = Generic_137112-01
Machine = i86pc
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 1

评论[0]

Failed creating java C:\JDK1.6\jre\bin\server\jvm.dll

10:33下午 五月 12, 2008 in category 技术 by 天龙

[2008-05-12 22:08:26] [info] Procrun (2.0.3.0) started
[2008-05-12 22:08:26] [info] Running Service...
[2008-05-12 22:08:26] [info] Starting service...
[2008-05-12 22:08:26] [174  javajni.c] [error] 找不到指定的模块。
[2008-05-12 22:08:26] [986  prunsrv.c] [error] Failed creating java C:\JDK1.6\jre\bin\server\jvm.dll
[2008-05-12 22:08:26] [1260 prunsrv.c] [error] ServiceStart returned 1
[2008-05-12 22:08:26] [info] Run service finished.
[2008-05-12 22:08:26] [info] Procrun finished.
[2008-05-12 22:09:33] [info] Procrun (2.0.3.0) started
[2008-05-12 22:09:33] [info] Running Service...
[2008-05-12 22:09:33] [info] Starting service...
[2008-05-12 22:09:34] [174  javajni.c] [error] 找不到指定的模块。
[2008-05-12 22:09:34] [986  prunsrv.c] [error] Failed creating java C:\JDK1.6\jre\bin\server\jvm.dll
[2008-05-12 22:09:34] [1260 prunsrv.c] [error] ServiceStart returned 1
[2008-05-12 22:09:34] [info] Run service finished.
[2008-05-12 22:09:34] [info] Procrun finished.
[2008-05-12 22:15:41] [info] Procrun (2.0.3.0) started
[2008-05-12 22:15:41] [info] Running Service...
[2008-05-12 22:15:41] [info] Starting service...
[2008-05-12 22:15:41] [174  javajni.c] [error] 找不到指定的模块。
[2008-05-12 22:15:41] [986  prunsrv.c] [error] Failed creating java C:\JDK1.6\jre\bin\server\jvm.dll
[2008-05-12 22:15:41] [1260 prunsrv.c] [error] ServiceStart returned 1
[2008-05-12 22:15:41] [info] Run service finished.
[2008-05-12 22:15:41] [info] Procrun finished.
[2008-05-12 22:17:01] [info] Procrun (2.0.3.0) started
[2008-05-12 22:17:01] [info] Running Service...
[2008-05-12 22:17:02] [info] Starting service...
[2008-05-12 22:17:05] [info] Service started in 3546 ms.
[2008-05-12 22:17:21] [info] Stopping service...

必须赋予用户C:\windows\system32\msvcr71.dll运行权限或者检查其是否存在。

评论[0]

Solaris 10 zonecfg命令

03:01下午 五月 12, 2008 in category 技术 by 天龙

zonecfg命令:

add <resource-type>
    (global scope)
add <property-name> <property-value>
    (resource scope)
    将指定的资源增加至配置。

cancel
    取消资源/特性说明。

clear <property-name>
    清除属性值。

commit
    确定当前配置。配置必须被确定为由 zoneadm 使用。确定配置之后,才可以使用 revert 命令删除更改。在 zonecfg 会话完成之后,将自动 尝试执行 此操作。

create [-F] [ -a <path> | -b | -t <template> ]
    为指定区域创建配置。应该将 create 用于开始配置新区域。如果要覆写现有配置,可使用 -F 标志强制执行此操作。如果给定了 -t 模板,将创建与指定模板相同的配置,只不过区域名称会从template 变为 zonename。'create -a' 将从分离的区域路径创建配置。'create -b' 将产生空配置。不带参数的 'create' 将应用 Sun 的缺省设置。

delete [-F]
    删除指定的区域。可使用 -F 标志强制执行此操作。

end
    结束资源/特性说明。

exit [-F]
    退出程序。可使用 -F 标志强制执行此操作。

export [-f output-file]
    打印配置至标准输出或输出文件 (如果指定),以适合在命令文件中使用的格式打印。

help [commands] [syntax] [usage] [<command-name>]

    打印帮助消息。

info [<resource-type> [property-name=property-value]*]
    显示有关当前配置的信息。如果资源类型已指定,则仅显示相关类型资源的信息。如果资源 ID 已指定,则仅显示有关该资源的信息。

remove [-F] <resource-type> [ <property-name>=<property-value> ]*
    (global scope)
remove <property-name> <property-value>
    (resource scope)
    从配置中删除指定资源。可使用 -F 标志强制执行此操作。

revert [-F]
    将配置恢复为上次确定的状态。可使用 -F 标志强制执行此操作。

select <resource-type> { <property-name>=<property-value> }
    选择要修改的资源。资源修改已使用命令 "end" 完成。特性名称/值对必须唯一标识资源。请注意大括号 ('{','}') 表示其中包含一项或多项, 无论内容为何。

set <property-name>=<property-value>
    设置特性值。

verify
    检验当前配置是否正确 (某些资源类型具有必需的特性)。

评论[0]