set 202010
 

Uma aplicação em WebSphere ficou fora do ar. Verificando os Logs do FFDC (First Failure Data Capture), encontrei esta Exception:

------Start of DE processing------ = [15/09/10 15:20:08:591 BRT] , key = java.net.SocketException com.ibm.ws.http.HttpTranspo
rt.run 153
Exception = java.net.SocketException
Source = com.ibm.ws.http.HttpTransport.run
probeid = 153
Stack Dump = java.net.SocketException: Muitos arquivos abertos
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:457)
at java.net.ServerSocket.implAccept(ServerSocket.java:473)
at com.ibm.jsse2.hc.accept(hc.java:72)
at com.ibm.ws.http.HttpTransport.run(HttpTransport.java:456)
at java.lang.Thread.run(Thread.java:810)
Dump of callerThis =
null
Exception = java.net.SocketException
Source = com.ibm.ws.http.HttpTransport.run
probeid = 153
Dump of callerThis =
null

Pesquisei sobre outras ocorrências do erro no diretório de Logs do FFDC, que indicava erros de Socket, provavelmente provenientes do erro acima.

[wasusr@MeuServidor ffdc]$ grep "Muitos arquivos abertos" MinhaAplicação_*
MinhaApp_00000080_10.09.15_15.17.22_0.txt:Stack Dump = java.lang.Exception: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000080_10.09.15_15.17.22_0.txt:Caused by: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000080_10.09.15_15.17.22_1.txt: faultString: WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000080_10.09.15_15.17.22_1.txt:WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000080_10.09.15_15.17.22_2.txt: faultString: WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000080_10.09.15_15.17.22_2.txt:WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_0000008a_10.09.15_13.35.43_0.txt:Stack Dump = javax.servlet.ServletException: /cbssconfig/deploy/VisaVale.ear/VisaVale.war/inst/images/titCentralAtendimento.gif (Muitos arquivos abertos)
MinhaApp_00000092_10.09.15_14.14.33_0.txt:Stack Dump = java.lang.Exception: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000092_10.09.15_14.14.33_0.txt:Caused by: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000092_10.09.15_14.14.33_1.txt: faultString: WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000092_10.09.15_14.14.33_1.txt:WSWS3713E: A conex�o com o host remoto paystudioservices.fnis.com.br falhou. O seguinte erro foi recebido: java.net.SocketException: Muitos arquivos abertos
MinhaApp_000000aa_10.09.15_15.20.08_0.txt:Stack Dump = java.net.SocketException: Muitos arquivos abertos
MinhaApp_00000607_10.09.15_14.15.10_0.txt:Stack Dump = java.net.SocketException: Muitos arquivos abertos
MinhaApp_00009aff_10.09.15_11.41.02_0.txt:Stack Dump = java.util.zip.ZipException: Muitos arquivos abertos /share_pat/libs/Web/commons-dbcp-1.2.1.jar

O motivo é que o limite de arquivos abertos permitidos pelo usuário do WebSphere estava em 1024. O recomendado pela documentação é 8096.

[wasusr@MeuServidor ffdc]$ ulimit -n
1024

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tins_linuxsetup.html

Alteramos para 8096, mas alguns dias depois o mesmo problema ocorreu. Verifiquei que esta Aplicação permite Download e Upload de arquivos, e envio de emails. Alteramos então para 65536.

Este limite deve ser configurado no arquivo /etc/security/limits.conf e no .bash_profile do usuário owner do WebSphere, e a aplicação deve ser reiniciada.

[wasusr@MeuServidor ffdc]$ cat /opt/IBM/WAS/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
ulimit -n 65536
[wasusr@MeuServidor ffdc]$
[solvo@MeuServidor MinhaApp]$ cat /etc/security/limits.conf | grep wasusr
wasusr               soft    nofile  8192
wasusr               hard    nofile  65536
[wasusr@MeuServidor ffdc]$
ago 192010
 

O Desempenho no WebSphere pode ser monitorado pelo Integrated Solutions Console, conforme print abaixo. No Submenu Current Activity, selecione o servidor.

Na tela inicial do Tivoli Performance Viewer, apenas são mostradas os componentes e as estatísticas de requisições.

Abra o Submenu Performance Modules, e escolha os módulos que serão monitorados.

No exemplo abaixo, eu escolhi apenas a monitoração do JVM Runtime.

Após a seleção dos Módulos, clique em View Modules, e os contares serão apresentados, em números e gráfico de linha.

Apenas alguns contadores são habilitados por padrão. Para adicionar ou remover contadores, vá no Submenu Performance Monitoring Infraestructure (PMI).

Neste Submenu, você pode selecionar todos os contadores (All), ou escolher apenas os que deseja, em Custom.

Selecione os contadores e clique em Enable. Eu escolhi todos os de Garbage Collection. Em outro post, explicarei o porque.

Lembre-se de salvar as configurações alteradas no master configuration.

Depois, o servidor precisa ser reiniciado para ativar os contadores.

[root@centos5-01 ~]# /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1 -username administrator -password Nerv2010
ADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed.
[root@centos5-01 ~]# /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1
ADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 4148
[root@centos5-01 ~]#
ago 092010
 

O Websphere 6.1 também se sai mal com a configuração padrão no Teste de Escalabilidade Simples, também feito com Apache 2.2.3 e IIS 7.

O Websphere também está em uma VM, similar aos testes com Apache e IIS.

ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102:9080/PlantsByWebSphere/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
apr_socket_recv: Connection timed out (110)
Total of 3902 requests completed
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102:9080/PlantsByWebSphere/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
apr_socket_recv: Connection timed out (110)
Total of 3202 requests completed
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102:9080/PlantsByWebSphere/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
apr_socket_recv: Connection timed out (110)
Total of 6273 requests completed
ricardo@ricardo-laptop:~$
jul 292010
 

O WebSphere pode ser administrado pelo utilitário de linha de comando wsadmin, ou pelo Console Web, chamado de Integrated Solutions Console.

Para acessa-lo, é necessário utilizar um usuário e senha do WebSphere. Dependendo da categoria do usuário (Administrator, Configurator, Operator), algumas opções podem estar desabilitadas.

Sendo que instalei o WebSphere no IP 192.168.56.101, esta é a URL padrão de acesso ao Console:

https://192.168.56.101:9043/ibm/console/logon.jsp

jul 292010
 

Para parar o WebSphere, deve ser utilizado o script stopServer.sh que fica no diretório bin do Profile que está sendo administrado.

Deve ser mencionado como argumento qual o Server que será parado.

Esta operação requer autenticação via usuário e senha, de um usuário administrador do WebSphere.

[root@centos5-01 ~]# /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1 -username administrator -password Nerv2010
ADMU0116I: Tool information is being logged in file
 /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed.
jul 292010
 

Para iniciar o WebSphere, deve ser utilizado o script startServer.sh que fica no diretório bin do profile que está sendo administrado.

Deve ser mencionado como argumento qual o Server que será iniciado.

Esta é a única atividade administrativa do WebSphere que não requer autenticação de usuário e senha.

[root@centos5-01 ~]# /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1
ADMU0116I: Tool information is being logged in file
 /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 18261
[root@centos5-01 ~]#