NodeJS request timeouts with concurrency 100 - node.js
I have two machines, one "server" and one "client". Both are CentOS6 with NodeJS v5.8.0.
The server runs the following program:
const AppPort = 8080;
var app = require('express')();
var logger = require('log4js').getLogger();
var onFinished = require('on-finished');
var uid = require('uid');
var reqCnt = 0;
var reqFin = 0;
app.get('/', function(req, res) {
onFinished(req, function() {
reqFin++;
var ts2 = (new Date()).getTime();
logger.info(`uid=${req.uid}, dt=${ts2-req.ts1}`);
});
req.ts1 = (new Date()).getTime();
req.uid = uid();
reqCnt++;
logger.info(`ReqCnt=${reqCnt}, fins=${reqFin}`);
res.send("This is XML");
});
app.listen(AppPort);
It's only purpose to return "This is XML" string and calculate time of fulfilling the request.
On the "client" machine I run the following program:
const AppPort = 10000;
var onFinished = require('on-finished');
var async = require('async');
var request = require('request');
var logger = require('log4js').getLogger();
var app = require('express')();
var fs = require('fs');
var util = require('util');
url = "http://my-server";
var errCnt = 0;
var okCnt = 0;
var active2 = 0;
setInterval(function() {
var errFrac = Math.floor(errCnt/(okCnt+errCnt)*100);
logger.info(`${okCnt},${errCnt},${active2},${errFrac}`);
}, 1000);
app.get('/test', function(req,res) {
onFinished(res, function() {
active2--;
});
active2++;
var ts1 = (new Date()).getTime();
request(url, {timeout: 1000}, function(err, response, body ) {
var ts2 = (new Date()).getTime();
var dt = ts2-ts1;
if ( err ) {
errCnt += 1;
logger.error(`Error: ${err}, dt=${dt}, errCnt=${errCnt}`);
res.send(`Error: ${err}`);
}
else {
okCnt += 1;
logger.info(`OK: ${url}`);
res.send(`OK: ${body}`);
}
});
});
var http = app.listen(AppPort);
logger.info(`Listening on ${AppPort}, pid=${process.pid}`);
This "client" code listens by itself on port 10000 and makes request to "server" machine to get "This is XML" string. This data is transferred back to "client"'s client.
I load-test my client code with siege:
siege -v -r 100 -c 100 http://my-client:10000/test
Almost immediately I start to get ETIMEOUT errors:
[2016-03-15 18:17:05.155] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1028, errCnt=3
[2016-03-15 18:17:05.156] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1028, errCnt=4
[2016-03-15 18:17:05.156] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1027, errCnt=5
[2016-03-15 18:17:05.157] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1027, errCnt=6
[2016-03-15 18:17:05.157] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1027, errCnt=7
[2016-03-15 18:17:05.157] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1027, errCnt=8
[2016-03-15 18:17:05.158] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1027, errCnt=9
[2016-03-15 18:17:05.160] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1029, errCnt=10
[2016-03-15 18:17:05.160] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1028, errCnt=11
[2016-03-15 18:17:05.161] [ERROR] [default] - Error: Error: ETIMEDOUT, dt=1028, errCnt=12
Also, though much less frequently, getaddrinfo errors appear:
Error: Error: getaddrinfo ENOTFOUND {my-server-domain-here}:8080, dt=2, errCnt=4478
However, all requests to the "server" are processed within less then 3 milliseconds (dt values) on the server itself:
[2016-03-15 18:19:13.847] [INFO] [default] - uid=66ohx90, dt=1
[2016-03-15 18:19:13.862] [INFO] [default] - ReqCnt=5632, fins=5631
[2016-03-15 18:19:13.862] [INFO] [default] - uid=j8mpxdm, dt=0
[2016-03-15 18:19:13.865] [INFO] [default] - ReqCnt=5633, fins=5632
[2016-03-15 18:19:13.866] [INFO] [default] - uid=xcetqyj, dt=1
[2016-03-15 18:19:13.877] [INFO] [default] - ReqCnt=5634, fins=5633
[2016-03-15 18:19:13.877] [INFO] [default] - uid=i5qnbit, dt=0
[2016-03-15 18:19:13.895] [INFO] [default] - ReqCnt=5635, fins=5634
[2016-03-15 18:19:13.895] [INFO] [default] - uid=hpdmxpg, dt=1
[2016-03-15 18:19:13.930] [INFO] [default] - ReqCnt=5636, fins=5635
[2016-03-15 18:19:13.930] [INFO] [default] - uid=8g3t8md, dt=0
[2016-03-15 18:19:13.934] [INFO] [default] - ReqCnt=5637, fins=5636
[2016-03-15 18:19:13.934] [INFO] [default] - uid=8rwkad6, dt=0
[2016-03-15 18:19:14.163] [INFO] [default] - ReqCnt=5638, fins=5637
[2016-03-15 18:19:14.165] [INFO] [default] - uid=1sh2frd, dt=2
[2016-03-15 18:19:14.169] [INFO] [default] - ReqCnt=5639, fins=5638
[2016-03-15 18:19:14.170] [INFO] [default] - uid=comn76k, dt=1
[2016-03-15 18:19:14.174] [INFO] [default] - ReqCnt=5640, fins=5639
[2016-03-15 18:19:14.174] [INFO] [default] - uid=gj9e0fm, dt=0
[2016-03-15 18:19:14.693] [INFO] [default] - ReqCnt=5641, fins=5640
[2016-03-15 18:19:14.693] [INFO] [default] - uid=x0yw66n, dt=0
[2016-03-15 18:19:14.713] [INFO] [default] - ReqCnt=5642, fins=5641
[2016-03-15 18:19:14.714] [INFO] [default] - uid=e2cumjv, dt=1
[2016-03-15 18:19:14.734] [INFO] [default] - ReqCnt=5643, fins=5642
[2016-03-15 18:19:14.735] [INFO] [default] - uid=34e0ohl, dt=1
[2016-03-15 18:19:14.747] [INFO] [default] - ReqCnt=5644, fins=5643
[2016-03-15 18:19:14.749] [INFO] [default] - uid=34aau79, dt=2
So, the problem is not that the "server" processes the requests too long, but there is a problem with the client.
In NodeJS 5.8 globalAgent looks like the following:
console.log(require('http.globalAgent'))
Agent {
domain: null,
_events: { free: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: { path: null },
requests: {},
sockets: {},
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256 }
ulimits on my system look like:
root#njs testreq]# ulimit -all
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 128211
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 200000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 128211
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
What can be a reason for the timeouts?
When running a few load tests recently I ran into a similar error, however instead of ETIMEDOUT errors I saw multiple EADDRINUSE errors. At the time I was running the tests with the following HTTP agent configuration changes.
{
maxSockets: 256,
keepAlive: false
}
It turns out this configuration wastes a lot of cycles intentionally closing each connection after a single request, and the EADDRINUSE errors were due to running out of ephemeral ports.
For my tests I was still using version 0.12.9 so I'm not sure if this still holds in versions >= 4.x, but the core HTTP library will automatically maintain connections to servers based on the host/port/protocol when possible. This can greatly reduce the load on the client and server, but can also cause requests to build up if the client pool is too small to handle the rate of outbound requests. The best configuration then is one that will keep alive connections whenever possible, but still has a large enough connection pool to quickly handle each outbound request.
Additionally, Node.js is built on top of libuv which implements the event loop interface. One way or another, almost any asynchronous operation implemented by a core Node.js library will interact with libuv. In order to implement this type of interface libuv will use one of several different policies, one of which is a thread pool. The default size of this thread pool is 4, with a max of 128.
The important point here is that any calls to getaddrinfo and getnameinfo will use the thread pool, which means regardless of the size of your HTTP connection pool, DNS queries and some operations lower in the network stack will be serialized based on the thread pool size. It's possible to change the thread pool size by setting the environment variable UV_THREADPOOL_SIZE to a value in the range 4 - 128.
For my tests the ideal settings were UV_THREADPOOL_SIZE=50 with the following HTTP agent configuration.
{
maxSockets: 256,
keepAlive: true
}
This answer has more info on when and how libuv is used.
Related
How could I handle the Err of TLS certificate with fabric-sdk-node
I'm trying to build a web front end of a fabric-network, and after I completed the registerAdmin and registerUser, I got err when I was tring to run my js code. root#oyu-virtual-machine:~/hyperledger-fabric/test/webapp# node get.js Load privateKey and signedCert Get History Assigning transaction_id: 35e9ed932366df66448d789fbf5989e6ba31be555f96eaca3197475a1602749c E0429 15:09:28.130483373 4413 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed. returned from gethistory Gethistory result count = 1 error from gethistory = Error: 14 UNAVAILABLE: failed to connect to all addresses at Object.exports.createStatusError (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/common.js:91:15) at Object.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:1209:28) at InterceptingListener._callNext (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:568:42) at InterceptingListener.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:618:8) at callback (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:847:24) { code: 14, metadata: Metadata { _internal_repr: {}, flags: 0 }, details: 'failed to connect to all addresses' } Response is Error: 14 UNAVAILABLE: failed to connect to all addresses In my opinion, the most important message is E0429 15:09:28.130483373 4413 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed. It's not generated by my code, but system generated it. I do hope someone could help me. Thanks in advance.
SBT shell project in terminal gives error
i am a beginner at scala programming language. i read sbt documentation and implement these in sbt shell but it gives error. how to resolve it? .................... ThisBuild / scalaVersion := "2.13.0" ThisBuild / organization := "com.example" val scalaTest = "org.scalatest" %% "scalatest" % "3.2.7" val gigahorse = "com.eed3si9n" %% "gigahorse-okhttp" % "0.5.0" val playJson = "com.typesafe.play" %% "play-json" % "2.6.9" lazy val hello = (project in file(".")) .aggregate(helloCore) .dependsOn(helloCore) .settings( name := "Hello", libraryDependencies += scalaTest % Test, ) lazy val helloCore = (project in file("core")) .settings( name := "Hello Core", libraryDependencies ++= Seq(gigahorse, playJson), libraryDependencies += scalaTest % Test, ) ...............................the above is my build.sbt file............... package example.core import gigahorse._, support.okhttp.Gigahorse import scala.concurrent._, duration._ import play.api.libs.json._ object Weather { lazy val http = Gigahorse.http(Gigahorse.config) def weather: Future[String] = { val baseUrl = "https://www.metaweather.com/api/location" val locUrl = baseUrl + "/search/" val weatherUrl = baseUrl + "/%s/" val rLoc = Gigahorse.url(locUrl).get. addQueryString("query" -> "New York") import ExecutionContext.Implicits.global for { loc <- http.run(rLoc, parse) woeid = (loc \ 0 \ "woeid").get rWeather = Gigahorse.url(weatherUrl format woeid).get weather <- http.run(rWeather, parse) } yield (weather \\ "weather_state_name")(0).as[String].toLowerCase } private def parse = Gigahorse.asString andThen Json.parse } ...........................................hello.scala.................... package example import scala.concurrent._, duration._ import core.Weather object Hello extends App { val w = Await.result(Weather.weather, 10.seconds) println(s"Hello! The weather in New York is $w.") Weather.http.close() } error: mehveen#mehveen-Y11C:~$ cd foo-build mehveen#mehveen-Y11C:~/foo-build$ touch build.sbt mehveen#mehveen-Y11C:~/foo-build$ sbt [info] Loading global plugins from /home/mehveen/.sbt/1.0/plugins [info] Loading settings for project foo-build-build from plugins.sbt ... [info] Loading project definition from /home/mehveen/foo-build/project [info] Loading settings for project hello from build.sbt ... [info] Set current project to Hello (in build file:/home/mehveen/foo-build/) [info] sbt server started at local:///home/mehveen/.sbt/1.0/server/704a39d101f4d89588ee/sock sbt:Hello> run [info] Updating helloCore... [warn] module not found: com.typesafe.play#play-json_2.13;2.6.9 [warn] ==== local: tried [warn] /home/mehveen/.ivy2/local/com.typesafe.play/play-json_2.13/2.6.9/ivys/ivy.xml [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/com/typesafe/play/play-json_2.13/2.6.9/play-json_2.13-2.6.9.pom [warn] ==== local-preloaded-ivy: tried [warn] /home/mehveen/.sbt/preloaded/com.typesafe.play/play-json_2.13/2.6.9/ivys/ivy.xml [warn] ==== local-preloaded: tried [warn] file:////home/mehveen/.sbt/preloaded/com/typesafe/play/play-json_2.13/2.6.9/play-json_2.13-2.6.9.pom [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.typesafe.play#play-json_2.13;2.6.9: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Unresolved dependencies path: [warn] com.typesafe.play:play-json_2.13:2.6.9 (/home/mehveen/foo-build/build.sbt#L19) [warn] +- com.example:hello-core_2.13:0.1.0-SNAPSHOT [error] sbt.librarymanagement.ResolveException: unresolved dependency: com.typesafe.play#play-json_2.13;2.6.9: not found [error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332) [error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208) [error] at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239) [error] at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204) [error] at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70) [error] at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77) [error] at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95) [error] at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80) [error] at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99) [error] at xsbt.boot.Using$.withResource(Using.scala:10) [error] at xsbt.boot.Using$.apply(Using.scala:9) [error] at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60) [error] at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50) [error] at xsbt.boot.Locks$.apply0(Locks.scala:31) [error] at xsbt.boot.Locks$.apply(Locks.scala:28) [error] at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77) [error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199) [error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196) [error] at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:238) [error] at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193) [error] at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20) [error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56) [error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:45) [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93) [error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68) [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106) [error] at scala.util.control.Exception$Catch.apply(Exception.scala:224) [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106) [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89) [error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149) [error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120) [error] at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2561) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40) [error] at sbt.std.Transform$$anon$4.work(System.scala:67) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:278) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37) [error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [error] at java.base/java.lang.Thread.run(Thread.java:834) [error] (helloCore / update) sbt.librarymanagement.ResolveException: unresolved dependency: com.typesafe.play#play-json_2.13;2.6.9: not found [error] Total time: 7 s, completed 16 Apr. 2021, 5:00:08 pm error pic
Running into RedisTimeoutException and other exceptions with Redisson and Azure Redis Cache
A lot of timeout exceptions and Can't add slave exceptions Steps to reproduce or test case intermittent Redis version Azure Redis Cache with 5 shards 4.0.14, 3.2.7 Redisson version 3.11.4 Redisson configuration Default clustered config with the following overrides: REDIS_ENABLED | true REDIS_KEEP_ALIVE | true REDIS_THREADS | 512 REDIS_NETTY_THREADS | 1024 REDIS_MASTER_CONNECTION_MINIMUM_IDLE_SIZE | 5 REDIS_MASTER_CONNECTION_POOL_SIZE | 10 REDIS_SLAVE_CONNECTION_MINIMUM_IDLE_SIZE | 5 REDIS_SLAVE_CONNECTION_POOL_SIZE | 10 REDIS_TIMEOUT | 1000 REDIS_RETRY_INTERVAL | 500 REDIS_TCP_NO_DELAY | true I see following exceptions in the log: ` exception: { [-] class: org.redisson.client.RedisConnectionException thrownfrom: unknown } level: ERROR logger_name: org.redisson.cluster.ClusterConnectionManager message: Can't add slave: rediss://:15002 process: 6523 stack_trace: org.redisson.client.RedisTimeoutException: Command execution timeout for command: (READONLY), params: [], Redis client: [addr=rediss://:15002] at org.redisson.client.RedisConnection.lambda$async$1(RedisConnection.java:207) at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:680) at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:755) at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:483) ... 2 common frames omitted Wrapped by: org.redisson.client.RedisConnectionException: Unable to connect to Redis server: /:15002 at org.redisson.connection.pool.ConnectionPool$1.lambda$run$0(ConnectionPool.java:160) at org.redisson.misc.RedissonPromise.lambda$onComplete$0(RedissonPromise.java:183) at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577) at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:551) at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490) at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615) at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608) at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) at org.redisson.misc.RedissonPromise.tryFailure(RedissonPromise.java:96) at org.redisson.connection.pool.ConnectionPool.promiseFailure(ConnectionPool.java:330) at org.redisson.connection.pool.ConnectionPool.lambda$createConnection$1(ConnectionPool.java:296) at org.redisson.misc.RedissonPromise.lambda$onComplete$0(RedissonPromise.java:183) at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577) at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570) at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549) at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490) at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615) at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608) at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) at org.redisson.misc.RedissonPromise.tryFailure(RedissonPromise.java:96) at org.redisson.client.RedisClient$2$1.run(RedisClient.java:240) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) at i.n.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) stack_trace: org.redisson.client.RedisTimeoutException: Unable to get connection! Try to increase 'nettyThreads' and/or connection pool size settingsNode source: NodeSource [slot=15393, addr=redis://:15007, redisClient=null, redirect=MOVED, entry=null], command: (PSETEX), params: [some key, 3600000, PooledUnsafeDirectByteBuf(ridx: 0, widx: 457, cap: 512)] after 0 retry attempts at org.redisson.command.RedisExecutor$2.run(RedisExecutor.java:209) at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:680) at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:755) at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:483) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) level: ERROR logger_name: org.redisson.cluster.ClusterConnectionManager message: Can't add master: rediss://:15007 for slot ranges: [[15019-15564], [12288-13652], [4096-5461]] process: 6574 thread_name: redisson-netty-2-718 timestamp: 2019-10-29 22:32:15.592 ` My logs are flooded with these exceptions and when I login to Azure portal, I see the CPU metric for Redis spiked to 100%. Any help is appreciated.
Node rdkafka consumer stops fetching messages
Consumer stops fetching after getting following error { Error: Local: Broker transport failure at Error (native) origin: 'local', message: 'broker transport failure', code: -1, errno: -1, stack: 'Error: Local: Broker transport failure\n at Error (native)' } All kafka servers are healthy even then I am getting the transport failure . After this error consumers stops fetching further messages
spark-jobserver cannot build on Spark 1.6.2
I'm trying to run the spark-jobserver 0.6.2 with Spark 1.6.2 Currently what I'm doing is this: git clone https://github.com/spark-jobserver/spark-jobserver.git git checkout tags/v0.6.2 -f sbt job-server/package At this point the system crashes with this error: [info] Compiling 35 Scala sources to /test_jobserver/spark-jobserver/job-server/target/scala-2.10/classes... [error] [error] while compiling: /test_jobserver/spark-jobserver/job-server/src/spark.jobserver/util/SparkMasterProvider.scala [error] during phase: jvm [error] library version: version 2.10.6 [error] compiler version: version 2.10.6 [error] reconstructed args: -deprecation -classpath /test_jobserver/spark-jobserver/job-server/target/scala-2.10/classes:/test_jobserver/spark-jobserver/akka-app/target/scala-2.10/classes:/test_jobserver/spark-jobserver/job-server-api/target/scala-2.10/classes:/home/marco/.ivy2/cache/io.netty/netty-all/jars/netty-all-4.0.29.Final.jar:/home/marco/.ivy2/cache/com.typesafe/config/bundles/config-1.3.0.jar:/home/marco/.ivy2/cache/com.typesafe.akka/akka-cluster_2.10/jars/akka-cluster_2.10-2.3.15.jar:/home/marco/.ivy2/cache/com.typesafe.akka/akka-remote_2.10/jars/akka-remote_2.10-2.3.15.jar:/home/marco/.ivy2/cache/com.typesafe.akka/akka-actor_2.10/jars/akka-actor_2.10-2.3.15.jar:/home/marco/.ivy2/cache/io.netty/netty/bundles/netty-3.8.0.Final.jar:/home/marco/.ivy2/cache/com.google.protobuf/protobuf-java/bundles/protobuf-java-2.5.0.jar:/home/marco/.ivy2/cache/org.uncommons.maths/uncommons-maths/jars/uncommons-maths-1.2.2a.jar:/home/marco/.ivy2/cache/io.spray/spray-json_2.10/bundles/spray-json_2.10-1.3.2.jar:/home/marco/.ivy2/cache/io.spray/spray-can_2.10/bundles/spray-can_2.10-1.3.3.jar:/home/marco/.ivy2/cache/io.spray/spray-io_2.10/bundles/spray-io_2.10-1.3.3.jar:/home/marco/.ivy2/cache/io.spray/spray-util_2.10/bundles/spray-util_2.10-1.3.3.jar:/home/marco/.ivy2/cache/io.spray/spray-http_2.10/bundles/spray-http_2.10-1.3.3.jar:/home/marco/.ivy2/cache/org.parboiled/parboiled-scala_2.10/jars/parboiled-scala_2.10-1.1.7.jar:/home/marco/.ivy2/cache/org.parboiled/parboiled-core/jars/parboiled-core-1.1.7.jar:/home/marco/.ivy2/cache/io.spray/spray-caching_2.10/bundles/spray-caching_2.10-1.3.3.jar:/home/marco/.ivy2/cache/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru/jars/concurrentlinkedhashmap-lru-1.4.2.jar:/home/marco/.ivy2/cache/io.spray/spray-routing_2.10/bundles/spray-routing_2.10-1.3.3.jar:/home/marco/.ivy2/cache/io.spray/spray-httpx_2.10/bundles/spray-httpx_2.10-1.3.3.jar:/home/marco/.ivy2/cache/org.jvnet.mimepull/mimepull/jars/mimepull-1.9.5.jar:/home/marco/.ivy2/cache/com.chuusai/shapeless_2.10/jars/shapeless_2.10-1.2.4.jar:/home/marco/.ivy2/cache/io.spray/spray-client_2.10/bundles/spray-client_2.10-1.3.3.jar:/home/marco/.ivy2/cache/com.yammer.metrics/metrics-core/jars/metrics-core-2.2.0.jar:/home/marco/.ivy2/cache/org.joda/joda-convert/jars/joda-convert-1.8.1.jar:/home/marco/.ivy2/cache/joda-time/joda-time/jars/joda-time-2.9.3.jar:/home/marco/.ivy2/cache/com.typesafe.slick/slick_2.10/bundles/slick_2.10-2.1.0.jar:/home/marco/.ivy2/cache/com.h2database/h2/jars/h2-1.3.176.jar:/home/marco/.ivy2/cache/commons-dbcp/commons-dbcp/jars/commons-dbcp-1.4.jar:/home/marco/.ivy2/cache/commons-pool/commons-pool/jars/commons-pool-1.5.4.jar:/home/marco/.ivy2/cache/org.flywaydb/flyway-core/jars/flyway-core-3.2.1.jar:/home/marco/.ivy2/cache/org.apache.shiro/shiro-core/bundles/shiro-core-1.2.4.jar:/home/marco/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:/home/marco/.ivy2/cache/org.scoverage/scalac-scoverage-runtime_2.10/jars/scalac-scoverage-runtime_2.10-1.1.1.jar:/home/marco/.ivy2/cache/org.scoverage/scalac-scoverage-plugin_2.10/jars/scalac-scoverage-plugin_2.10-1.1.1.jar:/home/marco/.ivy2/cache/org.apache.spark/spark-core_2.10/jars/spark-core_2.10-1.6.1.jar:/home/marco/.ivy2/cache/org.apache.avro/avro-mapred/jars/avro-mapred-1.7.7-hadoop2.jar:/home/marco/.ivy2/cache/org.apache.avro/avro-ipc/jars/avro-ipc-1.7.7-tests.jar:/home/marco/.ivy2/cache/org.apache.avro/avro-ipc/jars/avro-ipc-1.7.7.jar:/home/marco/.ivy2/cache/org.apache.avro/avro/jars/avro-1.7.7.jar:/home/marco/.ivy2/cache/org.codehaus.jackson/jackson-core-asl/jars/jackson-core-asl-1.9.13.jar:/home/marco/.ivy2/cache/org.codehaus.jackson/jackson-mapper-asl/jars/jackson-mapper-asl-1.9.13.jar:/home/marco/.ivy2/cache/org.xerial.snappy/snappy-java/bundles/snappy-java-1.1.2.jar:/home/marco/.ivy2/cache/org.apache.commons/commons-compress/jars/commons-compress-1.4.1.jar:/home/marco/.ivy2/cache/org.tukaani/xz/jars/xz-1.0.jar:/home/marco/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.10.jar:/home/marco/.ivy2/cache/com.twitter/chill_2.10/jars/chill_2.10-0.5.0.jar:/home/marco/.ivy2/cache/com.twitter/chill-java/jars/chill-java-0.5.0.jar:/home/marco/.ivy2/cache/com.esotericsoftware.kryo/kryo/bundles/kryo-2.21.jar:/home/marco/.ivy2/cache/com.esotericsoftware.reflectasm/reflectasm/jars/reflectasm-1.07-shaded.jar:/home/marco/.ivy2/cache/com.esotericsoftware.minlog/minlog/jars/minlog-1.2.jar:/home/marco/.ivy2/cache/org.objenesis/objenesis/jars/objenesis-1.2.jar:/home/marco/.ivy2/cache/org.apache.xbean/xbean-asm5-shaded/bundles/xbean-asm5-shaded-4.4.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-client/jars/hadoop-client-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-common/jars/hadoop-common-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-annotations/jars/hadoop-annotations-2.2.0.jar:/home/marco/.ivy2/cache/com.google.code.findbugs/jsr305/jars/jsr305-1.3.9.jar:/home/marco/.ivy2/cache/commons-cli/commons-cli/jars/commons-cli-1.2.jar:/home/marco/.ivy2/cache/org.apache.commons/commons-math/jars/commons-math-2.1.jar:/home/marco/.ivy2/cache/xmlenc/xmlenc/jars/xmlenc-0.52.jar:/home/marco/.ivy2/cache/commons-httpclient/commons-httpclient/jars/commons-httpclient-3.1.jar:/home/marco/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.4.jar:/home/marco/.ivy2/cache/commons-net/commons-net/jars/commons-net-2.2.jar:/home/marco/.ivy2/cache/log4j/log4j/bundles/log4j-1.2.17.jar:/home/marco/.ivy2/cache/commons-lang/commons-lang/jars/commons-lang-2.5.jar:/home/marco/.ivy2/cache/commons-configuration/commons-configuration/jars/commons-configuration-1.6.jar:/home/marco/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:/home/marco/.ivy2/cache/commons-digester/commons-digester/jars/commons-digester-1.8.jar:/home/marco/.ivy2/cache/commons-beanutils/commons-beanutils-core/jars/commons-beanutils-core-1.8.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-auth/jars/hadoop-auth-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-hdfs/jars/hadoop-hdfs-2.2.0.jar:/home/marco/.ivy2/cache/org.mortbay.jetty/jetty-util/jars/jetty-util-6.1.26.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-app/jars/hadoop-mapreduce-client-app-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-common/jars/hadoop-mapreduce-client-common-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-yarn-common/jars/hadoop-yarn-common-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-yarn-api/jars/hadoop-yarn-api-2.2.0.jar:/home/marco/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.7.10.jar:/home/marco/.ivy2/cache/com.google.inject/guice/jars/guice-3.0.jar:/home/marco/.ivy2/cache/javax.inject/javax.inject/jars/javax.inject-1.jar:/home/marco/.ivy2/cache/aopalliance/aopalliance/jars/aopalliance-1.0.jar:/home/marco/.ivy2/cache/org.sonatype.sisu.inject/cglib/jars/cglib-2.2.1-v20090111.jar:/home/marco/.ivy2/cache/com.sun.jersey.jersey-test-framework/jersey-test-framework-grizzly2/jars/jersey-test-framework-grizzly2-1.9.jar:/home/marco/.ivy2/cache/com.sun.jersey/jersey-server/bundles/jersey-server-1.9.jar:/home/marco/.ivy2/cache/asm/asm/jars/asm-3.1.jar:/home/marco/.ivy2/cache/com.sun.jersey/jersey-json/bundles/jersey-json-1.9.jar:/home/marco/.ivy2/cache/org.codehaus.jettison/jettison/bundles/jettison-1.1.jar:/home/marco/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:/home/marco/.ivy2/cache/com.sun.xml.bind/jaxb-impl/jars/jaxb-impl-2.2.3-1.jar:/home/marco/.ivy2/cache/javax.xml.bind/jaxb-api/jars/jaxb-api-2.2.2.jar:/home/marco/.ivy2/cache/javax.activation/activation/jars/activation-1.1.jar:/home/marco/.ivy2/cache/org.codehaus.jackson/jackson-jaxrs/jars/jackson-jaxrs-1.8.3.jar:/home/marco/.ivy2/cache/org.codehaus.jackson/jackson-xc/jars/jackson-xc-1.8.3.jar:/home/marco/.ivy2/cache/com.sun.jersey.contribs/jersey-guice/jars/jersey-guice-1.9.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-yarn-client/jars/hadoop-yarn-client-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-core/jars/hadoop-mapreduce-client-core-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-yarn-server-common/jars/hadoop-yarn-server-common-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-shuffle/jars/hadoop-mapreduce-client-shuffle-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-jobclient/jars/hadoop-mapreduce-client-jobclient-2.2.0.jar:/home/marco/.ivy2/cache/org.apache.spark/spark-launcher_2.10/jars/spark-launcher_2.10-1.6.1.jar:/home/marco/.ivy2/cache/org.spark-project.spark/unused/jars/unused-1.0.0.jar:/home/marco/.ivy2/cache/org.apache.spark/spark-network-common_2.10/jars/spark-network-common_2.10-1.6.1.jar:/home/marco/.ivy2/cache/org.apache.spark/spark-network-shuffle_2.10/jars/spark-network-shuffle_2.10-1.6.1.jar:/home/marco/.ivy2/cache/org.fusesource.leveldbjni/leveldbjni-all/bundles/leveldbjni-all-1.8.jar:/home/marco/.ivy2/cache/com.fasterxml.jackson.core/jackson-databind/bundles/jackson-databind-2.4.4.jar:/home/marco/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/bundles/jackson-annotations-2.4.4.jar:/home/marco/.ivy2/cache/com.fasterxml.jackson.core/jackson-core/bundles/jackson-core-2.4.4.jar:/home/marco/.ivy2/cache/org.apache.spark/spark-unsafe_2.10/jars/spark-unsafe_2.10-1.6.1.jar:/home/marco/.ivy2/cache/net.java.dev.jets3t/jets3t/jars/jets3t-0.7.1.jar:/home/marco/.ivy2/cache/org.apache.curator/curator-recipes/bundles/curator-recipes-2.4.0.jar:/home/marco/.ivy2/cache/org.apache.curator/curator-framework/bundles/curator-framework-2.4.0.jar:/home/marco/.ivy2/cache/org.apache.curator/curator-client/bundles/curator-client-2.4.0.jar:/home/marco/.ivy2/cache/org.apache.zookeeper/zookeeper/jars/zookeeper-3.4.5.jar:/home/marco/.ivy2/cache/jline/jline/jars/jline-0.9.94.jar:/home/marco/.ivy2/cache/com.google.guava/guava/bundles/guava-14.0.1.jar:/home/marco/.ivy2/cache/org.eclipse.jetty.orbit/javax.servlet/orbits/javax.servlet-3.0.0.v201112011016.jar:/home/marco/.ivy2/cache/org.apache.commons/commons-lang3/jars/commons-lang3-3.3.2.jar:/home/marco/.ivy2/cache/org.apache.commons/commons-math3/jars/commons-math3-3.4.1.jar:/home/marco/.ivy2/cache/org.slf4j/jul-to-slf4j/jars/jul-to-slf4j-1.7.10.jar:/home/marco/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.10.jar:/home/marco/.ivy2/cache/com.ning/compress-lzf/bundles/compress-lzf-1.0.3.jar:/home/marco/.ivy2/cache/net.jpountz.lz4/lz4/jars/lz4-1.3.0.jar:/home/marco/.ivy2/cache/org.roaringbitmap/RoaringBitmap/bundles/RoaringBitmap-0.5.11.jar:/home/marco/.ivy2/cache/com.typesafe.akka/akka-slf4j_2.10/jars/akka-slf4j_2.10-2.3.11.jar:/home/marco/.ivy2/cache/org.json4s/json4s-jackson_2.10/jars/json4s-jackson_2.10-3.2.10.jar:/home/marco/.ivy2/cache/org.json4s/json4s-core_2.10/jars/json4s-core_2.10-3.2.10.jar:/home/marco/.ivy2/cache/org.json4s/json4s-ast_2.10/jars/json4s-ast_2.10-3.2.10.jar:/home/marco/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.6.jar:/home/marco/.ivy2/cache/org.scala-lang/scalap/jars/scalap-2.10.0.jar:/home/marco/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.0.jar:/home/marco/.ivy2/cache/com.sun.jersey/jersey-core/bundles/jersey-core-1.9.jar:/home/marco/.ivy2/cache/org.apache.mesos/mesos/jars/mesos-0.21.1-shaded-protobuf.jar:/home/marco/.ivy2/cache/com.clearspring.analytics/stream/jars/stream-2.7.0.jar:/home/marco/.ivy2/cache/io.dropwizard.metrics/metrics-core/bundles/metrics-core-3.1.2.jar:/home/marco/.ivy2/cache/io.dropwizard.metrics/metrics-jvm/bundles/metrics-jvm-3.1.2.jar:/home/marco/.ivy2/cache/io.dropwizard.metrics/metrics-json/bundles/metrics-json-3.1.2.jar:/home/marco/.ivy2/cache/io.dropwizard.metrics/metrics-graphite/bundles/metrics-graphite-3.1.2.jar:/home/marco/.ivy2/cache/com.fasterxml.jackson.module/jackson-module-scala_2.10/bundles/jackson-module-scala_2.10-2.4.4.jar:/home/marco/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.4.jar:/home/marco/.ivy2/cache/org.apache.ivy/ivy/jars/ivy-2.4.0.jar:/home/marco/.ivy2/cache/oro/oro/jars/oro-2.0.8.jar:/home/marco/.ivy2/cache/org.tachyonproject/tachyon-client/jars/tachyon-client-0.8.2.jar:/home/marco/.ivy2/cache/commons-io/commons-io/jars/commons-io-2.4.jar:/home/marco/.ivy2/cache/org.tachyonproject/tachyon-underfs-hdfs/jars/tachyon-underfs-hdfs-0.8.2.jar:/home/marco/.ivy2/cache/org.tachyonproject/tachyon-underfs-s3/jars/tachyon-underfs-s3-0.8.2.jar:/home/marco/.ivy2/cache/org.tachyonproject/tachyon-underfs-local/jars/tachyon-underfs-local-0.8.2.jar:/home/marco/.ivy2/cache/net.razorvine/pyrolite/jars/pyrolite-4.9.jar:/home/marco/.ivy2/cache/net.sf.py4j/py4j/jars/py4j-0.9.jar -feature -bootclasspath /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes:/home/marco/.sbt/boot/scala-2.10.6/lib/scala-library.jar -language:implicitConversions -language:postfixOps [error] [error] last tree to typer: Literal(Constant(collection.Set)) [error] symbol: null [error] symbol definition: null [error] tpe: Class(classOf[scala.collection.Set]) [error] symbol owners: [error] context owners: object DefaultSparkMasterProvider -> package util [error] [error] == Enclosing template or block == [error] [error] Template( // val <local DefaultSparkMasterProvider>: <notype> in object DefaultSparkMasterProvider, tree.tpe=spark.jobserver.util.DefaultSparkMasterProvider.type [error] "java.lang.Object", "spark.jobserver.util.SparkMasterProvider" // parents [error] ValDef( [error] private [error] "_" [error] <tpt> [error] <empty> [error] ) [error] // 2 statements [error] DefDef( // def getSparkMaster(config: com.typesafe.config.Config): String in object DefaultSparkMasterProvider [error] <method> [error] "getSparkMaster" [error] [] [error] // 1 parameter list [error] ValDef( // config: com.typesafe.config.Config [error] <param> <triedcooking> [error] "config" [error] <tpt> // tree.tpe=com.typesafe.config.Config [error] <empty> [error] ) [error] <tpt> // tree.tpe=String [error] Apply( // def getString(x$1: String): String in trait Config, tree.tpe=String [error] "config"."getString" // def getString(x$1: String): String in trait Config, tree.tpe=(x$1: String)String [error] "spark.master" [error] ) [error] ) [error] DefDef( // def <init>(): spark.jobserver.util.DefaultSparkMasterProvider.type in object DefaultSparkMasterProvider [error] <method> [error] "<init>" [error] [] [error] List(Nil) [error] <tpt> // tree.tpe=spark.jobserver.util.DefaultSparkMasterProvider.type [error] Block( // tree.tpe=Unit [error] Apply( // def <init>(): Object in class Object, tree.tpe=Object [error] DefaultSparkMasterProvider.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object [error] Nil [error] ) [error] () [error] ) [error] ) [error] ) [error] [error] == Expanded type of tree == [error] [error] ConstantType(value = Constant(collection.Set)) [error] [error] uncaught exception during compilation: java.io.IOException [error] File name too long [error] two errors found [error] (job-server/compile:compileIncremental) Compilation failed [error] Total time: 16 s, completed Oct 25, 2016 3:32:36 PM I didn't find anything, somebody knows how to do this? Thank you
Apparently, you can't run this on an encrypted folder on Ubuntu. Moving the project folder to a disk partition non- encrypted made the magic. For more infos, see: https://github.com/scala/pickling/issues/10