From: "Дмитрий Дегтярев" <ddv@bgc.perm.ru>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: [sisyphus] течёт psql?
Date: Thu, 14 Apr 2011 10:37:33 +0600
Message-ID: <4DA67A0D.2090605@bgc.perm.ru> (raw)
Добрый день!
Есть задача залить данные из файла некоего формата в субд.
С помощью awk формирую строки вида
select myprocedure(param1, param2, ..., paramn);
процедура раскидывает данные по таблицам
всего строк 8-9 миллионов в день нужно загонять в базу.
Если делать так
$ awk '{print ....}' | psql -U user -d db -h host.local
то через пару минут psql уже занял 1,5 ГБ ОЗУ и пришлось прервать, т.к.
всё залезло в своп.
если сформировать сначала файл(довольно быстро, 2-3 минуты), а потом
psql -U user -d db -h host.local -f file.sql
то занимает в ОЗУ всего 6Кб. Работает так минут 15, а затем начинает всё
свопиться, смотрю память psql опять занял 1,5 Гб. Опять останавливаю.
Утечка в psql? Или в либе какой?
Как залить дамп размером 3Гб в базу?
система последний sisyphus
ЗЫ:
сейчас заливаю так
$ awk '{print ....}' | while read l; do
echo $l | psql -U user -d db -h host.local
done;
это не реально долго из-за 8000000 лишних запусков psql, реконнектов к
базе...
next reply other threads:[~2011-04-14 4:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-14 4:37 Дмитрий Дегтярев [this message]
2011-04-14 4:46 ` REAL
2011-04-14 4:50 ` Дмитрий Дегтярев
2011-04-14 5:01 ` REAL
2011-04-14 5:44 ` Дмитрий Дегтярев
2011-04-14 5:34 ` Eugene Prokopiev
2011-04-14 6:16 ` Andrey Liakhovets
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA67A0D.2090605@bgc.perm.ru \
--to=ddv@bgc.perm.ru \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git