Chinaunix首页 | 论坛 | 博客
  • 博客访问: 380129
  • 博文数量: 28
  • 博客积分: 150
  • 博客等级: 入伍新兵
  • 技术积分: 428
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-25 12:07
个人简介

Cisco Certified Internetwork Expert(Routing and Switching) CCIE R&S 2101X, IBM Certified Advanced Technical Expert - Power Systems with AIX v2, Red Hat Certified Engineer RHCE 130-165-39X, Oracle Certified Master 10g

文章分类

全部博文(28)

文章存档

2018年(1)

2017年(2)

2016年(4)

2015年(8)

2014年(4)

2013年(2)

2011年(7)

我的朋友

分类: 系统运维

2016-06-16 18:29:13

========phanx.com========
Author:   phanx
Updated: 2016-6-16
            2017-6-18

转载请保留作者信息
=========================

Weblogic中创建了一个简单的域,只有AdminServer,开启了SSL。 
登录Admin Console的时候,输入了用户名和密码后就一直卡住不动了,要等很久才能进入。
开始以为是配置了DNS的问题,抓包看了一下根本没有DNS请求。

于是用JSTACK做了一下DUMP看了看。先启动Weblogic Server后,做一次DUMP。


点击(此处)折叠或打开

  1. 2016-06-16 17:27:22
  2. Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.95-b03 mixed mode):
  3. "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007fa638001000 nid=0x41b1 in Object.wait() [0x00007fa709544000]
  4. java.lang.Thread.State: WAITING (on object monitor)
  5. at java.lang.Object.wait(Native Method)
  6. - waiting on <0x00000000feb8a140> (a weblogic.work.ExecuteThread)
  7. at java.lang.Object.wait(Object.java:503)
  8. at weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:205)
  9. - locked <0x00000000feb8a140> (a weblogic.work.ExecuteThread)
  10. at weblogic.work.ExecuteThread.run(ExecuteThread.java:233)
  11. .
  12. .
  13. .
  14. .
  15. .
  16. .
  17. "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007fa725125800 nid=0x419e in Object.wait() [0x00007fa70b6ca000]
  18. java.lang.Thread.State: WAITING (on object monitor)
  19. at java.lang.Object.wait(Native Method)
  20. - waiting on <0x00000000ff419fc8> (a weblogic.work.ExecuteThread)
  21. at java.lang.Object.wait(Object.java:503)
  22. at weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:205)
  23. - locked <0x00000000ff419fc8> (a weblogic.work.ExecuteThread)
  24. at weblogic.work.ExecuteThread.run(ExecuteThread.java:233)
  25. "Timer-1" daemon prio=10 tid=0x00007fa725121800 nid=0x419d in Object.wait() [0x00007fa70b7cb000]
  26. java.lang.Thread.State: TIMED_WAITING (on object monitor)
  27. at java.lang.Object.wait(Native Method)
  28. - waiting on <0x00000000feb88c60> (a java.util.TaskQueue)
  29. at java.util.TimerThread.mainLoop(Timer.java:552)
  30. - locked <0x00000000feb88c60> (a java.util.TaskQueue)
  31. at java.util.TimerThread.run(Timer.java:505)
  32. .
    .
  33. .
  34. .
  35. .
  36. .
  37. .
  38. Heap
  39. PSYoungGen total 164352K, used 158559K [0x00000000f5500000, 0x0000000100000000, 0x0000000100000000)
  40. eden space 153600K, 96% used [0x00000000f5500000,0x00000000fe55e530,0x00000000feb00000)
  41. from space 10752K, 99% used [0x00000000feb00000,0x00000000ff5797f0,0x00000000ff580000)
  42. to space 10752K, 0% used [0x00000000ff580000,0x00000000ff580000,0x0000000100000000)
  43. ParOldGen total 175104K, used 53506K [0x00000000e0000000, 0x00000000eab00000, 0x00000000f5500000)
  44. object space 175104K, 30% used [0x00000000e0000000,0x00000000e3440af0,0x00000000eab00000)
  45. PSPermGen total 131072K, used 74753K [0x00000000d0000000, 0x00000000d8000000, 0x00000000e0000000)
  46. object space 131072K, 57% used [0x00000000d0000000,0x00000000d4900798,0x00000000d8000000)

然后,登录,卡住了,再用JSTACK做一次DUMP。


点击(此处)折叠或打开

  1. 2016-06-16 17:28:19
  2. Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.95-b03 mixed mode):
  3. "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007fa638001000 nid=0x41b1 in Object.wait() [0x00007fa709544000]
  4. java.lang.Thread.State: WAITING (on object monitor)
  5. at java.lang.Object.wait(Native Method)
  6. - waiting on <0x00000000feb8a140> (a weblogic.work.ExecuteThread)
  7. at java.lang.Object.wait(Object.java:503)
  8. at weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:205)
  9. - locked <0x00000000feb8a140> (a weblogic.work.ExecuteThread)
  10. at weblogic.work.ExecuteThread.run(ExecuteThread.java:233)
  11. .
  12. .
  13. .
  14. .
  15. .
  16. "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007fa725125800 nid=0x419e runnable [0x00007fa70b6c9000]
  17. java.lang.Thread.State: RUNNABLE
  18. at java.io.FileInputStream.readBytes(Native Method)
  19. at java.io.FileInputStream.read(FileInputStream.java:272)
  20. at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:202)
  21. at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:219)
  22. - locked <0x00000000e09aacb0> (a java.lang.Object)
  23. at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:125)
  24. at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:119)
  25. at java.security.SecureRandom.generateSeed(SecureRandom.java:528)
  26. at com.bea.security.utils.random.AbstractRandomData.ensureInittedAndSeeded(AbstractRandomData.java:91)
  27. - locked <0x00000000fe7c5ef0> (a com.bea.security.utils.random.SecureRandomData)
  28. at com.bea.security.utils.random.AbstractRandomData.getRandomBytes(AbstractRandomData.java:105)
  29. - locked <0x00000000fe7c5ef0> (a com.bea.security.utils.random.SecureRandomData)
  30. at com.bea.security.utils.random.AbstractRandomData.getRandomBytes(AbstractRandomData.java:100)
  31. at weblogic.security.Salt.getRandomBytes(Salt.java:18)
  32. at weblogic.servlet.security.internal.SecurityModule.generateNewId(SecurityModule.java:397)
  33. at weblogic.servlet.security.internal.SecurityModule.setupAuthCookie(SecurityModule.java:355)
  34. at weblogic.servlet.security.internal.SecurityModule.login(SecurityModule.java:316)
  35. at weblogic.servlet.security.internal.FormSecurityModule.processJSecurityCheck(FormSecurityModule.java:300)
  36. at weblogic.servlet.security.internal.FormSecurityModule.checkUserPerm(FormSecurityModule.java:211)
  37. at weblogic.servlet.security.internal.FormSecurityModule.checkAccess(FormSecurityModule.java:94)
  38. at weblogic.servlet.security.internal.ChainedSecurityModule.checkAccess(ChainedSecurityModule.java:79)
  39. at weblogic.servlet.security.internal.ServletSecurityManager.checkAccess(ServletSecurityManager.java:82)
  40. at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2219)
  41. at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2182)
  42. at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491)
  43. at weblogic.work.ExecuteThread.execute(ExecuteThread.java:263)
  44. at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
  45. "Timer-1" daemon prio=10 tid=0x00007fa725121800 nid=0x419d in Object.wait() [0x00007fa70b7cb000]
  46. java.lang.Thread.State: TIMED_WAITING (on object monitor)
  47. at java.lang.Object.wait(Native Method)
  48. - waiting on <0x00000000feb88c60> (a java.util.TaskQueue)
  49. at java.util.TimerThread.mainLoop(Timer.java:552)
  50. - locked <0x00000000feb88c60> (a java.util.TaskQueue)
  51. at java.util.TimerThread.run(Timer.java:505)
  52. .
  53. .
  54. .
  55. .
  56. .
  57. Heap
  58. PSYoungGen total 164352K, used 162488K [0x00000000f5500000, 0x0000000100000000, 0x0000000100000000)
  59. eden space 153600K, 98% used [0x00000000f5500000,0x00000000fe934830,0x00000000feb00000)
  60. from space 10752K, 99% used [0x00000000feb00000,0x00000000ff5797f0,0x00000000ff580000)
  61. to space 10752K, 0% used [0x00000000ff580000,0x00000000ff580000,0x0000000100000000)
  62. ParOldGen total 175104K, used 53506K [0x00000000e0000000, 0x00000000eab00000, 0x00000000f5500000)
  63. object space 175104K, 30% used [0x00000000e0000000,0x00000000e3440af0,0x00000000eab00000)
  64. PSPermGen total 131072K, used 74808K [0x00000000d0000000, 0x00000000d8000000, 0x00000000e0000000)
  65. object space 131072K, 57% used [0x00000000d0000000,0x00000000d490e1d0,0x00000000d8000000)

从红色的部份应该就可以看出是卡在生成随机数这步了。 在Linux平台用Weblogic的基本都遇到过生成随机数慢的这个问题。
办法也很简单,要么改 $JAVA_HOME/jre/lib/security/java.security 中的securerandom.source改为

点击(此处)折叠或打开

  1. securerandom.source=file:/dev/./urandom

或者直接export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"。

Update 2017-6-18:
另外,如果是 Intel Ivy Bridge 核心以后的的CPU(Xeon E5-2600 v2/E7-4800 v2/8800 v2这些,具体可参考 https://en.wikipedia.org/wiki/Xeon),那么可以用CPU提供的硬件随机数加速功能。

点击(此处)折叠或打开

  1. [root@localhost ~]# grep --color rdrand /proc/cpuinfo 
  2. flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
  3. [root@localhost ~]# grep Xeon /proc/cpuinfo
model name      : Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz

需要RHEL 6 Update 7 以上的RNG-TOOLS才支持。 默认情况下,启动rngd服务会报 Unable to open file: /dev/tpm0 ,需要在 /etc/sysconfig/rngd 中配置 EXTRAOPTIONS="--rng-device=drng --no-tpm=1"

点击(此处)折叠或打开

  1. [root@localhost ~]# rpm -qa|grep rng
  2. rng-tools-5-2.el6_7.x86_64
  3. [root@localhost ~]# cat /etc/sysconfig/rngd
  4. # Add extra options here
  5. EXTRAOPTIONS="--rng-device=drng --no-tpm=1"
  6. [root@localhost ~]# chkconfig rngd on
  7. [root@localhost ~]# service rngd start
  8. [root@localhost ~]# cat /proc/sys/kernel/random/entropy_avail 
    3202







阅读(1989) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册