memcache緩存服務(wù)器
測(cè)試緩存
一、MemCache簡介
";$tmp_object=newstdClass;$tmp_object->str_attr='test';$tmp_object->int_attr=123;$memcache->setordie;echo"Storedatainthecache
";$get_result=$memcache->get;echo"Datafromthecache:
";var_dump;?>
(7)memcached安裝telnet
";echo"now_time:".time."
";echo"session_id:".session_id."
";?>
(3)重啟php
/etc/init.d/php-fpmrestart
(5)瀏覽器測(cè)試
7、測(cè)試memcache緩存數(shù)據(jù)庫數(shù)據(jù)
在Mysql服務(wù)器上創(chuàng)建測(cè)試表
php上制作測(cè)試頁
vim/var/www/bdqn/test3.php添加connectordie;$query="select*fromtest1limit10";$key=md5;if){$conn=mysql_connect;mysql_select_db;$result=mysql_query;while){$arr=$row;}$f='mysql';$memcache->add,0,30);$data=$arr;}else{$f='memcache';$data_mem=$memcache->get;$data=unserialize;}echo$f;echo"
";echo"$key";echo"
";//print_r;foreach{echo"numberis$aid ";echo"
";echo"nameis$aname ";echo"
";}?>
(3)瀏覽器測(cè)試
(4)memcached上telnet測(cè)試
Tags:測(cè)試緩存,memcache緩存服務(wù)器
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。