<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          redis-storageRedis的持久化存儲(chǔ)

          聯(lián)合創(chuàng)作 · 2023-10-01 01:07

          新增加字符串函數(shù)

          ds_append
          ds_incrby
          

          新增加類似redis的hashs功能,用法一樣

          ds_hdel
          ds_hget
          ds_hset
          ds_hmget
          ds_hmset
          ds_hincrby
          ds_hgetall
          

          redis-storage

          • 基于最新的redis-2.6.7開發(fā)的
          • 用luajit替換LUA,增強(qiáng)lua執(zhí)行性能
          • author: 七夜, shenzhe
          • QQ: 531020471
          • QQ群: 62116204(已滿)
          • QQ群: 154249567 (未滿)
          • mail: [email protected], [email protected]

          安裝 redis-storage

          https://github.com/qiye/redis-storage 獲取源碼
              
          make init
          make MALLOC=tcmalloc_minimal
          
          這一步需要root權(quán)限
          make install PREFIX=/usr/local/redis
          

          修改redis配置文件

          ds:create_if_missing 1                //if the specified database didn't exist will create a new one
          ds:error_if_exists 0                  //if the opened database exsits will throw exception
          ds:paranoid_checks 0
          ds:block_cache_size 10000
          ds:write_buffer_size 100000000       //寫緩存大小
          ds:block_size 4096
          ds:max_open_files 8000               //leveldb最多可以使用的檔案數(shù),一個(gè)檔案可以儲(chǔ)存 2MB 的資料。
          ds:block_restart_interval 16
          ds:path /usr/local/redis/db/leveldb  //leveldb save path
          

          redis new cmd 用法跟redis的一樣

          ds_append
          ds_incrby
          ds_hdel
          ds_hget
          ds_hset
          ds_hmget
          ds_hmset
          ds_hincrby
          ds_hgetall    
          ds_set name qiye
          ds_get name
          ds_del name 
          ds_mset key value age 20
          ds_mget key age
          ds_del key age
          rl_set name shenzhe  //先把數(shù)據(jù)存到leveldb,再存到redis
          rl_get name          //先嘗試從redis取數(shù)據(jù),如沒取到,再嘗試從redis取數(shù)據(jù)
          rl_del name          //先從leveldb刪除數(shù)據(jù),再從redis刪除數(shù)據(jù)
          

          cd php-hiredis/

          //php code 
          include "redis.php";
          $db = new redis("127.0.0.1", 6379);
          $rc = $db->connect();
          if(!$rc)
          {
             echo "can not connect redis server\r\n";
             exit;
          }  
          $data = $db->multi(array('DEL test', 'SET test 1', 'GET test'));
          print_r($data);
          echo $db->set("name", "qiye");
          echo $db->get("name");
          $db->ds_set("name", "qiye");
          $db->ds_set("age", "20");
          $data = $db->ds_mget( "name", "age");
          print_r($data);
          

          php開發(fā)者推薦使用 phpredis 加強(qiáng)版 專門針對(duì)redis-storage的php擴(kuò)展

          地址: https://github.com/shenzhe/phpredis

          $redis->dsSet("name", "shenzhe");                               //把數(shù)據(jù)存到leveldb
          $redis->dsGet("name");                                          //從leveldb取出數(shù)據(jù), 輸出 shenzhe
          $redis->dsMSet(array("daniu"=>"qiye","cainiao"=>"shenzhe"));    //批量把數(shù)據(jù)存到leveldb; keys結(jié)構(gòu) array("key1"=>"val1", "key2"=>"val2")       
          $redis->dsMGet(array("qiye", "cainiao"));                       //批量從leveldb取出數(shù)據(jù)
          $redis->dsDel("name");                                          //從leveldb刪除數(shù)據(jù), $key可以是字符串,也可是key的數(shù)組集合(相當(dāng)于批量刪除)
          $redis->dsDel(array("daniu","cainiao"));                        //從leveldb刪除數(shù)據(jù), $key可以是字符串,也可是key的數(shù)組集合(相當(dāng)于批量刪除)
          $redis->rlSet("name", "zeze");                                  //先把數(shù)據(jù)存到leveldb,再存到redis
          $redis->rlGet("name");
          $redis->get("name");
          $redis->dsGet("name");
          $redis->rlDel("name");
          
          

           

           

           

          瀏覽 13
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  【乱子伦】国产精品www | 欧美成人色图 | 九九九九影院 | 国产色婷婷AV | 国产伦精品一区二区三区免费下载 |