That's exactly what the pgsql_tmp directory is for think of it as swap space<br><br><span style="font-family:Prelude, Verdana, san-serif;"><br><br></span><span id="signature"><div style="font-family: arial, sans-serif; font-size: 12px;color: #999999;">-- Sent from my HP Pre3</div><br></span><span style="color:navy; font-family:Prelude, Verdana, san-serif; "><hr align="left" style="width:75%">On May 3, 2014 20:36, Jon Miller <jonebird@gmail.com> wrote: <br><br></span>That's another fine suggestion though I still believe the issues were/are <br>still related to the actual SQL queries being ran. I completed my planned <br>routine last evening but just recreating the DB and reloading my backup <br>didn't change anything. I then changed the following PostgreSQL tunables: <br>- shared_buffers from (default?) 32MB => 2048MB <br>- work_mem from 1MB => 20MB <br>- maintenance_work_mem from 16MB => 300MB <br> <br>After changing those, I'm able to run the SELECT version of that pesky query <br>that I was unable to complete before. So, that's a victory but unfortunately <br>I'm still staring at a fluctuating file system size. It is now going from 52G <br>available down to nothing in 11min and then presumably something is removed <br>and the cycle from 52G free repeats. <br> <br>When I use "inotifywatch" to help characterize the activity on the filesystem <br>(limited to opens and creates), I get the following: <br>  $ inotifywatch -r /local/mnt -e open -e create <br>  Establishing watches... <br>  Finished establishing watches, now collecting statistics. <br>  total    open     create  filename <br>  2990751  2986326  4425    /local/mnt/workspace/pgsql/data/base/pgsql_tmp/ <br>  780         780   0       /local/mnt/workspace/pgsql/data/base/314186/ <br>  710         682   28      /local/mnt/workspace/pgsql/data/pg_stat_tmp/ <br>  154         154   0       /local/mnt/workspace/pgsql/data/global/ <br>  77          77    0       /local/mnt/openv/var/host_cache/ <br>  49          25    24      /local/mnt/openv/var/host_cache/19a/ <br>  33          17    16      /local/mnt/openv/var/host_cache/021/ <br>  ... <br> <br>So, that's why I keep my attention on the DB. And now when I look for what <br>queries are running, I keep seeing only this one: <br> <br>SELECT DISTINCT snv.server_id AS server_id, S.name, S.release, SA.name as arch, urn.user_id <br>   FROM (select rhnChannelErrata.errata_id, rhnChannelErrata.channel_id, rhnServerChannel.server_id,rhnErrataPackage.package_id <br>          from rhnChannelErrata, rhnErrataPackage, rhnChannelNewestPackage, rhnPackageEVR, <br>               rhnServerChannel, rhnServerPackage, rhnPackageUpgradeArchCompat <br>          where rhnChannelErrata.errata_id = rhnErrataPackage.errata_id <br>            and rhnChannelErrata.channel_id = rhnChannelNewestPackage.channel_id <br>            and rhnErrataPackage.package_id = rhnChannelNewestPackage.package_id <br>            and rhnChannelErrata.channel_id = rhnServerChannel.channel_id <br>            and rhnChannelNewestPackage.name_id = rhnServerPackage.name_id <br>            and rhnServerChannel.server_id = rhnServerPackage.server_id <br>            and rhnChannelNewestPackage.evr_id = rhnPackageEVR.id <br>            and rhnServerPackage.package_arch_id = rhnPackageUpgradeArchCompat.package_arch_id <br>            and rhnPackageUpgradeArchCompat.pack ) <br> <br>Does PostgreSQL use pgsql_tmp space when queries can not be performed within <br>working memory? <br> <br>Thanks again, <br>Jon Miller <br> <br>Paul Robert Marino <prmarino1@gmail.com> writes: <br> <br>> Try increasing taskomatics working memory. I had a similar issue recently <br>> with taskomatic where my repo syncs were using more ram than allowed. The <br>> default is 1 GB I increase it to two and my problem went away <br>> <br>> -- Sent from my HP Pre3 <br>> <br>> --------------------------------------------------------------------------- <br>> On May 2, 2014 19:01, Jon Miller <jonebird@gmail.com> wrote:  <br>> <br>> My current plan is to stop Spacewalk this evening, dump the DB, recreate <br>> the  <br>> DB and load my data back. Why? I was troubleshooting another issue related <br>> to  <br>> clients that use a Spacewalk proxy. While I was strace'ing Tomcat, I found  <br>> that forked processes were segfault'ing and the thing they did just before  <br>> was reading from a PostgreSQL socket. My evening procedure is going off the  <br>> theory that my DB is somehow corrupted.  <br>> <br>> Meanwhile, here are some specs on our Spacewalk server:  <br>> - VMware instance running RHEL 6.4  <br>> + 8GB of memory, 2 vCPUs  <br>> - PosgresSQL version 8.4.13-1.el6_3.x86_64  <br>> - Spacewalk version 2.0.1-1 (spacewalk-postgresql)  <br>> <br>> Thanks for the interest,  <br>> Jon Miller  <br>> <br>> Paul Robert Marino <prmarino1@gmail.com> writes:  <br>> <br>>> Increase your working memory. Also increase your maintenance working  <br>>> memory.  <br>>> That will help but we need to know more details before we can help.  <br>>> The exact specs of the box.  <br>>> The PostgreSQL configuration.  <br>>> The exact version of PostgreSQL you are running there are huge <br>> differences  <br>>> between 8 and 9.  <br>>> What OS and version you are running on. For example I run PostgreSQL 9.x <br>> on  <br>>> RHEL 6 which causes huge problems unless you change the default java <br>> driver  <br>>> which was at the time I did it a manual operation. And this can also be a  <br>>> problem for external PostgreSQL databases.  <br>>>  <br>>> -- Sent from my HP Pre3  <br>>>  <br>>> - <br>> --------------------------------------------------------------------------  <br>>> On May 1, 2014 21:52, Jon Miller <jonebird@gmail.com> wrote:  <br>>>  <br>>> Chris <dmagick@gmail.com> writes:  <br>>>  <br>>>>> Thanks for the reply. I wondered if I could do that but it would have  <br>>> been a  <br>>>>> while before I would have came up with that query. Perhaps upstream  <br>>> folks  <br>>>>> would like to test that version for Task_queries.xml within the git  <br>>> repo.  <br>>>>>  <br>>>>> Like before, I like to turn it into a "select count(*)" version first <br>> as  <br>>> a  <br>>>>> test. I ran it and forgot about it until I realized it was still <br>> running  <br>>> and  <br>>>>> killed it after ~3.5hours.  <br>>>>>  <br>>>>> spaceschema=# select count(*) from rhnPackageChangeLogData where id in  <br>>>>> spaceschema-# (SELECT d.id from rhnPackageChangeLogData d  <br>>>>> spaceschema(# left join rhnPackageChangeLogRec l on  <br>>> (d.id=l.changelog_data_id)  <br>>>>> spaceschema(# where l.changelog_data_id is null);  <br>>>>> ^C  <br>>>>> Session terminated, killing shell... ...killed.  <br>>>>  <br>>>> Yikes.  <br>>>>  <br>>>> Time to check indexes? Check there is one on  <br>>>> rhnpackagechangelogrec(changelog_data_id):  <br>>>>  <br>>>> spacewalk=# \d rhnpackagechangelogrec  <br>>>> Table "public.rhnpackagechangelogrec"  <br>>>> Column | Type | Modifiers  <br>>>> -------------------+--------------------------+------------------------  <br>>>> id | numeric | not null  <br>>>> package_id | numeric | not null  <br>>>> changelog_data_id | numeric | not null  <br>>>> created | timestamp with time zone | not null default now()  <br>>>> modified | timestamp with time zone | not null default now()  <br>>>> Indexes:  <br>>>> "rhn_pkg_clr_id_pk" PRIMARY KEY, btree (id)  <br>>>> "rhn_pkg_clr_pid_cld_uq" UNIQUE, btree (package_id, changelog_data_id)  <br>>>> "rhn_pkg_clr_cld_uq" btree (changelog_data_id)  <br>>>>  <br>>>> <snip>  <br>>>  <br>>> Yes, I have the same indexes:  <br>>> spaceschema=# \d rhnpackagechangelogrec  <br>>> Table "public.rhnpackagechangelogrec"  <br>>> Column | Type | Modifiers  <br>>> -------------------+--------------------------+------------------------  <br>>> id | numeric | not null  <br>>> package_id | numeric | not null  <br>>> changelog_data_id | numeric | not null  <br>>> created | timestamp with time zone | not null default now()  <br>>> modified | timestamp with time zone | not null default now()  <br>>> Indexes:  <br>>> "rhn_pkg_clr_id_pk" PRIMARY KEY, btree (id)  <br>>> "rhn_pkg_clr_pid_cld_uq" UNIQUE, btree (package_id, changelog_data_id)  <br>>> "rhn_pkg_clr_cld_uq" btree (changelog_data_id)  <br>>>  <br>>>> and the one on 'id' in changelogData should be there because it's a  <br>>>> primary key:  <br>>>>  <br>>>> spacewalk=# \d rhnpackagechangelogdata  <br>>>> Table "public.rhnpackagechangelogdata"  <br>>>> Column | Type | Modifiers  <br>>>> ---------+--------------------------+------------------------  <br>>>> id | numeric | not null  <br>>>> name | character varying(128) | not null  <br>>>> text | character varying(3000) | not null  <br>>>> time | timestamp with time zone | not null  <br>>>> created | timestamp with time zone | not null default now()  <br>>>> Indexes:  <br>>>> "rhn_pkg_cld_id_pk" PRIMARY KEY, btree (id)  <br>>>>  <br>>>> <snip>  <br>>>  <br>>> Same here as well or perhaps an extra one? (maybe you snipped too much?)  <br>>> spaceschema=# \d rhnpackagechangelogdata  <br>>> Table "public.rhnpackagechangelogdata"  <br>>> Column | Type | Modifiers  <br>>> ---------+--------------------------+------------------------  <br>>> id | numeric | not null  <br>>> name | character varying(128) | not null  <br>>> text | character varying(3000) | not null  <br>>> time | timestamp with time zone | not null  <br>>> created | timestamp with time zone | not null default now()  <br>>> Indexes:  <br>>> "rhn_pkg_cld_id_pk" PRIMARY KEY, btree (id)  <br>>> "rhn_pkg_cld_nt_idx" btree (name, "time")  <br>>>  <br>>> Two days ago I actually shutdown Spacewalk so I could do a "VACUUM FULL  <br>>> VERBOSE ANALYZE;" and then I rebuild every index on the DB before <br>> bringing  <br>>> Spacewalk back up again.  <br>>>  <br>>> While the query was running yesterday, I was watching a "vmstat" output <br>> and  <br>>> while it was busy, there didn't seem to be any blatant resource <br>> constraint  <br>>> with the system on the whole. A lot of block I/O and the occasional swap  <br>>> activity but definitely not thrashing.  <br>>>  <br>>> Have you made any tweaks to your postgresql.conf that you can share? That  <br>>> is  <br>>> where my head is now but I've got more reading / learning to do before I  <br>>> start introducing tuning changes.  <br>>>  <br>>> Thanks,  <br>> <br>> _______________________________________________  <br>> Spacewalk-list mailing list  <br>> Spacewalk-list@redhat.com  <br>> https://www.redhat.com/mailman/listinfo/spacewalk-list  <br> <br>_______________________________________________ <br>Spacewalk-list mailing list <br>Spacewalk-list@redhat.com <br>https://www.redhat.com/mailman/listinfo/spacewalk-list <br>