2012-04-23 37 views
7
64 bits

AIX, 7G RAMJava inicio es muy lento en AIX7.1

$ uname -a 
AIX server3 1 7 00036073D600 

$ java -version 
java version "1.6.0" 
Java(TM) SE Runtime Environment (build pap6460_26sr1-20111114_01(SR1)) 
IBM J9 VM (build 2.6, JRE 1.6.0 AIX ppc64-64 20111113_94967 (JIT enabled, AOT enabled) 
J9VM - R26_Java626_SR1_20111113_1649_B94967 
JIT - r11_20111028_21230 
GC - R26_Java626_SR1_20111113_1649_B94967 
J9CL - 20111113_94967) 
JCL - 20111112_01 

$ time /opt/IBM/WebSphere/AppServer/java/bin/java 
... 
real 0m40.62s 
user 0m0.43s 
sys  0m0.04s 

Se tarda 40 años para comenzar comando java sin ninguna aplicación. El JRE (64 bits) es parte de WebSphere V8 y necesita 20 minutos. para iniciar el Servidor de aplicaciones.

En el mismo AIX, hay otro JRE (32 bits), funciona muy bien.

$ /usr/java6/bin/java -version 
java version "1.6.0" 
Java(TM) SE Runtime Environment (build pap3260sr9fp2-20110627_03(SR9 FP2)) 
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr9-20110624_85526 (JIT enabled, AOT enabled) 
J9VM - 20110624_085526 
JIT - r9_20101028_17488ifx17 
GC - 20101027_AA) 
JCL - 20110530_01 

$ time /usr/java6/bin/java 
real 0m0.70s 
user 0m0.64s 
sys  0m0.05s 

He encontrado algo usando truss.When java va a la puesta en marcha, se bloquea en thread_tsleep() durante mucho tiempo. ¿Por qué? ¿Cómo corregirlo?

kopen("/etc/irs.conf", O_RDONLY)    Err#2 ENOENT 
_thread_self()         = 26738737 
getdomainname(0x09001000A00E44F8, 1024)   = 0 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
getdomainname(0x09001000A00E44F8, 1024)   = 0 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
kopen("/etc/hesiod.conf", O_RDONLY)    Err#2 ENOENT 
_thread_self()         = 26738737 
getdomainname(0x09001000A00E44F8, 1024)   = 0 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
getdomainname(0x09001000A00E44F8, 1024)   = 0 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
getdomainname(0x09001000A00E44F8, 1024)   = 0 
_thread_self()         = 26738737 
_thread_self()         = 26738737 
socket(2, 2, 0)         = 4 
getsockopt(4, 65535, 4104, 0x000001001012A934, 0x000001001012A930) = 0 
connext(4, 0x00000100103F37B8, 16)    = 0 
_esend(4, 0x000001001012B860, 40, 0, 0x0000000000000000) = 40 
_poll(0x000001001012AA00, 1, 5000)    = 1 
_enrecvfrom(4, 0x000001001012CBB0, 1024, 0, 0x000001001012B1C0, 0x000001001012A9E8, 0x0000000000000000) = 56 
close(4)          = 0 
socket(2, 2, 0)         = 4 
getsockopt(4, 65535, 4104, 0x000001001012A934, 0x000001001012A930) = 0 
connext(4, 0x00000100103F37B8, 16)    = 0 
_esend(4, 0x000001001012B860, 40, 0, 0x0000000000000000) = 40 
_poll(0x000001001012AA00, 1, 5000)    = 1 
_enrecvfrom(4, 0x000001001012CBB0, 1024, 0, 0x000001001012B1C0, 0x000001001012A9E8, 0x0000000000000000) = 94 
_esend(4, 0x000001001012B860, 25, 0, 0x0000000000000000) = 25 
_poll(0x000001001012AA00, 1, 5000)    = 1 
_enrecvfrom(4, 0x000001001012CBB0, 1024, 0, 0x000001001012B1C0, 0x000001001012A9E8, 0x0000000000000000) = 25 
close(4)          = 0 
socket(2, 2, 0)         = 4 
_esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F37C8, 16, 0x0000000000000000) = 25 
thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
_poll(0x000001001012AA00, 1, 5000)    = 0 
close(4)          = 0 
socket(2, 2, 0)         = 4 
_esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F37C8, 16, 0x0000000000000000) = 25 
thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
_poll(0x000001001012AA00, 1, 5000)    = 0 
close(4)          = 0 
socket(2, 2, 0)         = 4 
_esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F37C8, 16, 0x0000000000000000) = 25 
thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
_poll(0x000001001012AA00, 1, 10000)    = 0 
close(4)          = 0 
socket(2, 2, 0)         = 4 
_esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F37C8, 16, 0x0000000000000000) = 25 
thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
_poll(0x000001001012AA00, 1, 20000)    = 0 
close(4)          = 0 
getdomainname(0x000001001012CD10, 256)   = 0 
kopen("/etc/hosts", O_RDONLY)     = 4 
kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY 
kfcntl(4, F_SETFD, 0x0000000000000001)   = 0 
kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY 
kread(0x0000000000000004, 0x0000010010416538, 0x0000000000001000) = 0x00000000000007B0 
    0x00000000: " # = = = = = = = = = =".. 
kread(0x0000000000000004, 0x0000010010416538, 0x0000000000001000) = 0x0000000000000000 
    0x00000000: " # = = = = = = = = = =".. 
close(4)          = 0 
__libc_sbrk(0x0000000000020020)     = 0x0000010010421C20 

con marca de tiempo

1.8662:  socket(2, 2, 0)     = 4 
1.8666:  _esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F38A8, 16, 0x0000000000000000) = 25 
3.8671:  thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
1.8669:  _poll(0x000001001012AA00, 1, 5000) = 0 
6.8705:  close(4)       = 0 
6.8710:  socket(2, 2, 0)     = 4 
6.8715:  _esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F38A8, 16, 0x0000000000000000) = 25 
8.8723:  thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
6.8720:  _poll(0x000001001012AA00, 1, 5000) = 0 
11.8726:  close(4)      = 0 
11.8729:  socket(2, 2, 0)     = 4 
11.8732:  _esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F38A8, 16, 0x0000000000000000) = 25 
13.8738:  thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
11.8736:  _poll(0x000001001012AA00, 1, 10000) = 0 
21.8741:  close(4)      = 0 
21.8744:  socket(2, 2, 0)     = 4 
21.8748:  _esendto(4, 0x000001001012B860, 25, 0, 0x00000100103F38A8, 16, 0x0000000000000000) = 25 
23.8754:  thread_tsleep(0, 0x09001000A030F400, 0x0000000000000000, 0x0000000000000000) (sleeping...) 
21.8752:  _poll(0x000001001012AA00, 1, 20000) = 0 
41.8756:  close(4)      = 0 
41.8760:  getdomainname(0x000001001012CD10, 256) = 0 
41.8763:  kopen("/etc/hosts", O_RDONLY) = 4 
41.8767:  kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY 
41.8770:  kfcntl(4, F_SETFD, 0x0000000000000001) = 0 
41.8773:  kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY 
kread(0x0000000000000004, 0x0000010010416618, 0x0000000000001000) = 0x00000000000007B0 
    0x00000000: " # = = = = = = = = = =".. 
kread(0x0000000000000004, 0x0000010010416618, 0x0000000000001000) = 0x0000000000000000 
    0x00000000: " # = = = = = = = = = =".. 
41.8782:  close(4)      = 0 

tp

Quit in sem_wait at 0x9000000002632d8 ($t3) 
0x9000000002632d8 (sem_wait+0x98) e8410028   ld r2,0x28(r1) 

thread state-k  wchan   state-u k-tid mode held scope function 
>$t1  run       blocked 31391751 u no sys _event_sleep 
_event_sleep(??, ??, ??, ??, ??, ??) at 0x9000000008365c4 
_event_wait(??, ??) at 0x900000000837064 
_cond_wait_local(??, ??, ??) at 0x90000000084521c 
_cond_wait(??, ??, ??) at 0x900000000845808 
pthread_join(??, ??) at 0x90000000082d2b0 
unnamed block in ContinueInNewThread(continuation = 0x6c6f636b6c002e66, stack_size = 7310577395057127012, args = 0x5f6f72002e666574), line 2286 in "java_md.c" 
ContinueInNewThread(continuation = 0x6c6f636b6c002e66, stack_size = 7310577395057127012, args = 0x5f6f72002e666574), line 2286 in "java_md.c" 
unnamed block in main(argc = 0, argv = 0x000001001000c178), line 532 in "java.c" 
main(argc = 0, argv = 0x000001001000c178), line 532 in "java.c" 

thread state-k  wchan   state-u k-tid mode held scope function 
>$t2  run       running 54329549 u no sys __fd_poll 
__fd_poll(??, ??, ??) at 0x90000000012c0d4 
res_send.poll(??, ??, ??) at 0x9000000001021ac 
res_nsend(0x100103f37a8, 0x1001012b860, 0x1900000019, 0x1001012cbb0, 0x40000000400) at 0x9000000001011d4 
res_nquery(??, ??, ??, ??, ??, ??) at 0x90000000012b5d8 
res_nquerydomain(??, ??, ??, ??, ??, ??, ??) at 0x90000000012ab14 
res_nsearch(??, ??, ??, ??, ??, ??) at 0x90000000012af08 
res_search(??, ??, ??, ??, ??) at 0x900000000107b50 
dns_ho.ho_byname2(??, ??, ??) at 0x90000000013a384 
gen_ho.ho_byname2(??, ??, ??) at 0x900000000163888 
gethostbyname2(??, ??) at 0x9000000001060ec 
getaddrinfo2(??, ??, ??, ??, ??) at 0x900000000102ba0 
getaddrinfo(??, ??, ??, ??) at 0x900000000104d34 
j9sock_getaddrinfo() at 0x9000000053caad8 
populateRASNetData() at 0x900000005347fc0 
VMInitStages() at 0x9000000053086b0 
runJ9VMDllMain() at 0x90000000530bb9c 
pool.pool_do() at 0x9000000052f29c8 
runInitializationStage() at 0x90000000530b890 
protectedInitializeJavaVM() at 0x900000005306478 
j9sig_protect() at 0x9000000053a2b9c 
initializeJavaVM() at 0x90000000530585c 
jniinv.JNI_CreateJavaVM() at 0x90000000530ea14 
jvm.JNI_CreateJavaVM() at 0x900000000ccc510 
redirector.JNI_CreateJavaVM() at 0x900000000cb5574 
InitializeJVM(pvm = (nil), penv = (nil), ifn = (nil)), line 1801 in "java.c" 
main(argc = 0, argv = (nil)), line 810 in "java.c" 

thread state-k  wchan   state-u k-tid mode held scope function 
>$t3  run       running 52887625 k no sys sem_wait 
sem_wait(??) at 0x9000000002632d8 
asynchSignalReporter() at 0x9000000053a3dcc 
thread_wrapper() at 0x900000000d00ad0 

!!!! ThreadDump Completed- detached from debugger !!!! 

actualización

me encontré con este tema, y ​​probar el programa en mi AIX. Al utilizar el nombre de host, se retrasó unos 40 segundos para la consulta de DNS. La dirección IP es normal.

Java cannot resolve DNS address from AIX: UnknownHostException

Por cierto, el nombre de host muestra servidor3, cuando una bala el nombre, se muestra: server3.cf1.xx.xxxx.com PING ..... que ejecute el programa usando servidor3 .cf1.xx.xxxx.com, no hay demora.

Update2:

Es un problema IPV6. Si agrego -Djava.net.preferIPv4Stack = true, la aplicación Java funciona bien. Pero el comando java todavía usa IPV6 para consultar DNS. Así que el comando java tiene un retraso de 40 segundos, y la aplicación java no tiene inconveniente en la consulta de DNS.

¿Puedo establecer el protocolo predeterminado para IPV4 en AIX, no en el parámetro java?

Respuesta

1

Es difícil determinar qué tarda mucho tiempo en la salida de su truss (quizás vea si puede agregar marcas de tiempo a su salida, creo que Truss puede hacerlo), pero hay una gran cantidad de actividad getdomainname, que siempre es principal sospechoso cuando se investigan retrasos de inicio extraños. Compruebe si hay un nombre de host no válido asignado a este cuadro, asegúrese de que el nombre de host principal se resuelva en 127.0.0.1 en/etc/hosts.

+0

que añadir marcas de tiempo . Los anfitriones no son un problema. 127.0.0.1 loopback localhost # loopback (lo0) nombre/dirección 192.168.62.117 servidor3 – culy

4

no estoy 100% seguro de esto, pero es al menos vale la pena intentarlo:

En AIX, el 32 bits Java VM utiliza IPv4 como el protocolo IP por defecto, mientras que el 64 bits VM utiliza IPv6. Si IPv6 está habilitado en el sistema operativo, pero está configurado incorrectamente, la máquina virtual de 64 bits puede parecer colgada en diferentes puntos, donde realmente está esperando los tiempos de espera de la red. Esto parece coincidir con su análisis con truss.

Usted puede tratar de iniciar la máquina virtual con 64 bits IPv4 como la pila de red preferido, añadiendo la siguiente opción para el comando java:

-Djava.net.preferIPv4Stack = true

+0

Lo intenté, no funciona. – culy

+1

¿Puede obtener un volcado de hilo de la máquina virtual enviándole una señal de SALIR (kill -QUIT ) durante el inicio? Si es así, ¿es obvio desde el volcado de subprocesos donde se cuelga la máquina virtual? – jarnbjo

+0

Sí, puedo obtener coredump. Salir en sem_wait en 0x9000000002632d8 ($ t3) 0x9000000002632d8 (sem_wait + 0x98) e8410028 ld r2,0x28 (r1) – culy