存档:2010年一月

debian上快速安装xcache

一月 5, 2010 | linux, php | RSS 2.0

不用phpize安装了,debian上可以迅速安装上,需要保证你的/etc/apt/sources.list下面是新的。

然后直接 apt-get install php5-xcache

/etc/init.d/apache2 restart

很快就看到结果了。可以用phpinfo看下。

php -r “phpinfo();”|grep “xcache”

/etc/php5/cli/conf.d/xcache.ini,
xcache.admin.enable_auth => On => On
xcache.cacher => On => On
xcache.coredump_directory => no value => no value
xcache.count => 1 => 1
xcache.coveragedump_directory => no value => no value
xcache.coverager => Off => Off
xcache.gc_interval => 0 => 0
xcache.mmap_path => /dev/zero => /dev/zero
xcache.optimizer => On => On
xcache.readonly_protection => no value => no value
xcache.shm_scheme => mmap => mmap
xcache.size => 0 => 0
xcache.slots => 8K => 8K
xcache.stat => On => On
xcache.test => no value => no value
xcache.ttl => 0 => 0
xcache.var_count => 1 => 1
xcache.var_gc_interval => 300 => 300
xcache.var_maxttl => 0 => 0
xcache.var_size => 0M => 0M
xcache.var_slots => 8K => 8K
xcache.var_ttl => 0 => 0

上面的就是配置相关信息,如果xcache_size=0就是关闭xcache的使用

具体配置参数的意义可以参考http://xcache.lighttpd.net/wiki/XcacheIni#XCacheCacher

然后可以做下压力测试,看看结果。

ab -c5 -n3000 http://liufb.kuxun.cn  并发连接为5,3000次请求

具体我用的是sudo ab -n 1000  http://liufb.kuxun.cn/beijing
安装xcache后的
Server Software:        Apache/2.2.9
Server Hostname:        liufb.kuxun.cn
Server Port:            80

Document Path:          /beijing
Document Length:        98026 bytes

Concurrency Level:      1
Time taken for tests:   373.665 seconds
Complete requests:      1000
Failed requests:        974
(Connect: 0, Receive: 0, Length: 974, Exceptions: 0)
Write errors:           0
Total transferred:      97639210 bytes
HTML transferred:       97172210 bytes
Requests per second:    2.68 [#/sec] (mean)
Time per request:       373.665 [ms] (mean)
Time per request:       373.665 [ms] (mean, across all concurrent requests)
Transfer rate:          255.18 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   330  374 191.1    347    3689
Waiting:      139  188 190.8    162    3502
Total:        330  374 191.1    347    3689

Percentage of the requests served within a certain time (ms)
50%    347
66%    352
75%    355
80%    359
90%    374
95%    414
98%    753
99%   1298
100%   3689 (longest request)

Server Software:        Apache/2.2.9
Server Hostname:        liufb.kuxun.cn
Server Port:            80

Document Path:          /beijing
Document Length:        96315 bytes

Concurrency Level:      1
Time taken for tests:   401.374 seconds
Complete requests:      1000
Failed requests:        914
(Connect: 0, Receive: 0, Length: 914, Exceptions: 0)
Write errors:           0
Total transferred:      97633782 bytes
HTML transferred:       97166782 bytes
Requests per second:    2.49 [#/sec] (mean)
Time per request:       401.374 [ms] (mean)
Time per request:       401.374 [ms] (mean, across all concurrent requests)
Transfer rate:          237.55 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   372  401  81.0    390    1504
Waiting:      185  213  80.5    202    1311
Total:        372  401  81.0    390    1504

Percentage of the requests served within a certain time (ms)
50%    390
66%    394
75%    398
80%    400
90%    413
95%    443
98%    561
99%    749
100%   1504 (longest request)

后用webbench测试结果可以看到:

没有安装xcache的测试。
liufb@kooxoo240:~/webbench/webbench-1.5$ webbench -c1000 -t 20 http://liufb.kuxun.cn/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://liufb.kuxun.cn/
1000 clients, running 20 sec.

Speed=903 pages/min, 318838 bytes/sec.
Requests: 301 susceed, 0 failed.

xcache的测试 xcache.size  =               32M

liufb@kooxoo240:~/webbench/webbench-1.5$ webbench -c1000 -t 20 http://liufb.kuxun.cn/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://liufb.kuxun.cn/
1000 clients, running 20 sec.

Speed=2388 pages/min, 430682 bytes/sec.
Requests: 796 susceed, 0 failed.

的安装不上可以看

http://www.howtoforge.com/xcache-php5-apache2-debian-etch

没有评论 »

做一个积极的思考反省者

一月 2, 2010 | 心情杂记 | RSS 2.0

今天北京的雪真的下的不小,索性就坐着床上不出去,早上睡得还好,做了三个梦,起来拿起本书看了看,《影响力》,差不读读完了,算是社会心理学方面的书吧,做销售的应该看一看,坐着提炼的几个观点还是比较认同的,不过写的有些比较繁琐,其实可以精简一些,毕竟大家有些还是能理解的,举例多了也不好,有时候我喜欢看那些薄薄的书,特别是目录索引特别清楚的,就像《如何读一本书》里说的那样,先对书有一个大致的了解,掌握了一个大致的流程脉络就能顺着坐着的思路很快的看下去,繁琐的书有时候像鸡肋,不看吧,觉得还不错,看吧有些感觉是在浪费时间。也许是作者照顾到读者的层次不一样,总之,有些书把作者黑体字的提炼的 比较好的观点看一下觉得已经可以了。快速阅读后,坐下笔记,而有些书这不同。

今天已经是10年的第三天了,元旦那天像09年一样去了西单,整整一年后去西单,发现09元旦离的竟然是这么近,看来过的还真的是太快了。依然是中午没准备好,匆匆忙忙的去吃吉野家,依然是逛一些商场,感觉钱力不只,依然是看到一些抢购的人们,心想,真是疯了,其实想想我也疯了,因为我也加入了他们中的一列,这个也许是社会认同感在起作用吧。发现一年后我的各方面的提高还是比较微小的,但还好我意识到了一些。

09年的一些指标:

技术:

1 找工作的时候猛学了一把,有些东西还是能蒙混过关的,但是基础知识一定需要打捞,不然每次遇到瓶颈了还得需要回去看看基础。譬如学习c语言,学了一段时间然后由于工作比较忙,就奚落了,后来在想学的时候,又得拿起 那些书重新读,其实还是需要坚持不断的去练习,多写,上次写了一次出现了好多问题,特别是指针的。理论需要在实践中才能得到吸收

2 web方面也很少自己写些东西,除了工作方面的,倒是学了点python,shell之类的脚本语言。

3 数学方面,倒是读了不少书,当现在想想有个屁用?还不如老老实实看看mysql。不过有时候看看还是能锻炼我的思维的。

非技术方面:

1 沟通交流的能力:很明显很少对这方面有培养或者提高

2 高效能人方面:公司培训了几次,还是蛮受启发的,卓越的程序员看后也有些启发。起码对自己的思想有些触动。

3 优秀习惯方面: 养成了一些好习惯缺后来给丢掉了,基本上养成半年多的习惯,譬如坚持跑步,锻炼臂力。

4  解决问题的能力:感觉自己的思路还是比较狭窄,有时候不能跳出问题看问题,其实就是经验少。

5 其他一些知识的学习:例如历史,经济,稍稍看过一些不过没自己研究。

10年的一些感想:

首先如题:做一个积极思考的反省着,引用王国维的一句话:入乎其内,故有生气。出乎其外,故有高致。

技术方面:

1 实践并跟踪一些新的架构方面的知识。

2 web从后端到前端的优化积累一定的经验

3 python,c c++之类的要写至少一个项目吧。

4 算法,软件工程等方面,作为专业虽然工作中没有用到,但是作为计算机工程师还是需要了解的。

5 别的数学书不多看把《什么是数学》多看几篇,有机会看下概率论方面的知识。

非技术:

1 首要提高自己分析问题,解决问题的能力

2 交流沟通,演讲,方面的能力提高。

3 英语也是很重要的。口语确实很重要。

等有想到了再补充

没有评论 »