Rawheiser
Rawheiser

Reputation: 1218

How does the compression file attribute impact performance on a file save in windows?

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.

Upvotes: 0

Views: 3030

Answers (1)

Ben S
Ben S

Reputation: 69382

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:

Upvotes: 2

Related Questions