views:

177

answers:

1

QUESTION:

If I set the compression attribute on a directory on a windows server, how does that effect file saving performance?

WHY I WANT TO KNOW:

I have a server that several batch processes save huge files on, and these are mostly Txt or CSV files that I'd like to compress to save disk space.

If it does compression on the fly as it writes the files, I would have to look for CPU usage when writing, and that may be an issue.

If it writes them uncompressed, and a background thread later compresses it, that would be ideal - as the batch processes would not be slowed down when they do their writes.

My alternative solution would be to not set the attribute on the directory, but have a scheduled job run the compact command on these files.

A: 

This isn't programming related, but here goes anyway:

Reading and writing from disk will require some extra CPU processing since compression is a CPU intensive task.

However, reading and writing files is typically I/O bound, not CPU bound. So your computer will spend more time waiting for the data to be written/read than it will waiting for data to be compressed/uncompressed.

So long your server isn't CPU starved, you shouldn't see a big change in performance.

Of course, before you implement any kind of changes like this, do some testing in a test environment that simulates your real server conditions.

Edit:

Ben S
Thanks for your answer. Perhaps this was a better question for ServerFault. I am having the system guys here do the research on the CPU and IO capacity on that server. I was really looking for an understanding of how the compression thing in Windows works under the covers. * Does it bypass ZIP files? Does it save the file uncompressed, then scan it and compress it? Does the disk system return a completed signal before compression is done, so the application isn't slowed down too much? etc... "Knowledge is Good." - The motto of Faber College.
Rawheiser
I added a couple of links with technical details, as well as the MS best practices for compression.
Ben S

related questions