SPTAG使用

cmake安装

这个需要cmake>3.12.0,在安装完cmake3.13.5后(安装参考),执行 cmake --version会报错 /usr/bin/cmake: No such file or directory 按照网上那些方法执行什么命令根本没用,如果用的是Xshell在服务器上安装cmake,在安装完后,关闭Xshell,再打开,执行 cmake --version就不会报错了(参考)。cmake链接

TBB安装(最新的SPTAG已经移除了TBB

git clone https://github.com/wjakob/tbb.git
cd tbb/build
cmake ..
make -j
sudo make install

参考教程

swig安装 

主要参考,还可以看看这个

sudo apt-get install swig

boost安装

sudo apt-get install libboost-all-dev

查看版本 dpkg -S /usr/include/boost/version.hpp,默认安装的是boost1.67 所以要删除了重新安装,运行一下命令(参考):

sudo apt-get autoremove libboost-all-dev
sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt update
sudo apt install libboost1.67-dev

再次运行dpkg -S /usr/include/boost/version.hpp,版本显示1.67(安装时要运行 aptitude search boost 查看要下载的库)。

安装上述方法,在 cmake  SPATG时好像会报错,not find boost!

可以改用这个安装(这个也可以看下),

tar -xzvf boost_1_67_0.tar.gz
cd boost_1_67_0
sudo ./bootstrap.sh --prefix=/usr/local
sudo ./b2 install --with=all

调用测试代码可以通过,测试代码如下:

// #include<boost/lexical_cast.hpp>
// #include<iostream>
// #include<string>

// int main()
// {
	// using boost::lexical_cast;
	// int a=a=lexical_cast<int>("123");
	// double b=lexical_cast<double>("123.12");
	// std::cout<<a<<std::endl;
	// std::cout<<b<<std::endl;
	// return 0;
// }


// #include<string>
// #include<iostream>
// #include<boost>
// using namespace std;
// int main()
// {
	// boost::timer t;
	// cout<<"max timespan:"<<t.elapsed_max()/3600<<"h"<<endl;
	// cout<<"min timespan:"<<t.elapsed_min()<<"s"<<endl;
	// cout<<"now time elapsed:"<<t.elapsed_min()<<"s"<<endl;
	// cout<<"boost version:"<<BOOST_VERSION<<endl;
	// cout<<"boost lib version:"<<BOOST_LIB_VERSION<<endl;
	// return 0;
// }

#include<boost/version.hpp>
#include<boost/config.hpp>
#include<boost/lexical_cast.hpp>
#include<iostream>

using namespace std;
int main()
{
	using boost::lexical_cast;
	int a=a=lexical_cast<int>("123456");
	double b=lexical_cast<double>("123.4567");
	std::cout<<a<<std::endl;
	std::cout<<b<<std::endl;
	cout<<"boost version:"<<BOOST_VERSION<<endl;
	cout<<"boost lib version:"<<BOOST_LIB_VERSION<<endl;
	return 0;
}
g++ -o example example.cpp
./example

但是在cmake SPATG时还是报错,

file STRINGS file "/usr/include/boost/version.hpp" cannot be read. 

Could NOT find Boost

其实时SPTAG/build 下CMakeCache.txt里的Boost_INCLUDE_DIR:PATH路径有问题,将该路径改为boost安装的路径,(这是在服务器上安装出现的错误,本地ubuntu没这些错误

初始为:Boost_INCLUDE_DIR:PATH=usr/include  ,现为:Boost_INCLUDE_DIR:PATH=/usr/local/include ,之后就可以cmake成功。运行官方的python例程(这是python3的代码,之前直接在py2下运行的,会报错。还需要安装numpy,直接 sudo apt-get install python3-scipy ,它会附带安装numpy)

# encoding: utf-8
import sys
sys.path.append('SPTAG/Release/')
import SPTAG
import numpy as np
import time
nr = 1024*100
nc = 512
k = 3
r = 2000


def testBuild(algo, distmethod, x, out):  # 'BKT' 'L2' (100,10) 'testindices' 是保存数据的路径
    i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])  # 参数: 索引构建方法 数据类型 大小10 -> 初始化索引
    i.SetBuildParam("NumberOfThreads", '4')  # 设置线程数
    i.SetBuildParam("DistCalcMethod", distmethod)  # 设置距离计算方法
    ret = i.Build(x.tobytes(), x.shape[0])  # 数据转为bytes型便于保存  100 开始用BKT方法 构建数据
    i.Save(out)  # 保存向量到testindices/vectors.bin中


def testBuildWithMetaData(algo, distmethod, x, s, out):
    i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
    i.SetBuildParam("NumberOfThreads", '4')
    i.SetBuildParam("DistCalcMethod", distmethod)
    if i.BuildWithMetaData(x.tobytes(), s, x.shape[0]):  # 给x数据创建 元数据
        i.Save(out)


def testSearch(index, q, k):  # 'testindices'数据路径  q是要查询的向量,大小为(3,10) k是3 是取相似度最高的前k个
    j = SPTAG.AnnIndex.Load(index)  # 加载数据库中的数据
    for t in range(q.shape[0]):
        result = j.Search(q[t].tobytes(), k)  #依次取向量转为bytes类型 再计算相似度
        print (result[0])  # ids  查询到的k个数据库中的索引
        print (result[1])  # distances  # 距离 该数据q[t] 与数据库中的被检索出来的数据距离,即相似度


def testSearchWithMetaData(index, q, k):
    j = SPTAG.AnnIndex.Load(index)
    j.SetSearchParam("MaxCheck", '1024')  # 设置搜索参数
    for t in range(q.shape[0]):
        result = j.SearchWithMetaData(q[t].tobytes(), k)
        print (result[0])  # ids  # 索引
        print (result[1])  # distances  #距离值
        print (result[2])  # metadata  # 元数据


def testAdd(index, x, out, algo, distmethod):  # index ='testindices' x=要添加的数据 out = 'testindices' algo = 'BKT' distmethod =距离计算方法
    if index != None:  # 存在就加载
        i = SPTAG.AnnIndex.Load(index)
    else:  # 否则 创建
        i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
    i.SetBuildParam("NumberOfThreads", '4')
    i.SetBuildParam("DistCalcMethod", distmethod)
    if i.Add(x.tobytes(), x.shape[0]):
        i.Save(out)


def testAddWithMetaData(index, x, s, out, algo, distmethod):
    if index != None:
        i = SPTAG.AnnIndex.Load(index)
    else:
        i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
    i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
    i.SetBuildParam("NumberOfThreads", '4')
    i.SetBuildParam("DistCalcMethod", distmethod)
    if i.AddWithMetaData(x.tobytes(), s, x.shape[0]):  # s ?? 添加元数据 成功就保存
        i.Save(out)


def testDelete(index, x, out):
    i = SPTAG.AnnIndex.Load(index)  # 加载数据
    ret = i.Delete(x.tobytes(), x.shape[0])  # 删除已存在的数据  删除成功返回True 否则False
    print (ret) # True
    i.Save(out)


def Test(algo, distmethod):
    x = np.ones((nr, nc), dtype=np.float32) * np.reshape(np.arange(nr, dtype=np.float32), (nr, 1))  # n= 100  (100, 10)
    q = np.ones((r, nc), dtype=np.float32) * np.reshape(np.arange(r, dtype=np.float32), (r, 1)) * 2  # r =3  (3, 10)
    m = ''
    for i in range(nr):
        m += str(i) + '\n'

    print ("Build.............................")
    start = time.time()
    # testBuild(algo, distmethod, x, 'testindices')  # 创建
    print ('创建数据耗时{0}秒'.format(time.time()-start))
    testSearch('testindices', q, k)  # 检索
    print ('查询数据耗时{0}秒'.format((time.time() - start)/np.float(q.shape[0])))
    # print ("Add.............................")
    # testAdd('testindices', x, 'testindices', algo, distmethod)  # 添加新的数据到数据库中
    # testSearch('testindices', q, k)  # 再检索一次
    # print ("Delete.............................")
    # testDelete('testindices', q, 'testindices')  # 删除数据
    # testSearch('testindices', q, k)  # 再检索一次
    #
    # print ("AddWithMetaData.............................")  # 与元数据添加
    # testAddWithMetaData(None, x, m, 'testindices', algo, distmethod)
    # print ("Delete.............................")
    # testSearchWithMetaData('testindices', q, k)  # 元数据检索
    # testDelete('testindices', q, 'testindices')  # 元数据删除
    # testSearchWithMetaData('testindices', q, k)


if __name__ == '__main__':
    Test('BKT', 'L2')
    # Test('KDT', 'L2')

代码中的 “testindices”要设置成 保存文件的路径如 “SPATG/”,系统会将文件都保存在"SPATG"文件夹下。(在本地ubuntu上运行这些代码一直在报 SPTAG  no  module AnnIndex,后来我在conda的base环境下重新cmake SPTAG就可以正常运行了

构建数据:102400*512,查询数据2000*512,K=3

KDT:创建数据耗时2247.867159128189秒,查询数据耗时1.124292714238167秒

BKT:创建数据耗时2534.128696203232秒,查询数据耗时1.268352787733078秒

KDTree :128线程
Save Data To myindex/vectors.bin
Save Data (1000000, 128) Finish!
Save KDT to myindex/tree.bin
Save KDT (1,1000000) Finish!
Save Graph To myindex/graph.bin
Save Graph (1000000,32) Finish!

创建数据耗时3493.8171892166138秒

Load Data From myindex/vectors.bin
Load Data (1000000, 128) Finish!
Load KDT From myindex/tree.bin
Load KDT (1,1000000) Finish!
Load Graph From myindex/graph.bin
Load Graph (1000000,32) Finish!


recall:0.8739530000000001
GIST数据集:

BKT:
256线程,其他默认参数。
创建数据耗时14077.96779036522秒
查询数据耗时14.11538189458847秒(时间有问题)
recall: 0.34816
recall: 0.91405(SPTAG代码中recall的计算方法)

之前结果丢失,900线程,其他默认参数,结果:
创建数据耗时14850.682217359543秒
查询数据耗时35.2056519985199秒
查询数据耗时36.19594359397888秒
recall: 0.91336

创建数据耗时14909.241540193558秒
查询数据耗时35.11083245277405秒
查询数据耗时35.785308599472046秒
recall: 0.9133499999999999

--------------------------------------------------------------

GIST:

i.SetBuildParam("TPTNumber", '42')
i.SetBuildParam("NeighborhoodSize", '42')
i.SetBuildParam("GraphNeighborhoodScale", '3')
i.SetBuildParam("TPTLeafSize", '3000')

BKT:
python3 -u testSPTAG.py > myindex_n/gist/BKT_711.log

Setting NumberOfThreads with value 300
Setting DistCalcMethod with value L2
Setting TPTNumber with value 42
Setting NeighborhoodSize with value 42
Setting GraphNeighborhoodScale with value 3
Setting TPTLeafSize with value 3000
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 42
Setting TPTLeafSize with value 3000
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 42
Setting GraphNeighborhoodScale with value 3
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 1000
Setting MaxCheckForRefineGraph with value 10000
Setting NumberOfThreads with value 300
Setting DistCalcMethod with value L2
Setting MaxCheck with value 8192
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4

Refine 1 99%Refine RNG, graph acc:0.934048
Refine 2 99%Refine RNG, graph acc:0.924524

创建数据耗时20562.084409713745秒

--------------查询数据耗时20.597515137672424秒(错误时间)
查询数据耗时40.8932363986969秒
查询数据耗时35.08208656311035秒(去掉print后的时间)
查询数据耗时34.4913489818573秒
recall: 0.39094999999999996(一一对应计算recall)
recall: 0.92669(SPTAG代码中recall的计算方法)


--------------------------------------------------------------------------
第三次:
修改参数:
BKT——712

Setting NumberOfThreads with value 512
Setting DistCalcMethod with value L2
Setting TPTNumber with value 24
Setting TPTLeafSize with value 1600
Setting CEF with value 800
Setting MaxCheckForRefineGraph with value 8000
Setting MaxCheck with value 2048
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 24
Setting TPTLeafSize with value 1600
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 32
Setting GraphNeighborhoodScale with value 2
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 800
Setting MaxCheckForRefineGraph with value 8000
Setting NumberOfThreads with value 512
Setting DistCalcMethod with value L2
Setting MaxCheck with value 2048
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4

创建数据耗时12495.288645029068秒
查询数据耗时14.727818250656128秒
recall: 0.74628

----------------------------------------------------------------------------
第四次:
修改参数:
python3 -u testSPTAG.py > gist-960/t4/BKT_712p.log

Setting NumberOfThreads with value 640
Setting DistCalcMethod with value L2
Setting TPTLeafSize with value 1600
Setting CEF with value 800
Setting MaxCheckForRefineGraph with value 8000
Setting MaxCheck with value 4096
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 32
Setting TPTLeafSize with value 1600
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 32
Setting GraphNeighborhoodScale with value 2
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 800
Setting MaxCheckForRefineGraph with value 8000
Setting NumberOfThreads with value 640
Setting DistCalcMethod with value L2
Setting MaxCheck with value 4096
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4

创建数据耗时12675.733166456223秒
查询数据耗时22.02064800262451秒
查询数据耗时21.70394778251648秒
recall: 0.8436499999999999


--------------------------------------------------------------------
t11:
256线程 (256线程时CPU占用率到了100%)

Setting NumberOfThreads with value 256
Setting DistCalcMethod with value L2
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 32
Setting TPTLeafSize with value 2000
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 32
Setting GraphNeighborhoodScale with value 2
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 1000
Setting MaxCheckForRefineGraph with value 10000
Setting NumberOfThreads with value 256
Setting DistCalcMethod with value L2
Setting MaxCheck with value 8192
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4


Refine 1 99%Refine RNG, graph acc:0.851562
Refine 2 99%Refine RNG, graph acc:0.879687

创建数据耗时13968.658571720123秒
database耗时4.686297655105591秒
查询数据耗时28.258972883224487秒
查询数据耗时33.27275586128235秒



-----------------------------------------------------------------
32线程,默认参数,t12

Setting NumberOfThreads with value 32
Setting DistCalcMethod with value L2
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 32
Setting TPTLeafSize with value 2000
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 32
Setting GraphNeighborhoodScale with value 2
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 1000
Setting MaxCheckForRefineGraph with value 10000
Setting NumberOfThreads with value 32
Setting DistCalcMethod with value L2
Setting MaxCheck with value 8192
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4

创建数据耗时18325.260933876038秒
database耗时4.160557746887207秒
查询数据耗时28.758930683135986秒
查询数据耗时33.35309648513794秒

--对比发现,多线程确实可以加快构建线程,但是 查询 时好像并没有使用多线程。
GIST 添加数据实验:
---------------------------第一次------------------

查询数据耗时26.89997410774231秒

Add 100 vectors
添加数据耗时22.28112268447876秒

查询数据耗时26.064087867736816秒

###########################################
本地ubuntu添加100个,线程:32
database耗时2.0176961421966553秒
查询数据耗时9.54246187210083秒
查询数据耗时11.745713233947754秒

Add 100 vectors
添加数据耗时40.80331540107727秒

database耗时2.438168525695801秒
查询数据耗时9.520179271697998秒
查询数据耗时12.144131183624268秒


------------------------------第二次-----------------------------

查询数据耗时22.73684072494507秒

Add 100 vectors
添加数据耗时20.265065908432007秒

查询数据耗时21.07742190361023秒

执行10次  Add 100 vectors
添加10次数据耗时211.38123202323914秒

查询数据耗时21.00323247909546秒

--------------------------------------第三次--------------------------

查询数据耗时22.82960319519043秒

一次Add 1000 vectors
添加数据耗时84.80395412445068秒

查询数据耗时24.744037628173828秒

---------------------------------------------第四次---------------------------

查询数据耗时25.854535579681396秒

执行1000次 Add 1 vectors
添加1000次数据耗时15438.033593893051秒

查询数据耗时21.35831570625305秒
239----t0:
Setting TreeFilePath with value tree.bin
Setting GraphFilePath with value graph.bin
Setting VectorFilePath with value vectors.bin
Setting BKTNumber with value 1
Setting BKTKmeansK with value 32
Setting BKTLeafSize with value 8
Setting Samples with value 1000
Setting TPTNumber with value 50
Setting TPTLeafSize with value 3200
Setting NumTopDimensionTpTreeSplit with value 5
Setting NeighborhoodSize with value 50
Setting GraphNeighborhoodScale with value 2
Setting GraphCEFScale with value 2
Setting RefineIterations with value 0
Setting CEF with value 1600
Setting MaxCheckForRefineGraph with value 10000
Setting NumberOfThreads with value 32
Setting DistCalcMethod with value L2
Setting MaxCheck with value 8192
Setting ThresholdOfNumberOfContinuousNoBetterPropagation with value 3
Setting NumberOfInitialDynamicPivots with value 50
Setting NumberOfOtherDynamicPivots with value 4
Load Data From gist-960/t13/vectors.bin
Load Data (1000000, 960) Finish!
Load BKT From gist-960/t13/tree.bin
Load BKT (1,1000001) Finish!
Load Graph From gist-960/t13/graph.bin
Load Graph (1000000,50) Finish!
Setting NumberOfThreads with value 32

database耗时4.281400442123413秒
查询数据耗时29.525420904159546秒
查询数据耗时34.07398343086243秒
recall: 0.92415

本地ubuntu测试:
database耗时2.0198240280151367秒
查询数据耗时17.271716833114624秒
查询数据耗时19.476648330688477秒
---------------------------------------------------------

maxcheck:6144
查询数据耗时23.14988398551941秒
查询数据耗时27.59205961227417秒
recall: 0.9013800000000001

本地ubuntu测试:
database耗时2.056483745574951秒
查询数据耗时13.571018695831299秒
查询数据耗时15.814354419708252秒
---------------------------------------------------------

maxcheck:4096
查询数据耗时16.181601524353027秒
查询数据耗时20.62385058403015秒
recall: 0.8517

本地ubuntu测试:
database耗时1.9952189922332764秒
查询数据耗时9.548259496688843秒
查询数据耗时11.731146097183228秒
---------------------------------------------------------

maxcheck:2048
查询数据耗时11.60619831085205秒
查询数据耗时16.01752018928528秒
recall: 0.79156

本地ubuntu测试:
database耗时2.003782272338867秒
查询数据耗时6.894217252731323秒
查询数据耗时9.086815595626831秒
---------------------------------------------------------
maxcheck:1024
查询数据耗时11.429534196853638秒
查询数据耗时15.87088418006897秒
recall: 0.7882399999999999

本地ubuntu测试:
database耗时2.022035598754883秒
查询数据耗时6.837755918502808秒
查询数据耗时9.045774936676025秒

 

NSG

安装Ubuntu

主要参考,其中easyBCD不能在改UEFI的启动顺序了,所以直接用ubuntu引导win 10 算了。ubuntu安装anaconda,(在服务器上安装后,需要重新启动才生效),给unbuntu扩容主要参考,但是激活swap没那么麻烦,在调整顺序后,点击‘apply’,然后直接右键‘swap’,点击‘swapon’就可以正常启动了。

启动pycharm 

22527----------sda6 /
8192-----------sda7 swap
299------------sda8 /boot
97828----------sda9 /home
在服务器上创建子用户,并分配权限

sudo adduser  XXXXX(之后会设置密码)

分配权限:


为sudoers增加写入权限

sudo chmod +w /etc/sudoers
sudo vim /etc/sudoers

为用户XXX添加读写权限
xxxxx ALL=(ALL:ALL) ALL  (在  root ALL=(ALL:ALL) ALL  后面添加)

保存退出:按“Esc”键后 此时的“插入”会消失,然后按Shift+zz 就可以保存修改内容并退出

将sudoers文件的操作权限改为只读模式
sudo chmod -w /etc/sudoers


从服务器上下载文件:(是直接在本地的命令行输入,不是在putty上)

scp -r -P 22222 username@ipaddr:gist-960/t11 gist

 本地ubuntu测试(在服务器上测试不理想,CPU被其他人占满了)

t11:
--------------------------------------------------
Setting NumberOfThreads with value 32
Setting MaxCheck with value 1024
database耗时31.402881145477295秒
查询数据耗时5.490655899047852秒
查询数据耗时37.08037209510803秒
recall: 0.74307


Setting NumberOfThreads with value 32
Setting MaxCheck with value 2048
database耗时2.3771233558654785秒
查询数据耗时5.691030263900757秒
查询数据耗时8.256487607955933秒
recall: 0.75055


Setting NumberOfThreads with value 32
Setting MaxCheck with value 4096
database耗时2.270341634750366秒
查询数据耗时9.497120380401611秒
查询数据耗时11.955175876617432秒
recall: 0.8462900000000001


Setting NumberOfThreads with value 32
Setting MaxCheck with value 8192
database耗时2.2741241455078125秒
查询数据耗时17.112168550491333秒
查询数据耗时19.573345184326172秒
recall: 0.91269
tc
-----------------------------------
Setting NumberOfThreads with value 32
Setting MaxCheck with value 1024
database耗时2.3292434215545654秒
查询数据耗时6.251153945922852秒
查询数据耗时8.768885135650635秒
recall:

Setting NumberOfThreads with value 32
Setting MaxCheck with value 2048
database耗时2.3469979763031006秒
查询数据耗时6.4437408447265625秒
查询数据耗时8.979516506195068秒
recall:


Setting NumberOfThreads with value 32
Setting MaxCheck with value 4096
database耗时4.751710891723633秒
查询数据耗时9.482785701751709秒
查询数据耗时14.422292947769165秒
recall:


Setting NumberOfThreads with value 32
Setting MaxCheck with value 8192
database耗时3.150296211242676秒
查询数据耗时17.375805616378784秒
查询数据耗时20.712931632995605秒
recall:
在xshell中让代码在服务器后台运行:

nohup python3 -u testSPTAG.py > gist-960/t13/pra.log &


之后会显示它的进程编号:XXXX,要杀死进程:

kill -9 xxxx

查看进程:

jobs -l
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值