0

I am load testing an application that is essentially an upload/download request/reply. Upload a file, zip the file, send the zipped file somewhere. I want to load test it by sending files of X bytes to see where my limitations are. I'm creating files of the byte size I want, but due to the nature of zip, there's really no telling what that file size will be when it's zipped up and sent back down. So I'm sending a 400M file up, it's getting zipped down to, say, 170M and getting sent back. This doesn't really test the mechanism as I want it to. I want to be able to send up a 400M, let the zip happen, but still have 400M that gets sent down....

Basically, how can I create a data file, that cannot be zipped?

1
  • For testing, run the zip step, and then just send the original file back.
    – waltinator
    Commented Oct 28, 2021 at 2:24

2 Answers 2

1
dd if=/dev/urandom of=file bs=1M count=400

Will produce a file file which zip will not be able to compress at all. Zip will also not be able to compress previously compressed data, including video files.

2
  • +1 I was going to say something similar: "Zip will also not be able to compress previously compressed data" — including (already) zip'ed files :-) But I like the idea of using video files, etc., over pre-zip'ing zip files for testing, since that's a better "real world" scenario.
    – michael
    Commented Oct 28, 2021 at 8:17
  • Thank you, that did it Commented Oct 28, 2021 at 11:34
0

You can use a previously compressed or random file (but there is no guaranty It won't compress, especially if the files is small), but the most straightforward method is to use the -Z store option of the zip command which will simply store the files to the archive without compression (assuming you use the zip(1) command).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .