![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I run a Perl/CGI driven website that makes extensive use of PostgreSQL (7.4.3) for everything from user information to formatting and display of specific sections of the site. The server itself, is a dual processor AMD Opteron 1.4Ghz w/ 2GB Ram and 2 x 120GB hard drives mirrored for redundancy running under FreeBSD 5.2.1 (AMD64). Recently loads on the site have increased during peak hours to the point of showing considerable loss in performance. This can be observed when connections move from the 120 concurrent connections to PostgreSQL to roughly 175 or more. Essentially, the machine seems to struggle to keep up with continual requests and slows down respectively as resources are tied down. Code changes have been made to the scripts to essentially back off in high load working environments which have worked to an extent. However, as loads continue to increase the database itself is not taking well to the increased traffic taking place. Having taken a look at 'Tuning PostgreSQL for Performance' (http://www.varlena.com/GeneralBits/Tidbits/perf.html) using it as best I could in order to set my settings. However, even with statistics disabled and ever setting tweaked things still consider to deteriorate. Is there anything anyone can recommend in order to give the system a necessary speed boost? It would seem to me that a modest dataset of roughly a Gig combined with that type of hardware should be able to handle substantially more load then what it is. Can anyone provide me with clues as where to pursue? Would disabling 'fsync' provide more performance if I choose that information may be lost in case of a crash? If anyone needs access to logs, settings et cetera. Please ask, I simply wish to test the waters first on what is needed. Thanks! |
#3
| |||
| |||
|
|
On Tue, 2004-08-03 at 12:05, Martin Foster wrote: I run a Perl/CGI driven website that makes extensive use of PostgreSQL (7.4.3) for everything from user information to formatting and display of specific sections of the site. The server itself, is a dual processor AMD Opteron 1.4Ghz w/ 2GB Ram and 2 x 120GB hard drives mirrored for redundancy running under FreeBSD 5.2.1 (AMD64). Recently loads on the site have increased during peak hours to the point of showing considerable loss in performance. This can be observed when connections move from the 120 concurrent connections to PostgreSQL to roughly 175 or more. Essentially, the machine seems to struggle to keep up with continual requests and slows down respectively as resources are tied down. Code changes have been made to the scripts to essentially back off in high load working environments which have worked to an extent. However, as loads continue to increase the database itself is not taking well to the increased traffic taking place. Having taken a look at 'Tuning PostgreSQL for Performance' (http://www.varlena.com/GeneralBits/Tidbits/perf.html) using it as best I could in order to set my settings. However, even with statistics disabled and ever setting tweaked things still consider to deteriorate. Is there anything anyone can recommend in order to give the system a necessary speed boost? It would seem to me that a modest dataset of roughly a Gig combined with that type of hardware should be able to handle substantially more load then what it is. Can anyone provide me with clues as where to pursue? Would disabling 'fsync' provide more performance if I choose that information may be lost in case of a crash? If anyone needs access to logs, settings et cetera. Please ask, I simply wish to test the waters first on what is needed. Thanks! Are you properly vacuuming the database and have you set your fsm settings high enough? You may need to do a vacuum full first to reclaim lost space. Post your postgresql.conf settings if you can. |
#4
| |||
| |||
|
|
I run a Perl/CGI driven website that makes extensive use of PostgreSQL (7.4.3) for everything from user information to formatting and display of specific sections of the site. The server itself, is a dual processor AMD Opteron 1.4Ghz w/ 2GB Ram and 2 x 120GB hard drives mirrored for redundancy running under FreeBSD 5.2.1 (AMD64). Recently loads on the site have increased during peak hours to the point of showing considerable loss in performance. This can be observed when connections move from the 120 concurrent connections to PostgreSQL to roughly 175 or more. Essentially, the machine seems to struggle to keep up with continual requests and slows down respectively as resources are tied down. Code changes have been made to the scripts to essentially back off in high load working environments which have worked to an extent. However, as loads continue to increase the database itself is not taking well to the increased traffic taking place. Having taken a look at 'Tuning PostgreSQL for Performance' (http://www.varlena.com/GeneralBits/Tidbits/perf.html) using it as best I could in order to set my settings. However, even with statistics disabled and ever setting tweaked things still consider to deteriorate. Is there anything anyone can recommend in order to give the system a necessary speed boost? It would seem to me that a modest dataset of roughly a Gig combined with that type of hardware should be able to handle substantially more load then what it is. Can anyone provide me with clues as where to pursue? Would disabling 'fsync' provide more performance if I choose that information may be lost in case of a crash? If anyone needs access to logs, settings et cetera. Please ask, I simply wish to test the waters first on what is needed. Thanks! Martin Foster martin (AT) ethereal-realms (DOT) org ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org |
#5
| |||
| |||
|
|
I run a Perl/CGI driven website that makes extensive use of PostgreSQL (7.4.3) for everything from user information to formatting and display of specific sections of the site. The server itself, is a dual processor AMD Opteron 1.4Ghz w/ 2GB Ram and 2 x 120GB hard drives mirrored for redundancy running under FreeBSD 5.2.1 (AMD64). Recently loads on the site have increased during peak hours to the point of showing considerable loss in performance. This can be observed when connections move from the 120 concurrent connections to PostgreSQL to roughly 175 or more. Essentially, the machine seems to struggle to keep up with continual requests and slows down respectively as resources are tied down. |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
date_close -------------------+--------------------+------------------+---------------- |
#8
| |||
| |||
|
|
I have tried again to copy using a suggestion sent to me from another new user on the list: Attempt 1 -- TEST_DB=# copy matters from '/home/floog/TEST_DB.csv' delimiter ','; ERROR: could not open file "/home/floog/TEST_DB.csv" for reading: Permission denied Okay, so I chmod the file to be read/write by anyone -- (chmod 0777 /home/floog/TEST_DB.csv) TEST_DB=# copy matters from '/home/floog/TEST_DB.csv' delimiter ','; ERROR: could not open file "/home/floog/TEST_DB.csv" for reading: Permission denied |
|
Still no go so I copied the file into my PGDATA directory - /usr/local/postgres TEST_DB=# copy matters from '/usr/local/postgres/TEST_DB.csv' delimiter ','; ERROR: invalid input syntax for integer: ""CFW"" CONTEXT: COPY matters, line 1, column matter_num: ""CFW"" TEST_DB=# select * from matters; .... (0 rows) I understand the first error about the "CFW" being in a field designated in an integer format. That's okay. CFW are the initials of a person at my office and that's just a data entry error -- wrong data in the wrong column. But I don't understand why none of the data from the .csv file was copied to the database. SELECT * FROM matters - results in nothing but a line of hyphens. |
#9
| |||
| |||
|
|
I have tried to COPY the contents of the .csv file into my database called TEST_DB, but I'm still doing something incorrectly. Currently, database TEST_DB has one table called "matters". In my attempts listed below, I specified the name of each column/field in my database and specified the delimiter used in the .csv file, but still no go: TEST_DB-# copy matters (client_1_lastname, client_1_firstname, .... date_close) from '/home/floog/TEST_DB.csv' DELIMITER ','; ERROR: syntax error at or near "client_1_lastname" at character 2 .... What did I do incorrectly? |
#10
| |||
| |||
|
|
You had a previous line without a terminating semi-colon. Notice that the prompt (TEST_DB-# rather than TEST_DB=#) indicates that this is a continuation line. |
![]() |
| Thread Tools | |
| Display Modes | |
| |