"Render threads": Understanding Threads vs. Cores

Kevin R wrote on 10/15/2010, 2:07 PM
Earl J wrote in the "NEW: Rendertest-2010" thread:

"I believe the term core is also interchangeable with thread"

The answer is No. But they are very related and worthy of understanding.

Earl J's post spurred me to write the following for anyone interested in understanding CPU cores, hyper-threading, program threads, program processes, and how they relate to rendering in Vegas and adjusting the number of rendering threads in the Vegas preferences window.

HARDWARE

CPU (Central Processing Unit): The part of a computer system that carries out the instructions in a computer program to perform arithmetic, logic, and input/output functions.

Core: Essentially, a 'core' has the same definition as CPU. Any CPU contains some ancillary electronics and the core is the actual part where programs are executed. The term 'core' isn't traditionally applied to single-core CPU's and gained use with the advent of multiple-core CPU's. A multi-core CPU is basically the same as multiple CPUs and can execute multiple programs at once.



THINK OF YOUR CPU OR CORES AS YOUR AVAILABLE MANPOWER. EACH CPU OR CORE IS ONE 'MAN' ABLE TO PERFORM WORK.[/B]. Vegas is a program. Software, like speech, is not physical--though (again, like speech) it can only be delivered on physical media (CD, electronic signals, sound waves, etc.). Software is simply a list of instructions that tell the CPU to do something. An application like Vegas contains millions of instructions. The instructions all software are built upon are extremely small and simple operations: Move '34' to this memory location. Subtract 3. Subtract again until the answer is an even number. -- It takes MILLIONS of instructions to simply move your mouse pointer across the screen! At 3 GHz (3 billion operations per second) these millions of instructions happen in milliseconds.



Process: A process is a program, but the term is technically very specific. A process is a single program that is allocated its own unique memory space in which to execute. The operating system (Windows/Linux/Mac) performs the allocation of memory (and other resources) and then launches the program within that space. Each process is separate from all others on the machine. Task Manager displays PROCESSES. If you open three copies (called instances) of a process -- say, Internet Explorer -- you will see three separate Internet Explorer processes in Task Manager. You can kill a process without affecting other processes, as long as the two processes don't rely upon each other.



Each process does it's own thing, but processes may communicate with each other towards a common goal. A process may spawn (create and launch) other processes or sub-processes owned by the parent process.

THINK OF PROCESSES AS A LIST OF INSTRUCTIONS ON HOW TO BUILD A HOUSE. YOU'LL NEED MANPOWER TO DO THE WORK (THE CPU!) TWO MEN (CORES) GETS THE HOUSE BUILT TWICE AS FAST! YOUR PROGRAM MIGHT SPAWN A SEPARATE PROCESS TO DO THE LANDSCAPING (ANOTHER LIST OF INSTRUCTIONS AND MORE MANPOWER).

Sidebar -- Vegas processes: Opening Vegas allocates and launches a main process (vegas100.exe) as well as several sub-processes which can be seen in Task Manager: ErrorReportLauncher.exe, FileIOSurrogate.exe, sfvstserver.exe. Each process is a SEPARATE program. It is their combined functionality that comprises the Vegas application. Multiple processes are common with larger and more complex software applications. Most applications only have one process.

- - - - -

NEITHER HARDWARE NOT SOFTWARE

Context (or State): To understand threads we must understand something called context, also called state. Imagine you are a CPU core (a worker man) and you are pounding a nail. To be specific (and computers are VERY specific), you are on the sixth swing of your hammer out of the eight necessary blows needed to drive nail #34,751 in our house. Suddenly, you are interrupted by a call from your wife on your cell phone (the operating system, in this case). Your wife has a question she needs help with (the operating system needs your help to move the mouse arrow pointer one pixel over on the screen). After your interruption is over... What were you doing? Where were you at? In order to return to your previous task you must pick up from EXACTLY were you left off. Oh, that's right! Your arm was on the upswing of blow number 6 on nail #34,751. The precise position you were in is called your state. To resume blow number 6 on nail #34,751 after the interruption, you must be returned to the same state or context you were in previously--kneeling, nail in your left hand, hammer in your right, raised over your head--in order to continue.

The operating system interrupts the worker men (cores) thousands of times per second. This is because there are dozens of things that go on all at once in your computer that can't wait (or the mouse cursor freezes--you've seen that, right?)

The operating system stops a worker and SAVES THE CONTEXT of what he was doing so that he can return to that job a few millionths of a second later. This is called a context switch.

Thread: A thread is simply a task that is in the middle of being done (driving a nail -- or -- rendering a frame of a video). Threads are tasks that are in progress--threads are not hardware (the CPU or cores provide men to DO THE WORK); NOR are threads software (which provide the INSTRUCTIONS for the work). Rather, threads are the tasks embarked upon.

Let's try to illustrate better: You put one man (one CPU) to work building a house. The software is the list of instructions to complete the job. A single task is embarked upon at a time, completed, then a new task started. This is called single-threaded execution. All processes have at least one thread. Without a thread, the program just sits and takes up memory with nothing going on (no work on the house).

But now, let's say, you have four men (four CPU cores) available. If we operate in single-threaded fashion only one man is working at a time, so 75% of our manpower is sitting around drinking beer! No good. Thus, we utilize multiple-threaded execution to take advantage of all the available manpower. Now, our program (process) spawns four separate tasks (threads) at a time and puts everyone to work --- you pound nails, you hang drywall, you paint, etc.



In reality, Vegas spawns DOZENS of threads. Each thread of execution gets a small task done. Moreover, the operating system is juggling dozens of processes each with their own set of threads--THERE ARE LITERALLY HUNDREDS OF THREADS OF EXECUTION in existence on your machine at any given time.

IMPORTANT CONCEPT: ONLY



Thus, out of hundreds of threads, your fancy-dancy quad-core i7 only has FOUR HYPER-THREADED WORKER MEN available at once. Only EIGHT threads are being worked on out of hundreds!!??? How does anything get done??? The answer is the context-switching we talked about above. Each thread gets a 'man' assigned to work on it (by the operating system) for a few microseconds at a time, dozens of times per second. Thus, the entire work of all threads in all processes in all the programs running on your computer makes progress in tiny time-slice intervals.

But importantly: To YOU, the user, it appears all your programs are running at once! In reality, the 'worker men' in your CPU are dividing up their time amongst all the threads. The 'worker men' are interrupted by context-switches thousands of times per second to achieve this apparent parallelism.

Now, imagine if your wife interrupted you a thousand times per second?



- - - - -

VEGAS RENDERING THREADS (ALL THREADS ARE NOT EQUAL)

If you open Task Manager, you will notice that the "Processes" tab has a column for "CPU". This is the percentage of CPU time that is being spent servicing all of the threads that belong to that process. You'll notice a lot of the processes have a big fat 0% next to them. This is because the threads within that process are idle and don't have any task to do. Maybe our house painting task is waiting for the drywall task to finish (or your printer is waiting for a print job). In any case, when the CPU context-switches to idle threads, the thread simply cedes control back to the CPU so that valuable worker man time isn't wasted.



When your computer is idle, the "System Idle Process" spins away to use up excess CPU time and you'll see a substantial percentage of time next to it in Task Manager (the CPU cannot stop working just like your car motor doesn't shut off at a stop light, though it does use less power at idle).

When you start a rendering job in Vegas, it spawns multiple threads, giving each a part of the task. The reason for this is to ensure that there are enough concurrent tasks (threads) to keep the manpower in your CPU cores busy and the job gets done more quickly.

Vegas allows you to adjust the number of threads spawned for rendering work. There are many reasons (and theories) why you might want to adjust this. In general, you want at least the same number of threads as you have CPU cores so that all cores have work to do. If you have a hyper-threading CPU (Intel) then you might want twice as many threads as CPU cores.

But, remember our discussion about hyper-threading? If two threads are doing the exact same work hyper-threading is less effective and can even slow things down. Experimentation would likely reveal that hyper-threaded cores do not double CPU output (halve rendering times).

It would be very useful to do some test renders with each of the various output codecs using different numbers of rendering threads. One codec might utilize hyper-threading effectively, and another might be hindered by hyper-threading. One user suggested on this forum to spawn one less rendering thread than CPU cores available to leave time for the main program to run. Is this effective? It would be interesting to test!

What if Vegas is slowing your computer down too much? Say you want to render in the background, but still have other applications (processes) that need substantial CPU time. In Vegas you can adjust the number of rendering threads down so that you leave CPU cores not working and available to threads belonging to other processes.

Comments

Stringer wrote on 10/15/2010, 2:20 PM
Thanks for that info ..
I do know that enabling hyper-threading reduces my render time noticeably, so Vegas definitely takes advantage of it..
Kevin R wrote on 10/15/2010, 2:24 PM
Vegas certainly does; however, the efficiency certainly also varies depending on the chosen output codec.
Stringer wrote on 10/15/2010, 2:37 PM
I know what you mean .. Most of my output is NTSC DVD, and CPU utilization is only 60 - 80% ..
When i run something like the Render Test, it is 100% ..

I hate to see that wasted power..
Kevin R wrote on 10/15/2010, 2:48 PM
"Most of my output is NTSC DVD, and CPU utilization is only 60 - 80% ..
When i run something like the Render Test, it is 100% .."

Ah! Are you talking DV renders or MPEG renders? It MAY BE that your computer is Disk Bound during simple DV renders that are less compressed. Disk Bound means that the CPU is starved for work because your disk drive cannot keep up--it is "bound" by the disk speed.

DV renders are less computationally intensive (as long as effects are minimal) and often require more disk activity than CPU.

The opposite is called CPU bound. Your computer is ALWAYS bound by SOMETHING -- disk bound, CPU bound, network bound, memory bound, etc. The term 'bound' refers to whatever bottleneck is holding things back. Eliminate it and something else becomes the bottleneck. To not be 'bound' implies a task is completed instantaneously in zero time.
Earl_J wrote on 10/15/2010, 8:38 PM
Hey Kevin,
I recall when hyper-threading first arrived... and since I haven't heard much about it in recent days, I just thought it was a fad of smoke and mirrors and died a quiet death since its introduction (grin) ...

So, when this discussion came up, I piped in what I thought without having any real idea where to find the real answer or any real motivation to go traveling down that trail... I have always known we have some very knowledgeable individuals here not only about video, but also computers ... just so few are willing to take the time and effort to compose something like you contribution... (wink)

Thank you very much for the refresher/review/introduction (you covered quite a bit of ground here, a bit in each category) ...

So those guys who reported over a thousand threads were accurate...
I just need to find the thread number next time I run the test... or do any sort of test for that matter. So, generally speaking, the more threads running during render, the quicker the process - but not necessarily so (sigh - grin)

I guess I'll never understand everything I know about computers. . . (lol)

Thanks again. . . until that time ... Earl J.
Kevin R wrote on 10/15/2010, 8:52 PM
I'm not sure about "thousands" of threads. Threads are identified to the operating system by a Thread ID (TID) number and Processes by PID number. Someone might be getting the TID number confused with thread count??? (And, we're not talking fine linens here!)

If you want to replace Task Manager with something REALLY great, download and install "Process Explorer" which is what the pros use:

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Process Explorer is a Microsoft program (so it's safe) and displays MUCH, MUCH more information about each process, including sub-processes, and each and every THREAD.



FilmingPhotoGuy wrote on 10/15/2010, 10:47 PM
Thank you Kevin for taking the time and effort in illustrating this so clearly and effectively. Also the diagrams and pictures, very apt.

I'm a bit confused, in another thread you mentioned that the data on a hard drive is read faster on the outer edges then the inner. I always thought that, although there is more space on the outer edges, it stores the same amount of data per sector than the inner where the bits are close together (imagine a cake being cut from the center outwards) each being a sector and then formatted with concentric rings. So, although more physical space, each formatted piece holds the same amount of data 1024 bits (eg.FAT16)

Is this correct?
Kevin R wrote on 10/15/2010, 11:14 PM
LightAds,

Your understanding was correct some 15 years or more ago. Today's drives format more sectors on the outer tracks to maintain equal "areal density" (bits per square inch). There are many more sectors on the outer tracks rotating at the same speed as the fewer sectors on the inner tracks. This equates to much faster transfer rates on the outer tracks.

Additionally, with the drive heads on the outer tracks there is MUCH more data within a short reach as compared to the inner tracks---which translates into quicker seek times as the head actuator doesn't need to move as far--the heads are closer to more data on the outer tracks than they are when positioned on the inner tracks.

Many high-end database applications have been built with drives that are maintained at 1/2 full or less for these reasons.

MORE---

Seek time (head movement) carries the largest penalty for data access as not only does the head actuator have to move and precisely align the heads, but also the heads need to wait until the desired sector rotates around underneath the read head. This is called rotational latency. For this reason, higher RPM drives are much faster because the data rotates to the head faster.



Opposite of intuition--higher RPM drives DO NOT necessarily read data faster than slower RPM drives. One might think because the data is flying by the heads at a higher speed it gets read faster. In actuality, today's big terabyte drives pack the data in so tight that it is flying off the disk even at low RPMs (5,400 RPM)--fast enough, in fact, that the data is often read faster than the interface cable can transfer it to the computer. ONCE AGAIN: High RPM = fast seek time (low rotational latency), not necessarily fast transfer rates.

VIDEO FILES VS. PROGRAM FILES

TO DESIGN A STORAGE SOLUTION IT IS IMPERATIVE TO UNDERSTAND: (1) The TYPE of data you are storing, and; (2) How you are ACCESSING your data. I cannot stress this enough!!!

VIDEO DOES NOT NEED "FAST" DRIVES!!!
When people think "fast" drives, they think of high RPM drives. Video requires high transfer rates, not fast access times.

High RPM drives yield fast seek times, not necessarily high transfer rates. Video files are very long sequential files and the drive heads are not jumping all over the disk--they are simply stepping across track by track. This, of course, is subject to NLE where you might be editing massive numbers of small clips... nothing is black and white...

Today's low RPM terabyte drives have exceptionally high transfer rates and are cheaper, and run cooler than high RPM enterprise drives. You don't need a 7,200 or 10,000 RPM video drive (yes, there are plenty of exceptions including most RAID-suitable drives are not the low-end, low RPM sort).

OPERATING SYSTEM/PROGRAM DATA *DOES* NEED FAST SEEK TIMES
Use fast, high RPM drives for your operating system (your C: drive). THIS will pay off, especially a RAID 1 mirror configuration. DO NOT use RAID 5/6 for your operating system drive. RAID 5/6 excels for long sequential reads/writes, not short scattered files.

SEGREGATE YOUR STORAGE ACROSS MULTIPLE DRIVES OR RAID VOLUMES
By far, the largest performance gain will be had if you can afford to purchase several drives. Place your OS and programs on a high RPM RAID 1 mirror (fast seek time). Place your data on a separate volume. Place your video on a low or medium RPM RAID 0/5/6 volume (fast transfer time). Pick up another drive or two for your swap file... etc. The more you segregate, the faster your system will become.

Your best system will utilize a solid state drive (SSD) for the operating system, and large drives for data.
FilmingPhotoGuy wrote on 10/15/2010, 11:33 PM
Your understanding was correct some 15 years or more ago.

LOL I just sent my DOS Bible for recycling. Thanks for the update.
Grazie wrote on 10/15/2010, 11:52 PM
"Pick up another drive or two for your swap file... etc."

Now that is intriguing! I can get better performance by desegregating the SWAP from my System C: drive?
Makes sense, but I would never had thought that this was an option. How would I go about it? And what ballpark improvement would/could I achieve?

Lastly, thank you for your great work here.

In total awe,

Grazie
farss wrote on 10/16/2010, 12:22 AM
" Video requires high transfer rates, not fast access times."

Not so certain I agree with that. I know you did say "nothing is black and white..." but I'd suggest that in this case it is very grey. Assuming that video is going to be stored in one nice sequential file and will be read as such is perhaps a tad optimistic. Throw in a couple of audio tracks along with a couple of camera tracks and those head will be doing a lot of work. To further compound the problem is elevated seek which optimises head movement but I feel may not always give the desired outcome for what we're doing.

Also as you pointed out earlier there'll always be some bottleneck when it comes to rendering and disk i/o can be a quite significant one. It is probably the cheapest one to do something to improve. Many here use low compression digital intermediates because they're easier to decode and hence easier to edit. On the flip side data rates are higher so again buying the fastest disk systems can be money well spent. The difference in cost between 5,400 RPM and 7,200 ROM drives is very small. The next step up to 10K RPM and beyond is expensive so for my money 7,200 RPM 1TB drives are the sweet spot. I keep the 5,400 RPM ones for archiving.

Bob.



Kevin R wrote on 10/16/2010, 12:40 AM
Hi Bob,

I agree, more or less. It's a balance. I think my point was having a SEPARATE C: DRIVE will yield substantial gain over installing Windows on your 2 TB monster with all your data.

Not sure drives are the cheapest upgrade since I prefer enterprise class drives, which are at least double the price of desktop drives. Traditionally, I've found the cheapest performance gain is adding memory since most store-bought machines are less than built-out and memory has been dirt cheap recently. Of course it all matters what you are upgrading FROM as to where the cost baseline is.

I fretted about my system design for days and weeks before building it, so there is certainly not any one-size fits all remarks that can be made by me.
ChristoC wrote on 10/16/2010, 12:45 AM

Kevin, magnificent gush of information; Thanks!
ushere wrote on 10/16/2010, 1:34 AM
another vote of thanks to an informative, not to say extensive email.

thanks kevin.
farss wrote on 10/16/2010, 2:43 AM
"I prefer enterprise class drives"
If you mean SAS drives then yes, ouch!
The other so called SATA enterprise drives seem to be mostly smoke and mirrors from what I've read. Conventional drives had a subtle issue when run with some controllers in RAID when they encountered a correctable read error. From what I read this problem is pretty much in the past but you can still pay a premium for nothing if you want to.

Bob.

Randy Brown wrote on 10/16/2010, 7:32 AM
What a great thread...thanks!
I have 3 other drives besides my C drive.
Would the following be the way to move the swap file (it's for Vista but it looks the same in Win 7)
http://mintywhite.com/vista/vmaintenance/performance-boost-move-page-file-to-another-physical-drive/
Thanks again,
Randy
Randy Brown wrote on 10/16/2010, 9:11 AM
My CPU only shows 4-8% usage when building peaks and can take a long time to do this.
Would this mean the "bottleneck" is in the hard drive that contains the video/audio files?
Thanks very much,
Randy
Kevin R wrote on 10/16/2010, 10:41 AM
Randy,

YES. That is the way to move your swap file. If you didn't realize looking at that page, your swap file can exist on more than one drive. Consider what fast volumes exist in your system and spread it out.

Use a small separate FAST drive for your swap file. Your swap file is usually 1 to 2 times the size of your memory, so it's not too big. The best volume for a swap file is a FAST single drive, or a stripe set (RAID 0).

SWAP FILE TIP:
In lieu of an entirely separate drive DO THIS: Create a small partition at the first part (the FAST outer tracks--see previous post) of one of your volumes--assign it letter P: or S: (Page or Swap) and put your swap file there. Creating the separate partition is important! Ever do a defrag and see that section of blocks that "can't be moved"? THAT is the swap file! You preferably don't want your swap file all mixed in and fragmented with other data. Put it on it's own partition FIRST thing on your drive (if you aren't crazy enough to buy a separate drive).

TIP #2 (COMBINE TEMP DRIVE & SWAP):
Consider this: Install a small to medium-sized FAST SSD drive and use it BOTH for your swap file and also your temp drive for Vegas, Adobe, and other programs. By combining functionality, it now may make the cost worthwhile. By using an SSD you do not need to create a separate partition for the swap file. If you use a fast hard drive (say, an older smaller Western Digital Velociraptor or Raptor), then you do need to create a swap file partition.

Now, I don't separate the swap file myself--however, I'm using SSD's for my C: drive and I'm comfortable with the speed of things. The swap file and temp space help, but I wouldn't make it my first consideration in designing a storage solution.
Kevin R wrote on 10/16/2010, 11:22 AM
RE: "My CPU only shows 4-8% usage when building peaks and can take a long time to do this.

A very good observation. To know for sure if the machine is disk-bound during this operation would require some performance testing. Perhaps Vegas just takes it's time (as this is somewhat of a background task) so your machine isn't slowed down badly.

Thus, I opened up Resource Monitor (built in to Windows 7) to take a look:

Note: Windows XP users can use the similar Performance Monitor tool by typing "perfmon.exe" into the "Run" box.



I dragged a 4-hour MP3 file onto the Vegas 10 time line and watched. Small spike in CPU activity and similar increase in hard disk activity. But how to know if that's the limit of my hard drive's ability? Hard drive performance isn't measured 0-100% like the CPU.

So, I just copied and pasted a large file on my hard drive to see what a giant copy operation looks like. The hard drive activity in Resource Monitor spiked ten times as compared to the "building peaks" operation in Vegas.

I think it's safe to conclude that Vegas simply throttles the "building peaks" operation in the background and it isn't running anywhere near full speed. Personally, I think most of us would like to see it run full-speed, but there are times where it's nicer to have it in the background.
farss wrote on 10/16/2010, 2:38 PM
"I think it's safe to conclude that Vegas simply throttles the "building peaks" operation in the background and it isn't running anywhere near full speed. Personally, I think most of us would like to see it run full-speed, but there are times where it's nicer to have it in the background. "

From my experience its hard to know just what's going on when Vegas is building its peak files. As you've found it doesn't appear to be doing much however trying to get Vegas to do anything else at the same time is not such a good idea I've found. One can easily get into a situation where Vegas appears to have locked up although it actually hasn't, you just need to wait for the peak build to complete. Reason I mention this is building peaks for MXF is very slow. That makes some sense as the file size is moderately large i.e. Vegas has to read a lot of data just to extract the PCM audio.

One of the most common complaints I read here is about renders taking too much time and the CPU appears to be doing very little. One may conclude that the systems is disk bound however the issue is not quite that simple. No matter how fast the disks are the data still has to move accross a buss and get into RAM. Depending on many factors including mobo design the CPU may well be unable to do much while this is happening hence CPU utilization appears low even though it maybe working as hard as it can.

Server class mobos and CPUs appear to be better optimised for these kinds of tasks. When SCS first announced their 'preferred' Vegas systems many here protested that such systems were a ripp off as one could buy seemingly the same speed CPU and amount of RAM much cheaper using gaming system components. I'm far from certain this is the whole picture.

Bob.
Kevin R wrote on 10/16/2010, 2:52 PM
Bob, More performance testing could reveal some of those things you speak of. What I can tell you is that it appeared Vegas was only using one CPU core (single thread) to build peaks. And, only a slight rise in that one core's utilization at that. Also, I imported a 192 MB MP3 audio file--hardly a large file in terms of current disk access and bus transfer speeds (especially on my system).

The SCS systems are nice, but the price could be handsomely beat by building your own. Additionally, I feel if you are building something that pricey you should try to customize a bit more closely to the exact work flow it will be used in, which would involve possibly choosing more suitable storage configurations per customer need.

Kevin
farss wrote on 10/16/2010, 4:05 PM
My advice if looking to spend serious money would be to use a systems integrator who has a proven track record in building systems for video editing. You do pay a tad more than putting it together yourself but I found the few extra dollars worth the money:

1) I had an issue and had a man at the door in under 30 minutes and the RAM that wasn't seated properly fixed in another few minutes.

2) Ongoing support. I wanted to add a Decklink card and what wasn't immediately obvious was which slot it was fitted to would make a quite a difference. The guys I bought the system from were very helpfull.

I find there isn't a whole lot of info on the web for people building video editing systems compared to gaming and corporate application / database servers. Video is quite unique in its needs. In the corporate world its transactions per second, dooesn't matter when in that second any transaction occurs. In the video world if a frame or sample is not delivered on time its useless when editing.

Bob.
Randy Brown wrote on 10/17/2010, 12:30 PM
DO THIS: Create a small partition at the first part (the FAST outer tracks--see previous post) of one of your volumes--assign it letter P: or S: (Page or Swap) and put your swap file there. Creating the separate partition is important!
I need you help before I screw things up.
Okay as far as I know I have created a partition on my E drive ( following the destructions on this page http://www.sevenforums.com/tutorials/2674-partition-volume-create-new.html ) and I gave it the letter drive S: and named it swap file (please see this snippet:) http://picasaweb.google.com/lh/photo/HbOdCZ9kVdZAn3TPQlqSux1SlqbChzsSiAY5ZeadwhA?feat=directlink
I have no idea if it's at the "first, fast, outer, tracks" or how to do that.
I am at step 7 of the page I mentioned earlier ( http://mintywhite.com/vista/vmaintenance/performance-boost-move-page-file-to-another-physical-drive/ )
Can you tell me what to put in those boxes if I have 8 GB of memory?
Thanks very much Kevin,
Randy
Stringer wrote on 10/17/2010, 2:26 PM
The recommendation I have heard is twice your physical RAM; in your case - 16gb ..

Make sure the partition you set up for the page file is not much larger than this, maybe 20gb or so; and don't use the partition for anything else.