正在加载...
分页: 39/55 第一页 上页 34 35 36 37 38 39 40 41 42 43 下页 最后页 [ 显示模式: 摘要 | 列表 ]

Linux下使用Rar解压缩文件

[ 2009/03/04 20:47 | by selboo ]
下载rarlinux

官方地址
http://www.rarsoft.com/download.htm
[root@wpcn ~]# wget http://www.rarsoft.com/rar/rarlinux-3.8.0.tar.gz

安装
[root@wpcn ~]# tar -zxvf rarlinux-3.8.0.tar.gz
[root@wpcn ~]# cd rar
[root@wpcn rar]# make && make install

使用
[root@wpcn rar]# rar a selboo.r
Tags:

Linux下webbench压力测试

[ 2009/03/04 20:12 | by selboo ]
下载安装
[root@wpcn ~]# tar -zxvf webbench-1.5.tar.gz
[root@wpcn ~]# cd webbench-1.5
[root@wpcn webbench-1.5]# make && make install

使用方法
[root@wpcn webbench-1.5]# webbench --help
webbench [option]... URL
  -f|--force               Don't wait for reply from server.
  -r|--reload              Send reload request - Pragma: no-cache.
  -t|--time           Run benchmark for seconds. Default 30.
  -p|--proxy Use proxy server for request.
  -c|--clients          Run HTTP clients at once. Default one.
  -9|--http09              Use HTTP/0.9 style requests.
  -1|--http10              Use HTTP/1.0 protocol.
  -2|--http11              Use HTTP/1.1 protocol.
  --get                    Use GET request method.
  --head                   Use HEAD request method.
  --options                Use OPTIONS request method.
  --trace                  Use TRACE request method.
  -?|-h|--help             This information.
  -V|--version             Display program version.

以下是我在vmware测试
[root@wpcn webbench-1.5]# webbench -c 300 -t 5 http://127.0.0.1/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://127.0.0.1/
300 clients, running 5 sec.

Speed=108240 pages/min, 1813374 bytes/sec.
Requests: 9020 susceed, 0 failed.

-c 300 模拟300客户端连接
-t 5 是连接5秒钟
Speed=108240 pages/min 每分钟浏览http://127.0.0.1/selboo.php 这个页面108240次
1813374 bytes/sec. 每秒1813374个字节
Requests: 9020 susceed 连接成功9020
0 failed. 失败0

下载文件 (已下载 409 次)


在介绍一个牛命令 from:http://blog.s135.com/post/269.htm
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

返回结果示例:
LAST_ACK 5
SYN_RECV 30
ESTABLISHED 1597
FIN_WAIT1 51
FIN_WAIT2 504
TIME_WAIT 1057

点击在新窗口中浏览此图片

TCP状态描述:
CLOSED:无连接是活动的或正在进行
LISTEN:服务器在等待进入呼叫
SYN_RECV:一个连接请求已经到达,等待确认
SYN_SENT:应用已经开始,打开一个连接
ESTABLISHED:正常数据传输状态
FIN_WAIT1:应用说它已经完成
FIN_WAIT2:另一边已同意释放
ITMED_WAIT:等待所有分组死掉
CLOSING:两边同时尝试关闭
TIME_WAIT:另一边已初始化一个释放
LAST_ACK:等待所有分组死掉

当我们用netstat -an的时候,我们有时候可以看到类似的输出:
            
udp 0 0 0.0.0.0:32768 0.0.0.0:*

     但是查找/etc/services又没有这个端口的相关说明,怎么办呢?这个是不是黑客程序?有没有办法查看究竟什么程序监听在这个端口?

使用lsof -i :32768就可以看到:

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
rpc.statd 603 root 4u IPv4 953 UDP *:32768
rpc.statd 603 root 6u IPv4 956 TCP *:32768 (LISTEN)

原来是rpc的程序。

使用lsof -i :port就能看见所指定端口运行的程序,同时还有当前连接。

看另一篇命令详解 linux lsof命令详解

linux ulimit

[ 2009/02/27 21:45 | by selboo ]
      有时候在程序里面需要打开多个文件,进行分析,系统一般默认数量是1024,(用ulimit -a可以看到)对于正常使用是够了,但是对于程序来讲,就太少了.

修改办法:

vi /etc/security/limits.conf
加上:
* soft nofile 8192
* hard nofile 20480
重启就OK


ulimit 命令

用途

设置或报告用户资源极限.
语法

ulimit [ -H ] [ -S ] [ -a ] [ -c ] [ -d ] [ -f ] [ -m ] [ -n ] [ -s ] [ -t ] [ Limit ]
描述

ulimit 命令设置或报告用户进程资源极限,如 /etc/security/limits 文件所定义.文件包含以下缺省值极限:
编译php是出现错误

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

解决一
      你可能在编译APACHE的时候,使用 -with-mpm模块,请在编译MYSQL的时候加上 -enable-thread-safe-client.

解决二
      通过查找libmysqlclient,发现是在/usr/lib64/mysql/目录内的libmysqlclient.so.15.0.0做的软连接,PHP默认是去的 /usr/lib/搜索,所以没有找到.找到问题了就好解决了.

cp -rp /usr/lib64/mysql/libmysqlclient.so.15.0.0 /usr/lib/libmysqlclient.so
Tags: , , ,
分页: 39/55 第一页 上页 34 35 36 37 38 39 40 41 42 43 下页 最后页 [ 显示模式: 摘要 | 列表 ]