java.net.SocketTimeoutException: Read timed out

If you get java.net.SocketTimeoutException: Read timed out exception

Try setting own timeout value when constructing JedisPool using the following constructor:

JedisPool(GenericObjectPool.Config poolConfig, String host, int port, int timeout)

Default timeout value is 2 seconds.

JedisPool blocks after getting 8 connections

JedisPool defaults to 8 connections, you can change this in the PoolConfig:

JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(maxTotal); // maximum active connections
poolConfig.setMaxIdle(maxIdle);  // maximum idle connections

Take into account that JedisPool inherits commons-pool BaseObjectPoolConfig which has a lot of configuration parameters. We‘ve set some defined ones which suit most of the cases. In case, you experience issues tuning these parameters may help.

https://github.com/xetorthio/jedis/wiki/FAQ#jedispool-blocks-after-getting-8-connections

时间: 2024-08-05 05:10:19

java.net.SocketTimeoutException: Read timed out的相关文章

jsoup-提示java.net.SocketTimeoutException:Read timed out

使用Jsoup.connect(url).get()连接某网站时偶尔会出现 java.net.SocketTimeoutException:Read timed out异常. 原因是默认的Socket的延时比较短,而有些网站的响应速度比较慢,所以会发生超时的情况. 解决方法: 链接的时候设定超时时间即可. doc = Jsoup.connect(url).timeout(5000).get(); 5000表示延时时间设置为5s. 测试代码如下: 1,不设定timeout时: package js

在Java中进行api调用时,出现“Exception in thread "main" java.net.SocketTimeoutException: timeout”,“Caused by: java.net.SocketTimeoutException: Read timed out”的错误

在本地使用 OkHttpClient 创建请求客户端,调试api接口时,出现了表示中所述的错误,先贴出完整错误代码 Exception in thread "main" java.net.SocketTimeoutException: timeout at okio.Okio$4.newTimeoutException(Okio.java:230) at okio.AsyncTimeout.exit(AsyncTimeout.java:285) at okio.AsyncTimeout

java.net.SocketTimeoutException: Read timed out 异常排查

问题描述:使用RestTemplate调用接口出现该异常,相关调用代码: ResponseEntity<ResultVO> responseEntity; try { responseEntity = restTemplate.getForEntity( url, ResultVO.class ); } catch (Exception e) { log.error("ops获取项目失败" + e.getMessage()); throw new OAuth2Excepti

redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect time out

redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed outat redis.clients.jedis.Connection.connect(Connection.java:154)at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:83)at redis.clients

How to solve java.net.SocketTimeoutException:60000millis problem in HDFS

Many HDFS users encounter the following error when DFSClient ready file from a certain Data Node.  "Java.net.SocketTimeoutException: 60000millis timeout while waiting for channel to be ready for read. ch" The reason about this error is that the

http://ibatis.apache.org/dtd/ibatis-3-config.dtd Cause: java.net.ConnectException: Connection timed out: connect

最近发现我的一个web项目只要在家启动时候就出现一个连接错误的问题,大概如下: Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderVersionMapper' defined in class path resource [applicationContext.xml]: Cannot resolve reference to be

phoenix连接hbase数据库,创建二级索引报错:Error: org.apache.phoenix.exception.PhoenixIOException: Failed after attempts=36, exceptions: Tue Mar 06 10:32:02 CST 2018, null, java.net.SocketTimeoutException: callTimeou

环境描述: 操作系统版本:CentOS release 6.5 (Final) 内核版本:2.6.32-431.el6.x86_64 phoenix版本:phoenix-4.10.0 hbase版本:hbase-1.2.6 表SYNC_BUSINESS_INFO_BYDAY数据库量:990万+ 问题描述: 通过phoenix客户端连接hbase数据库,创建二级索引时,报下面的错误: 0: jdbc:phoenix:host-10-191-5-226> create index SYNC_BUSI

eclipse使用STS插件 报错:SocketTimeoutException: Read timed out

新建boot项目后,提示: SocketTimeoutException: Read timed out 解决: 在eclipse.ini末尾,追加: -Djava.net.preferIPv4Stack=true 然后, 重启Eclipse,搞定. 原文地址:https://www.cnblogs.com/yaoyuan2/p/10348203.html

java.net.ConnectException: Connection timed out: connect;Socket与云服务器的问题

新购买的云服务器上运行的Socket程序,客户端连接不上,客户端的错误是java.net.ConnectException: Connection timed out: connect 解决办法是在云服务器打开SocketServer指定的端口,例如阿里云我就在防火墙中,点击添加规则,然后选择TCP协议,输入端口5000 这样再运行服务器程序,使用客户端程序时就能连接上了 补充 客户端的Socket host指定为云服务器的公网IP,ServerSocket指定端口号就行了 原文地址:https