De acordo com as Leis 12.965/2014 e 13.709/2018, que regulam o uso da Internet e o tratamento de dados pessoais no Brasil, ao me inscrever na newsletter do portal DICAS-L, autorizo o envio de notificações por e-mail ou outros meios e declaro estar ciente e concordar com seus Termos de Uso e Política de Privacidade.
Colaboração: Allan Jones
Data de Publicação: 02 de Janeiro de 2006
Recentemente me deparei com um problema em uma maquina SUN (Sun Blade 100).
Alguns servicos da minha gerencia nao estavam "startando", entao apos tanto buscar informacoes no site da Sun e analisar algumas mensagens (/var/adm/) descobri que o problema estava na insuficiencia de memoria swap, o erro que estava retornando para todos os servicos que nao "startavam" era => failed: Resource temporarily unavailable.
Um bom teste para saber se isso ocorre e tentar mover um arquivo grande de uma pasta para outra, retornara o seguinte codigo de erro => No space left on device.
Abaixo segue um script para coletar as informacoes (rodei o script no home do usuario root):
#! /bin/sh #### # # Developer: Allan Jones # #### mkdir swap_tmp_check CHECK_FILE="swap_tmp_check/check_file.log" echo "### BEGIN: swap -s ###" >> $CHECK_FILE swap -s >> $CHECK_FILE echo "### END: swap -s ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: swap -l ###" >> $CHECK_FILE swap -l >> $CHECK_FILE echo "### END: swap -l ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df ###" >> $CHECK_FILE df >> $CHECK_FILE echo "### END: df ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df -t ###" >> $CHECK_FILE df -t >> $CHECK_FILE echo "### END: df -t ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df -k ###" >> $CHECK_FILE df -k >> $CHECK_FILE echo "### END: df -k ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df -n ###" >> $CHECK_FILE df -n >> $CHECK_FILE echo "### END: df -n ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df /tmp ###" >> $CHECK_FILE df /tmp >> $CHECK_FILE echo "### END: df /tmp ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: df /swap ###" >> $CHECK_FILE df /swap >> $CHECK_FILE echo "### END: df /swap ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: vmstat 10 10 ###" >> $CHECK_FILE vmstat 10 10 >> $CHECK_FILE echo "### END: vmstat 10 10 ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: vmstat -p 10 10 ###" >> $CHECK_FILE vmstat -p 10 10 >> $CHECK_FILE echo "### END: vmstat -p 10 10 ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: iostat 10 10 ###" >> $CHECK_FILE iostat 10 10 >> $CHECK_FILE echo "### END: iostat 10 10 ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: ipcs -mb ###" >> $CHECK_FILE ipcs -mb >> $CHECK_FILE echo "### END: ipcs -mb ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: cat /etc/vfstab ###" >> $CHECK_FILE cat /etc/vfstab >> $CHECK_FILE echo "### END: cat /etc/vfstab ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: cat /etc/system ###" >> $CHECK_FILE cat /etc/system >> $CHECK_FILE echo "### END: cat /etc/system ###" >> $CHECK_FILE echo "" >> $CHECK_FILE echo "### BEGIN: cat /var/adm/messages ###" >> $CHECK_FILE cat /var/adm/messages >> $CHECK_FILE echo "### END: cat /var/adm/messages ###" >> $CHECK_FILE echo "" >> $CHECK_FILE tar -cvf swap_tmp_check.tar /swap_tmp_check rm -R /swap_tmp_check
Para extender a memoria swap, siga o seguinte procedimento:
# mkdir /swap/files # cd /swap/files # pwd /swap/files
# swap -s total: 815216k bytes allocated + 1030792k reserved = 1846008k used, 3640k available
# mkfile -v 3000m swap_extend_20050915 swap_extend_20050915 3145728000 bytes # ls -l total 6147024 -rw------T 1 root other 3145728000 Sep 15 10:12 swap_extend_20050915
# swap -a /swap/files/swap_extend_20050915
# swap -l swapfile dev swaplo blocks free /dev/dsk/c0t0d0s1 136,1 16 2101184 1781456 /swap/files/swap_extend_20050915 - 16 6143984 6143984 # swap -s total: 815376k bytes allocated + 1030904k reserved = 1846280k used, 3073616k availablePode-se verificar no item (2) e (5) a diferencia de memoria disponivel. Apos esse procedimento os servicos de minha gerencia "startaram" corretamente.
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Comentários