I have a php script that every hour from ftp takes txt files (about 3000 rows), parse it ant import in postgresql.
When script is running "top" command shows me 70-80% loading of one of CPU, and importing takes about 5-10 seconds.
After inserting - i don't see work of autovacuum process.
Now i write another script (runs once a day and work simultaneously with ftp loader script), it takes from email csv file(about 500 000 rows) parse and also import in database (in most cases update - duration 5 min).
After such import autovacuum is running.
But when autovacuum is finishes his job - the script, that takes file from ftp lasts about 5 minutes ( not 5-10 seconds as before ) and "top" show about 10-12 % usage of CPU.
In next hour script is runnning about 2 minutes and uses about 20% of CPU.
And in next hour about 30 sec, and then as usual 5-10 sec width 70-80% CPU loading.
What can be the cause of so different CPU loading.
When script is running "top" command shows me 70-80% loading of one of CPU, and importing takes about 5-10 seconds.
After inserting - i don't see work of autovacuum process.
Now i write another script (runs once a day and work simultaneously with ftp loader script), it takes from email csv file(about 500 000 rows) parse and also import in database (in most cases update - duration 5 min).
After such import autovacuum is running.
But when autovacuum is finishes his job - the script, that takes file from ftp lasts about 5 minutes ( not 5-10 seconds as before ) and "top" show about 10-12 % usage of CPU.
In next hour script is runnning about 2 minutes and uses about 20% of CPU.
And in next hour about 30 sec, and then as usual 5-10 sec width 70-80% CPU loading.
What can be the cause of so different CPU loading.