performance tuning - splitting data and logs

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Re: performance tuning - splitting data and logs

Postby six4withafro » Tue Apr 21, 2009 6:56 pm

thank you for posting these instructions.

i followed them, and the junction was created successfully, but the files reappeared in their initial location after i restarted postgres. is that what's supposed to happen?

i can't delete them now (files are in use), even after i shut down the postgres service, so i'm thinking it may be alright.
six4withafro
 
Posts: 199
Joined: Fri Mar 07, 2008 3:33 pm

Re: performance tuning - splitting data and logs

Postby kraada » Wed Apr 22, 2009 10:12 am

If you successfully created the symbolic links (aka junctions) for the files, what you see in that directory aren't actual files they're pointers to the real files on the other hard drive. Check the file size, that should tell you whether they're real files or not (links are small, files are not).
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: performance tuning - splitting data and logs

Postby six4withafro » Thu Apr 23, 2009 1:45 am

hmmm, strange. i don't have links, but i have the files in both locations (2 separate drives), both being updated. their mod dates/times are identical.
six4withafro
 
Posts: 199
Joined: Fri Mar 07, 2008 3:33 pm

Re: performance tuning - splitting data and logs

Postby six4withafro » Thu Apr 23, 2009 2:33 am

when i add something to the original pg xlog folder, it appears in the new one. i can't delete anything from the original; xp considers those files to be in use. when i delete files from the new folder, they disappear from the original folder.

and when i tried the command line entries to break the junction, they didn't work. :(
six4withafro
 
Posts: 199
Joined: Fri Mar 07, 2008 3:33 pm

Re: performance tuning - splitting data and logs

Postby kraada » Thu Apr 23, 2009 2:13 pm

What error does it give you when you try to break the junction?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: performance tuning - splitting data and logs

Postby six4withafro » Mon May 04, 2009 8:34 pm

ok, i'm trying this again.

for the record i'm running xp sp3, my root drive is c:\, postgres is on d:\ (the other partition on that hdd), and i'm creating the log file on e:\ (the first partition of another hdd).

i followed the instructions to the letter, and when it was finished the response was:

created d:\postgresql\...\pg_xlog
targetted at: e:\pg_xlog

and when i look at the two folders titled pg_xlog on d:\ and e:\, the result is the same as before. the files now exist in two places. and according to windows explorer, the files take up 128MB of space on d:\, so they're not shortcuts or dummy files or something.

i don't understand what the problem is, this makes no sense at all. are these instructions for vista or something? because they're simple command line prompts, so that makes no sense. are the files listed in the original location? because they don't look like it, and according to their properties they're not.

my only guess is that the instructions are backwords, because i want to be creating e:\pg_xlog and have it targetted at d:\, right? this is absolutely infuriating.
six4withafro
 
Posts: 199
Joined: Fri Mar 07, 2008 3:33 pm

Re: performance tuning - splitting data and logs

Postby kraada » Tue May 05, 2009 9:24 am

Actually your guess may in fact be reasonable. Would you be willing to give that a try (just create two new temporary folders and junction them or something; no need to mess with PostgreSQL when testing) and report back?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: performance tuning - splitting data and logs

Postby LVgamb00ler » Tue May 05, 2009 10:48 am

I wrote the instructions for using the WinXP junction command in this thread. The behavior that six4withafro reported is consistent with how the junction functions. There is no evidence of error or incorrect procedure in his posts. I just ran a simple test as kraada suggested in his most recent post and observed the same results as six4withafro reported. Therefor I assume that his execution of the junction command was successful.

In my experience, when using junctions there is no observable difference from the ordinary directory/file structure. To check if junctions are being used, execute the junction command in the parent directory with the name of the directory you wish to test. For instance, if you have created a junction for the directory c:\test, go to the c:\ directory and execute the command "PATH\junction test" where PATH is the path to the junction program exectuable. If the c:\test directory is indeed a junction it will display "c:\test: JUNCTION <newline> Substitute Name: x:\directory". If the directory c:\test is NOT A JUNCTION, the output will say "No reparse points found."

Any files in the target directory will be visible in both the original directory that they inhabited (target) and the junction that was created that points at the target. In reality there is only a single copy of the files, but there are TWO directory paths that point to (or contain) the single physical instance of the files.

I hope this post helps to clear up any misunderstanding of the junction function (I love the sound of that!)

G'luck all,
LVgamb00ler
LVgamb00ler
 
Posts: 32
Joined: Thu Apr 03, 2008 7:57 pm
Location: Las Vegas

Re: performance tuning - splitting data and logs

Postby kraada » Tue May 05, 2009 11:27 am

Thanks LV; I wasn't sure how windows handled the junction; I'm used to an ls -la showing that it is in fact a symlink -- and I just know what that means :)

I appreciate your coming in here and clearing things up.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: performance tuning - splitting data and logs

Postby six4withafro » Tue May 05, 2009 7:28 pm

Thanks a lot for taking another look guys; I'm truly grateful. After I made that post I did some reading about symbolic links, and (not that I thought otherwise) it seemed like the instructions were accurate, which lv has now confirmed again. It also seemed, as he said, that given the underlying mechanics of symbolic links, the files will appear to be in both places, but I'm glad to hear him confirm that as well. :D

So I gave it another shot, and this time it worked. Maybe I'm just too literal, but this is the first time that I deleted the pg_xlog folder from its original location (along with the files that it contained), and now I get the correct response when I run the test. Maybe the junction function needs to create the folder, and since it was still there it wasn't working properly. EDIT: the more I think about it, the more sense that makes; if it's still there, it can't be created. :oops:

Thanks again!
six4withafro
 
Posts: 199
Joined: Fri Mar 07, 2008 3:33 pm

PreviousNext

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 11 guests

cron