我正在使用弹性来通过node.js连接到ElasticSearch。
在使用Nodetime分析我的应用程序以尝试提高性能的过程中,我注意到一些奇怪的事情。我的ElasticSearch“PUT”对_bulk索引的请求经常导致“套接字挂起”。此外,这些调用占用了大量的CPU时间。
我正在将每个_bulk索引请求@ 10个项目限制为索引,正如您所看到的,请求的内容长度甚至达不到50Kb,因此很难想象大小是个问题。然而,响应时间> 60秒,CPU时间> 10秒以上!让人惊讶!!
在尝试调试时,我开始在前台运行ElasticSearch。我注意到这个奇怪的错误:
[2013-02-27 11:42:39,188][WARN ][index.gateway.s3 ] [Lady Mandarin] [network][1] failed to read commit point [commit-f34]
java.io.IOException: Failed to get [commit-f34]
at org.elasticsearch.common.blobstore.support.AbstractBlobContainer.readBlobFully(AbstractBlobContainer.java:83)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.buildCommitPoints(BlobStoreIndexShardGateway.java:847)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.doSnapshot(BlobStoreIndexShardGateway.java:188)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.snapshot(BlobStoreIndexShardGateway.java:160)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:271)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:265)
at org.elasticsearch.index.engine.robin.RobinEngine.snapshot(RobinEngine.java:1090)
at org.elasticsearch.index.shard.service.InternalIndexShard.snapshot(InternalIndexShard.java:496)
at org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(IndexShardGatewayService.java:265)
at org.elasticsearch.index.gateway.IndexShardGatewayService$SnapshotRunnable.run(IndexShardGatewayService.java:366)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: Status Code: 404, AWS Service: Amazon S3, AWS Request ID: ..., AWS Error Code: NoSuchKey, AWS Error Message: The specified key does not exist., S3 Extended Request ID: ....
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:548)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:288)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:170)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2632)
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:811)
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:717)
at org.elasticsearch.cloud.aws.blobstore.AbstractS3BlobContainer$1.run(AbstractS3BlobContainer.java:73)
我知道我正在使用不推荐的网关(S3桶网关)。但是,鉴于我在Amazon Cloud上运行了多个需要共享数据的服务器(我使用ElasticSearch进行缓存),在ElasticSearch团队发布S3 Bucket Gateway的替代品之前,我没有看到任何替代方案......
除了_bulk调用的这个问题,我没有看到任何问题。搜索等都快速有效地返回。