|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
linux risultato top
12:02:22 up 16:18, 2 users, load average: 2.89, 4.16, 4.55
56 processes: 53 sleeping, 3 running, 0 zombie, 0 stopped CPU states: cpu user nice system irq softirq iowait idle total 24.6% 0.0% 0.8% 0.0% 6.2% 0.0% 68.3% cpu00 48.8% 0.0% 1.6% 0.0% 0.0% 0.0% 49.6% cpu01 0.0% 0.0% 0.0% 0.0% 24.8% 0.0% 75.2% cpu02 49.6% 0.0% 1.8% 0.0% 0.0% 0.0% 48.6% cpu03 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0% Mem: 2061424k av, 578440k used, 1482984k free, 0k shrd, 141720k buff 202260k active, 215288k inactive Swap: 2618512k av, 0k used, 2618512k free 185600k cached Ho la macchina in questo stato questi valori mi preccupano un po load average: 2.89, 4.16, 4.55. Sulla macchina gira solamente un database è è lui che mi manda in affanno la cpu 25255 postgres 25 0 6332 6332 4204 R 16.2 0.3 0:05 3 postmaster 25264 postgres 25 0 6316 6316 4204 R 15.9 0.3 0:03 2 postmaster 25262 postgres 25 0 6316 6316 4204 R 14.9 0.3 0:03 2 postmaster 25259 postgres 25 0 6324 6324 4204 R 13.9 0.3 0:05 0 postmaster 25257 postgres 25 0 6312 6312 4204 R 12.0 0.3 0:04 2 postmaster 25265 postgres 23 0 5384 5384 4204 R 5.2 0.2 0:01 1 postmaster 25267 postgres 23 0 6284 6284 4172 R 2.5 0.3 0:00 3 postmaster 25269 postgres 23 0 6280 6280 4172 R 2.4 0.3 0:00 0 postmaster 25270 postgres 23 0 6284 6284 4172 R 2.3 0.3 0:00 3 postmaster oltre ad un intervento hardware come potrei ottimizzare la macchina? o meglio il db? potrebbero essere delle query molto pesanti? Con una indicizzazione potrei migliorare la situazione? Grazie |
|
|
|
|
|
#2 | |
|
Senior Member
Iscritto dal: Dec 2005
Città: Istanbul
Messaggi: 1817
|
Quote:
__________________
One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions. —Guy Steele |
|
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
in questo caso la cpu è scarica ma arrivo a valori di 100%
CPU states: cpu user nice system irq softirq iowait idle total 98.6% 0.0% 1.3% 0.0% 0.0% 0.0% 0.0% cpu00 99.0% 0.0% 1.0% 0.0% 0.0% 0.0% 0.0% cpu01 98.0% 0.0% 2.0% 0.0% 0.0% 0.0% 0.0% cpu02 99.0% 0.0% 1.0% 0.0% 0.0% 0.0% 0.0% cpu03 98.6% 0.0% 1.4% 0.0% 0.0% 0.0% 0.0% il problema dovrebbe essere delle query suppongo questo perchè facendo top c 9408 postgres 25 0 6352 6352 4224 R 11.6 0.3 0:03 2 postgres: postgres site_metro_db x.X.X.X SELECT 9414 postgres 25 0 5592 5592 4252 R 6.4 0.2 0:01 3 postgres: postgres site_metro_db x.X.X.X SELECT 9415 postgres 25 0 5592 5592 4252 R 3.4 0.2 0:00 1 postgres: postgres site_metro_db x.X.X.X SELECT 941 es spesso raggiungo alnche il 30% per un query. Tu sai come posso vedere quali sono le select che impegnano di + òa macchina? |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
faccio una cosa del genere ma non riesco a capirci nulla
tcpdump -X -x -s 8192 -i any port 5432 |
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: Oct 2000
Città: bergamo
Messaggi: 713
|
ciao, con tcpdump intercetti le query che viaggiano via rete... non so se è la soluzione migliore.
ti consiglio un paio di link http://www.varlena.com/GeneralBits/Tidbits/perf.html http://www.revsys.com/writings/postg...rformance.html in particolare nel secondo ti spiega l'index e le statistics che ti dovrebbero aiutare a capire dove sta il problema. spero di esserti stato utile, Marco - Goblin |
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
grazie abilitando alcune opzioni di postgres sono riuscito a prendere la query che rompe...
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 06:00.



















