Comments (12)
I believe it is because of the keepAlive: false
in your config. This is going to cause new connections to be created for each request, I suggest using keepAlive
.
from elasticsearch-js.
Nope, I initially tried it with standard configuration. No difference with any keepAlive
setting.
client = new elasticsearch.Client({
host: 'localhost:9200',
});
from elasticsearch-js.
Using the bulk works pretty well.
from elasticsearch-js.
Yes, that's certainly a good idea if you have access to multiple requests at a time.
I'm almost certain that EADDRNOTAVAIL
is directly related to opening and closing tcp sockets, but if you are not modifying the keepAlive/maxSockets/minSockets config then it should be opening 10 sockets and keeping them alive, no more, no less. As I walk through the forever-agent
module I'm not sure that is the case. Do you have a script you can share that reproduces this?
from elasticsearch-js.
This small code does the job
var elasticsearch = require('elasticsearch'),
async = require('async'),
_ = require('underscore'),
client;
client = new elasticsearch.Client({
host: 'localhost:9200'
});
async.eachSeries(_.range(20000), function (value, done) {
client.create({index: 'tests', type: 'test', body: {something: true, value: value}}, done);
});
from elasticsearch-js.
alright, I found the problem and submitted request/forever-agent#16. Working on a solution for the meantime.
from elasticsearch-js.
Version 1.5.10 includes a fix that should force forever-agent to use the connection pool for all requests. If you have time to confirm I would appreciate it.
from elasticsearch-js.
I'm using 1.5.11 and I'm still getting this error. Did it get reintroduced?
from elasticsearch-js.
Well, this is embarrassing. It looks like I didn't test the solution I committed and it didn't actually do what I thought it did, sorry about that.
Using @Nomeasmo's script I was able to reproduce the issue and create a verified fix. Creating a test case for this that can run automatically is pretty tricky, but it is on my todo list.
@smithatlanta or @Nomeasmo if either of you have time to verify that things are working for you too, I would really appreciate it.
https://gist.github.com/spenceralger/9550110
from elasticsearch-js.
That solved my issue. Loaded 1/4 of a million items with no issues. Thanks.
from elasticsearch-js.
Glad to hear.
from elasticsearch-js.
@spalger I am facing the exact same issue running OSX 10.10.2 , node v0.12.7, and ES 1.6.0
I am able to replicate the issue using the sample code from @Nomeasmo above. Could this issue needs to be resolved differently in 0.12 given the different http pooling?
from elasticsearch-js.
Related Issues (20)
- Connection pool size HOT 1
- Support Cloudflare Workers / Vercel Edge Functions HOT 3
- The query attribute on the `EnrichPolicy` should be `QueryDslQueryContainer | QueryDslQueryContainer[]` not `string` HOT 3
- Bulk helper not giving indications on failure when using stream as datasource HOT 1
- Number of open connections spikes when retryable errors occur HOT 4
- Deno: Module '"npm:@elastic/elasticsearch"' has no exported member 'CatIndicesIndicesRecord'. HOT 1
- Internal module error HOT 1
- bulk helper add onSuccess callback HOT 3
- Content-Type header being changed to "text/plain" from "application/json" somewhere in the process of publishing a document to self-hosted Elasticsearch HOT 5
- Global client context not passed to Transport in 7.13.0 HOT 1
- Support for ES|QL HOT 2
- enum and/or type guard for QueryDslTextQueryType HOT 1
- search_after with sort on nested fields HOT 1
- Redaction mechanism transform arrays properties into objects HOT 1
- Nuxt 3 compatibility HOT 1
- Using the `[]` chars for an enrich policy name isn't wrapped correctly on `deletePolicy` method HOT 1
- ProductNotSupportedError: The client noticed that the server is not a supported distribution of Elasticsearch HOT 1
- Add types for plugins HOT 2
- Error parsing undici module in Next.js 14 project HOT 3
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 product-check listeners added HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-js.