我在Elasticsearch中有一个小型数据库,出于测试目的,我希望将所有记录拉回来.我试图使用表单的URL ...
http://localhost:9200/foo/_search?pretty=true&q={'matchAll':{''}}
Run Code Online (Sandbox Code Playgroud)
有人可以给我你用来完成这个的URL吗?
database bigdata query-string elasticsearch elasticsearch-dsl
最近,我需要实现一个程序,以尽可能快地将文件上传到Amazon EC2中的S3到S3.文件大小为30KB.
我尝试了一些解决方案,使用多线程,多处理,协同例程.以下是我在Amazon EC2上的性能测试结果.
3600(文件数量)*30K(文件大小)~~ 105M(总计)--->
**5.5s [ 4 process + 100 coroutine ]**
10s [ 200 coroutine ]
14s [ 10 threads ]
Run Code Online (Sandbox Code Playgroud)
代码如下所示
对于多线程
def mput(i, client, files):
for f in files:
if hash(f) % NTHREAD == i:
put(client, os.path.join(DATA_DIR, f))
def test_multithreading():
client = connect_to_s3_sevice()
files = os.listdir(DATA_DIR)
ths = [threading.Thread(target=mput, args=(i, client, files)) for i in range(NTHREAD)]
for th in ths:
th.daemon = True
th.start()
for th in ths:
th.join()
Run Code Online (Sandbox Code Playgroud)
对于协程
client = connect_to_s3_sevice()
pool = …Run Code Online (Sandbox Code Playgroud)