免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7042 | 回复: 2
打印 上一主题 下一主题

[FastDFS] FastDFS Java客户端性能测试,连接报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-06-24 10:08 |只看该作者 |倒序浏览
本帖最后由 bbyyzhang 于 2014-06-24 10:10 编辑

使用FastDFS版本4.0.6
Java客户端版本v1.24
使用java客户端包test目录下TestLoad跑性能测试,刚开始一切正常,时间不久就开始出错

测试代码就上传下载两个两个线程
  1. for (int i=0; i<2; i++)
  2.                   {
  3.                           (new UploadThread(i)).start();
  4.                   }
  5.                  
  6.                   for (int i=0; i<2; i++)
  7.                   {
  8.                           (new DownloadThread(i)).start();
  9.                   }
复制代码
错误日志如下:
  1. upload file fail, error mesg: getStoreStorage fail, errno code: 0
  2. connect to server 10.211.93.171:22122 fail
  3. java.net.SocketException: No buffer space available (maximum connections reached?): connect
  4.         at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  5.         at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  6.         at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  7.         at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  8.         at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  9.         at java.net.PlainSocketImpl.connect(Unknown Source)
  10.         at java.net.SocksSocketImpl.connect(Unknown Source)
  11.         at java.net.Socket.connect(Unknown Source)
  12.         at org.csource.fastdfs.TrackerGroup.getConnection(TrackerGroup.java:47)
  13.         at org.csource.fastdfs.TrackerGroup.getConnection(TrackerGroup.java:72)
  14.         at org.csource.fastdfs.TrackerClient.getConnection(TrackerClient.java:58)
  15.         at org.csource.fastdfs.TrackerClient.getStoreStorage(TrackerClient.java:91)
  16.         at org.csource.fastdfs.StorageClient.newWritableStorageConnection(StorageClient.java:1938)
  17.         at org.csource.fastdfs.StorageClient.do_upload_file(StorageClient.java:703)
  18.         at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:208)
  19.         at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:226)
  20.         at org.csource.fastdfs.StorageClient1.upload_file1(StorageClient1.java:112)
  21.         at org.csource.fastdfs.test.TestLoad$Uploader.uploadFile(TestLoad.java:78)
  22.         at org.csource.fastdfs.test.TestLoad$UploadThread.run(TestLoad.java:166)
  23. upload file fail, error mesg: getStoreStorage fail, errno code: 0
  24. upload file fail, error mesg: No buffer space available (maximum connections reached?): connect
复制代码
求教,这是什么错误,该怎么解决。
配置文件tracker.conf 和storage.conf里的
  1. # max concurrent connections this server supported
  2. max_connections=1024
  3. #max_connections=256

  4. # work thread count, should <= max_connections
  5. # default value is 4
  6. # since V2.00
  7. #work_threads=4
  8. work_threads=48
复制代码
求大神指点

论坛徽章:
0
2 [报告]
发表于 2014-06-24 10:18 |只看该作者
上传和下载都调整为一个线程时,第一次运行正常
  1. endTime 1403576049518
  2. uploadCaps 281 p/s
  3. upload thread 0 exit, total_upload_count: 5000, success_upload_count: 5000, total_download_count: 4998, success_download_count: 4997
  4. endTime 1403576049536
  5. downLoadCaps 281 p/s
  6. download thread 0 exit, total_download_count: 5000, success_download_count: 5000, fail_download_count: 0
复制代码
接着跑第二次,开始出现连接错

论坛徽章:
0
3 [报告]
发表于 2014-06-30 22:26 |只看该作者
看看你是不是windows系统。帮你google了一下,https://supportkb.riverbed.com/s ... mp;actp=LIST_RECENT

ESOLVING JAVA.NET.SOCKETEXCEPTION: NO BUFFER SPACE AVAILABLE (MAXIMUM CONNECTIONS REACHED?)
Categories: AppInternals Xpert (SteelCentral AppInternals), OPNET Dashboards
Solution Number: S23580                 Subscribe        Share via Email        Printer Friendly Version
ISSUE
We see the following exception in the logs.
java.net.SocketException: No buffer space available (maximum connections reached?): connect
Examples
SMP - AppInternals Xpert (AIX) Service Management Platform - smp.txt
java.net.SocketException: No buffer space available (maximum connections reached?): connect com.altaworks.smp.client.AwServerException: Server related error. Reason is: AwDirectorClient.constructor error getting director client stub com.altaworks.smp.client.AwServerException: Server related error. Reason is: com.altaworks.util.rmi.AwRmiException: Server related error. Reason is: RemoteException on RMI naming.lookup(): Exception creating connection to: localhost; nested exception is:
RPM Dashboards
2013-05-30 12:10:33,055 [Timer-3833] ERROR com.opnet.netcop.server.monitor.Monitor - Monitor.sendHeartbeat
java.net.SocketException: No buffer space available (maximum connections reached?): connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
SOLUTION
Root Cause
This issue occurs because of a race condition in the Ancillary Function Driver for WinSock (Afd.sys) that causes sockets to be leaked. With time, the issue that is described in the "Symptoms" section occurs if all available socket resources are exhausted.
Refernece: Kernel sockets leak on a multiprocessor computer that is running Windows Server 2008 R2 or Windows 7
Resolution
Install this Microsoft Hotfix KB2577795

Reboot System
ENVIRONMENT
AppInternals Xpert SMP or RPM Dashboards on the following OS:
Windows Server 2008 R2
Windows 7
BUG NUMBER
SPR-175667
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP