테스트 사이트 - 개발 중인 베타 버전입니다

xcache 설치

· 13년 전 · 1860
출처: 여리닷컴
 
xcache 설치
xcache는 제로보드XE와 같은 class/object기반의 프로그램들을 보다 빠르고 가볍게 해주는 캐쉬 프로그램입니다.
APC나 eaccelerator 속도도 더 빠르다고 알려져 있구요.
php5.2.0에 돌아가는 xcache 1.2.2 을 기준으로 설치법을 알려드립니다.
wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz

tar xvfz xcache-1.2.2.tar.gz
cd xcache-1.2.2
phpize
./configure --enable-xcache --enable-xcache-coverager
make
make install
cat xcache.ini >> /etc/php.ini

위에서 phpize나 configure시에 php 실행파일들의 경로 문제가 생길 수 있습니다.
1번처럼 php를 /usr/local/php/bin 에 실행파일이 생기게 했다면 아래와 같이 미리 PATH를 지정해주세요.

export PATH="$PATH:/usr/local/php/bin"

그 다음 /etc/php.ini 파일을 여세요.
만약 zend optimizer등을 설치하였다면 xcache 설정중 zend_extension이 zend optimizer보다 위에 있어야 합니다.

저는 아래와 같이 설정하였습니다.
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3
zend_extension_ts = /usr/local/php/lib/php/extensions/no-debug-zts-20060613/xcache.so
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
;zend_extension_ts = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
;; For windows users, replace xcache.so with php_xcache.dll
;zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install as extension, make sure your extension_dir setting is correct
; extension = xcache.so
;; or win32:
; extension = php_xcache.dll
[xcache.admin]
xcache.admin.enable_auth = Off
xcache.admin.user = "admin"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = ""
[xcache]
; ini only settings, all the values here is default unless explained
; select low level shm/allocator scheme implemenation
xcache.shm_scheme =        "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size  =                64M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count =                 1
; just a hash hints, you can always store count(items) > slots
xcache.slots =                8K
; ttl of the cache item, 0=forever
xcache.ttl   =                 0
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval =           0
; same as aboves but for variable cache
xcache.var_size  =            64M
xcache.var_count =             1
xcache.var_slots =            8K
; default ttl
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300
xcache.test =                Off
; N/A for /dev/zero
xcache.readonly_protection = On
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path =    "/dev/zero"

; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory =   ""
; per request settings
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           On
[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager =          On
; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
 
위의 설정중 xcache.admin.user와 xcache.admin.pass는 xcache 관리자 페이지를 사용할 경우 입력해주면 됩니다.
패스워드 생성 방법은 아래와 같이 하면됩니다echo -n password | md5sum
password 자리에 abcdefg 입력후 변환 하면 아래와 같다.
[root@adminplay php]# echo -n abcdefg | md5sum
7ac66c0f148de9519b8bd264312c4d64  -
참고로 관리자 페이지는 xcache 소스중 admin 이라는 디렉토리에 있고 이admin 디렉토리를
웹에서 접근할 수 있는 곳에 복사해주시면 됩니다.
페이지는 아래 화면을 참고 하세요

XCache.JPG



xcache.size나 xcache.var_size는 적절히 해주시면 됩니다.xcache.count와 xcache.var_count는 cpu process의 수를 적어주시면 됩니다.
cat /proc/cpuinfo |grep -c processor
위와 같이 명령어를 입력하면 프로세스의 수가 나옵니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
24366
4041
16525
16524
16520
16518
16514
16504
16501
16498
30105
16490
16484
4037
16451
16449
30100
16441
26288
24362
16436
4036
16435
30099
16433
16431
16404
4026
16402
16397
4020
4006
30096
16396
16394
16392
3987
16391
16389
16383
3983
16377
16375
16370
16367
16363
30093
3977
16361
30089
16359
3974
16358
16357
16356
16354
16353
16352
16351
16350
16343
16342
16341
16340
16339
16338
16337
16334
3965
16333
3958
16331
16330
16329
3952
24357
16327
16325
16320
30082
16317
16316
3948
16314
16312
16307
16306
16304
16292
16291
16287
16283
16281
16277
16269
16266
16265
16259
16258
30078