Feb 3, 2010

Photoshop Optimized Computer II

For Part I of this series click here.

Let me begin Part II by explaining what I view as a 'Photoshop Optimized Computer'. Obviously that means a computer whose hardware/software is set up in a way which allows Photoshop to run in the most efficient and fastest way possible. But what special hardware or software is needed to allow this efficiency to occur? How is a 'Photoshop Optimized Computer' (I think maybe I should try to trademark that little phrase before someone else does) different from the standard computer you might pick up anywhere?

In order to answer this, we need to know a bit about how Photoshop itself works. More specifically, we need to know about the software's data handling strategy. Now, I need to point out that my 'day job' has nothing to do with computer programing.....so, if I make a mistake in any of these posts I would be more than happy to have someone out there correct me.

When one opens a file using Photoshop, the program puts the data into RAM. If there is not enough RAM to handle the file, or if in the process of editing the file by adding layers etc the file becomes so large that it doesn't fit into the available RAM, then Photoshop writes that data to a physical hard drive that it has set aside for itself known as the 'scratch disk'. The specific drive or drive volume that Photoshop uses for the scratch disk can be chosen in the Photoshop Preferences. It should be recognized that:

1) Not all the RAM in the computer can be devoted to Photoshop use, as some of it is needed for use by the OS (and 32 bit programs limit the amount of usable RAM to 4 GB).

2) Once the data file gets large enough to require Photoshop to write its data to a physical hard drive things move much slower since the speed at which data can be written to a physical drive is much, much slower than the speed at which it can be stored in RAM.

So what conclusions can be drawn from this information? Knowing that things move much faster when Photoshop has enough RAM to write to tells us that the more RAM the better. And then more! And to allow Photoshop to utilize all that RAM, it would be optimal to use a 64 bit OS in order to remove the 4 GB RAM limit that is imposed by a 32 bit OS.

However, no matter how much RAM is in the system, Photoshop still needs to use the scratch disk to some small degree, even if the file itself fits fully into RAM. For this reason the scratch disk should be optimized, even in systems with a good deal of RAM. How does one achieve this optimization? It can be done in two ways.

The first and most important way is to put the scratch disk on a separate physical drive from the OS (the Photoshop application itself can be installed on the OS boot drive...some say it is optimal to install it there, as opposed to on another drive). That way the drive head can read and write to the scratch disk without having to do anything else. If the scratch disk were on the same physical drive as the OS, that disk's read/write heads would be slowed down by having to perform both the scratch disk duty as well as the reading and writing that the OS requires, such as writing to the page file and other required duties (don't move your page file to the scratch disk....if you don't know what that means just forget about it, as it's not there unless you put it there yourself).

The second way to optimize the scratch disk is to not only put it on a separate physical disk from the OS, but also to make this separate disk as fast a disk as possible. Options thus include, going from slowest (worst) to fastest (best): 5400 RPM drive, 7200 RPM drive, fast 7200RPM drive (no, not a separate type but 'better' because of increased cache, number of microprocessors etc), 10,000 RPM Western Digital VelociRaptor (though many would argue that there are some 7200 RPM drives out there that function faster than the 10000 RPM VelociRaptor) and, finally, a RAID 0 array.

A RAID 0 array is simply using two disks that appear to the OS as a single larger disk. Data is written to the array by splitting it and having half of it go to one disk and half to the other. Therefore each physical disk has to write only half as much and they can both do it simultaneously since each disk has its own read/write head. If one of those two disks fail all the data from the file is lost and can't be reconstructed....but since the scratch disk data is used only temporarily while the file is being worked on.....who cares?

Notice I didn't include a solid state drive (SSD) in the list of options. Though an SSD would be superb for data storage, the OS, or use in a RAID array, the current feeling is that as a stand alone disk it is not optimal (in addition to its being very expensive) for use as the scratch disk. The reason for this is that, while SSDs have blazing fast read speeds, the current write speeds (except perhaps for the super premium Intel E series SSDs) are no faster, and possibly slower, than a fast hard drive. The important fact to recognize here is that, for a scratch disk, the write speeds are much more important than the read speeds. This, then, is what makes the SSD, at the current level of technology, perhaps a sub-optimal scratch disk....or at least a scratch disk that is no better than the current breed of hard drives but costing far more.

So, to sum up:

1) OS and Photoshop on the same drive

2) RAM and more RAM

3) 64 bit OS so that RAM constraints are removed

4) Scratch disk on a second physical disk that is separate from the OS boot disk and

5) Make that separate physical scratch disk a fast one, with a RAID 0 array being optimal.

Want to dig a little deeper? Try this article from the Adobe Knowledge Base or this one, which is exceptional, from Lloyd Chambers. Though the second one discusses performance on a Mac, the information it contains, for the most part, can be applied to a PC as well.

I should mention one caveat, and that is that in this discussion I am assuming that large files are going to be worked on. If you are just working with very small files all of this might not be necessary. But if you are starting with large files (I shoot in RAW format with a Canon 5D MKII) that you then edit with many layers, use smart objects etc....then this info is for you.

5 comments:

doonster said...

You missed the possibility of a RAM disk. Creating a virtual disk from extra RAM over the 4GB makes all paging file work really fast.

Another thing I've observed from Adobe products is that, aside from the scratch disk, they use as much virtual memory as actual RAM, so fast paging files are essential.

Another thing to note about SSD, which you miss, is latency. Scratch disk work is actually a lot of to and fro, in a non-constant mode (rather than sustained writes) so I think (not tried) that the lower latency of SSDs would make a noticeable improvement in scratch disk performance. Certainly, despite the comparison in sustained write performance, SSD is noticeably faster in real-world use.

Howard Grill said...

Hi Martin...I am glad to have you add some info. I hadn't mentioned or considered RAM disks because they just seemed a bit too complicated to an intermediate knowledge computer guy like myself. I have read about them and read what you have said. Does making the RAM disk remove that RAM from Photoshops availability to load the file into RAM and now allow its use only for scratch? Its just not something I have really had a good understanding of.

I have heard varying opinions on the use of a single SSD for a scratch but haven't been able to find anything with hard data. A fast SSD would certainly make a more expensive scratch. It is certainly possible that you are right but I am hoping with lots of RAM and a RAID0 scratch that the scratch use will be minimized and still fast enough! Would love to have some real life hard data on it, as what you say makes sense

Again, I really appreciate your taking the time to add your thoughts

doonster said...

Howard - to answer your question, depends on how you set iup the RAM disk. For me, I've got 8GB RAM installed but the OS can only get at the first 4. The rest is assigned to the RAM disk so it is extra on top of the max RAM.

Looking at how Adobe products seem to work (and I can't comment specifically on the latest PS as I don't have it) it wouldn't necessarily matter if you had only 4GB installed and used half for a RAM disk as the software tends to use memory 50/50 (real/virtual). Of course if you use huge files that exceed 2GB required you'd run into problems.

Mike Mundy said...

This computer is starting to sound as if it's going to be really expensive.

I have a bad feeling about this.

Howard Grill said...

Actually, Mike, turns out it is more moderately priced than really expensive...but clearly more than an entry level machine. It cost in the upper twos (no monitor...using my old one) and came in significantly less than a Mac Pro which starts at about 2500 for entry level. And I could have made it cost less if I used 6 of RAM instead of 12 (which still would have been quite good) and if I didn't get the SSD.